SEARCH
TOOLBOX
LANGUAGES
UserInteractions

UserInteractions

From SOFAWiki

Jump to: navigation, search
Using the mouse manager in SOFA


Contents

Sofa Mouse Manager

A Mouse Manager has been created in Sofa, allowing to easily create and change the interactions with the different buttons of the Mouse.

This panel is available through: Edit -> Mouse Manager


The basic interactions are from now (see below parts for further informations):

  • Attach an object to the Mouse: when clicked, the mouse casts a ray, and create a spring between a point in the ray, and a DOF encountered (if one has been found in the proximity of the ray)
  • Fix picked particle: when clicked, the particle of the collision model near the mouse is fixed using a stiff spring.
  • Incise along a path: pressing the mouse, you can proceed to an incision following the path of the mouse. (Only available for triangular mesh)
  • Set action potential using the mouse: allow to inject a potential value to the nearest DOF encounter by the ray.
  • Perform topological operations: useful to make some topological changes. Only primitive removal available for the moment.
  • Add a spring to suture two points: allow to create a spring, with a null rest length, between two points, in order to join them.
  • Add a Frame to Skinned model: ???

Operations available

Further informations for specific mouse interactions.

Attach an object to the Mouse

when clicked, the mouse casts a ray, and create a spring between a point in the ray, and a DOF encountered (if one has been found in the proximity of the ray)

When clicking on shift, collision model will appear (first figure), Then clicking with button mouse without releasing shift will allow to move selected dof (second figure). Then, releasing mouse button will let the object come back to it rest position (if the mechanical behavior allows it). Whereas releasing shift first will freeze the object in the current position.


Fix picked particle

when clicked, the particle of the collision model near the mouse is fixed using a stiff spring.

When shift is pushed, collision model will appear (first figure), Then clicking with button mouse will fix the particle of the collision model near the mouse using a stiff spring.


Incise along a path

This operation allow to simulate incision on a triangular mesh. There are two methods available for performing incision:

  • Through segment

In this method, first click set starting position of the incision and second click set ending position. Then incision will be performed between these points. If you don't release "shift" button then you can continue clicking. Incision will be performed between previous point and this new one. Thus you can obtain successive incisions. (see fig1 to fig3)

Advanced settings are available for this method:
  1. Distance to snap from border: This allow to perform incision until or from mesh borders (see figures behind). To do this, you need to click near a border. Thus, this parameter define the area in which the position of the click will be "assimilate" as on the border. To go further into details, for a triangle on the border of the mesh. This area is defined by the border and at maximum it's barycentric point. Thus taking a value of 100% means that a click between the border and the barycentric point will be considered as a click on the border. In this case, two options appear. Either the click is near a vertex (on the border), and then incision will be expand to this last on. Or incision is perform until the orthogonal projection of point clicked, on the border.
  2. Distance to snap along path: This allow to perform an incision without creating small triangles along the incision path. For example, if the incision path pass near a point of a triangle, instead of cutting the edges and thus create a new small triangle, this last point will be moved on the incision path. Here again the pourcentage is link to the area. Thus for a value of 100%, this mean that it the incision pass between a point and the barycentric point. This last point will be moved.

  • Continually

In this second method, first click will initialize the incision and then the incision will follow mouse movement (like if the mouse was a scalpel). Here again, "shift" release will end the incision. For the moment, this method doesn't handle snapping options.

Set action potential using the mouse

This operation allow to inject a potential value to the nearest DOF encounter by the ray. Two parameters have to be specified:

  • The value to inject.
  • The XML tag of the mechanicalObject in which this value will be set.

Here for example we simulate a triangular heat diffusion by injecting "hot" values:

Perform topological operations

Different kind of topological operations are available:

  • Remove an element: This operation allow to remove a topological element (surface or volume depending on the type of collision model) . Notes that it is possible to remove a volume element using a surface collision model if the scene contains a Topological Mapping.


  • Remove a zone of elements: This operation allow to remove a zone of element (circle for surface, sphere for volume). Different situation can be encountered depending on which kind of collision model is used.

For surface collision model:

  1. On a surface mesh it will remove a part of the mesh (see fig)

  1. On a volume mesh using the option surface will remove surface element as well as volume element link to them (this can let sharp element at the surface see fig). Using the option Volume will remove a sphere volume of elements (see fig on right)

For volume collision model:

  1. Using the Volume option will have the same results as above (remove a sphere volume of elements)
  2. Using the Surface option will remove a layer of element at the surface of the mesh (see fig)


Add a spring to suture two points

TODO


Add a Frame to Skinned model

TODO