infold

Infolds one solid with another.

Signatures

  • infold( solid bodyA, solid bodyB, vector dir )
  • infold( solid bodyA, solid bodyB, vector dir, float filterLen, bool strict, float offset )
  • infold( solid bodyA, solid bodyB[], vector dir )
  • infold( solid bodyA, solid bodyB[], vector dir, float filterLen, bool strict, float offset )
  • infold( solid bodyA, solid bodyB, curve cynosure )
  • infold( solid bodyA, solid bodyB, curve cynosure, float filterLen, bool strict, float offset )
  • infold( solid bodyA, solid bodyB[], curve cynosure )
  • infold( solid bodyA, solid bodyB[], curve cynosure, float filterLen, bool strict, float offset )

Details

The infold function infolds one solid bodyB with another bodyA plastically. The function covers one solid bodyB with an object bodyA from the inside.

The movement of bodyA is defined by a vector dir or a cynosure object that acts as a source of repulsion. It should therefore be placed in a way that bodyB is properly placed in the resulting movement trajectory of bodyA. Areas of bodyA from where the movement trajectory does not intersect with bodyB are not moved (unless they are in the filter length of some moved sections).

Example

 solid hand = mesh( "hand.stl" )
 solid blocker = cylinder( 150, 43.0 ) - cylinder( 150, 38.0 )
 solid handle = subdiv( 5.0, <[0.0, 0.0, 1.0]> ) >>
                ( cylinder( 150, 20.0 ) - cylinder( 150, 15.0 ) )
 make infold( handle, [ hand, blocker ],
              <[0.0, 0.0, 0.0]> -> <[0.0, 0.0, 150.0]>, 20, false, 0.0 )
 

Result of the code example: a hand solid gets infolded by a pipe. This results in an ergonomic handle.

The result of the infold function can be tuned with the filterLen, strict and offset parameters. These work in the same way as for the enfold function. See there for more information.

Note

The quality of the results of an infolding depends strongly on the resolution of bodyA: if the tesselation of this is insufficiently, the infolding cannot be applied. The tesselation can be increased with the subdiv modifier.

Parameters

bodyA

Solid that is moved into direction dir or away from the cynosure until its movement is blocked by bodyB.

bodyB

Solid or array of solids that act as blockade in the trajectory of bodyA.

dir

Direction bodyA is moved into.

cynosure

Center of repulsion for bodyA.

filterLen

If this parameter is set to a positive value greater than zero, a filtering is applied to the operation that simulates a stiffness of the plastic deformation. The value of filterLen approximately defines the FWHM of this filter. In some cases filtering can highly improve the result of the operation. Note that filtering over larger ranges may increase calculation times significantly.

strict

This boolean parameter allows to switch between two modes of filtering: if its value is true, a strict mode is enabled that hinders the filter to intrude into solid B. If the value is set to false, the result might overlap with bodyB in some areas but the overall result might be more appealing. (Default value: false.)

offset

Defines an offset length that is applied in addition to the morphing movement of the solid. By using this parameter it is possible to introduce a gap between the two bodies of this length (if offset is positive) or to let bodyA sink into bodyB (if offset is negative). Default value is 0.

Return value

A solid object that is created by infolding bodyA into bodyB.

See also