Version 0.60.0

Biselection Modification

For certain constructions it may be useful to apply two modifiers on different parts of one object. This could be that one part of the object is moved or changed while the other part shall stay fixed or that both parts are moved or changed differently with respect to each other. In these cases, the biselection modification tool of trCAD CAD comes handy.

The tool is a build-in function with the signature

biselect_mod( solid, selection, modifier, selection, modifier )

The operation of the function can be understood from looking at its arguments:

  • 1: the solid that is modified by the operation.
  • 2: a selection s1 that selects a partial region of the solid.
  • 3: a modifier m1 that will be applied to the region of the solid selected by s1.
  • 4: another selection s2 on the solid.
  • 5: a modifier m2 that will be applied to the region selected by s2.

It is expected that regions s1 and s2 are disjoint. It is important to note that there may be some region that is neither covered by s1 nor s2. This intermediate zone of the solid between the two selections will be the elastic region when the function is applied.

When the function is called, it applies the two modifiers to the two parts of the solid that are selected by the two selections. The part of the solid that forms the intermediate zone is deformed elastically in a way that it smoothly fits to the boundaries of the selections. This is done by adjusting the vertex points of the triangulation mesh that forms the object. This means that if the mesh is too coarse, the elastic effect becomes unpronounced. The intermediate zone can be empty, small, big or even extended over the whole solid, depending on the requirements of the construction.

The function then returns the resulting solid.

The following example shows, how the biselect_mod function can be used to animate a figur coming from a 3D scan. It defines a rotation transformation via a rotation center, a rotation axis and an angle and applies it to the hand of the figure while the body is kept fixed. The arm is deformed elastically to fulfill the boundary conditions on both selections. Please note that the elbow's position is fixed by positioning the rotation center in the middle of the elbow.

Example

solid object = mesh( "myfiles/figure.stl" )
selection s1 = selectbox( -11.0, 1.9, -3.0, 10.0, -5.0, 20.0 )
selection s2 = selectsphere( 1.0, <[ 6.5, 1.7, 8.5 ]> )
vector center = <[ 3.4, 2.3, 9.8 ]>
vector axis = <[ 0.05, -0.98, 0.20 ]>
make biselect_mod( object, s1, identity(), s2, rotation( center, axis, rad( 64.0 ) ) )

The image on the left shows the original object with the two selection s1 (green) and s2 (red). On the right, the transition to the resulting object is shown together with the rotation axis (big black arrow) of the applied transformation. See how the unselected parts of the figure's arm are adjusted elastically to follow the transformation.

Note

The quality of the results of the transformation of the elastic section depends strongly on the solid's resolution in that place. Poor resultions will lead to badly rounded, "edgy" results. This can be optimized with the subdiv modifier.

See also

🗙

Search results for