enfold

Enfolds one solid with another.

Signatures

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

Details

The enfold function enfolds or wraps one solid bodyB with another bodyA plastically.

The movement of bodyA is defined by a vector dir or a cynosure object that acts as a source of attraction. 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

 make enfold( mesh( "grid.stl" ),
              mesh( "surface.stl" ),
              <[ 5.0, 4.0, 0.0 ]> -> <[ 5.0, 4.0, 7.0 ]> )
 

The left side shows a curved surface and a grid structure solid that got enfolded over the surface on the right side.

The result of the enfold function can be tuned with the filterLen, strict and offset parameters.

Setting a filterLen value larger than zero applies an additional filter to the operation that increases the stiffness of the plastic deformation. The filterLen value then acts in a way similar to the full width half maximum (FWHM) of a Gaussian smoothing. The strict parameter determines whether the resulting shape of bodyA is allowed to partially enter into the space of bodyB or not. In some cases the result may be improved if this condition is relaxed.

The four images show different ways of application of the enfold function. The cynosures are drawn as black dashed lines and the resulting solids are labeled as A'. The image to the left shows the result of an enfold function without further modifications. In the second image a filtering is applied in strict mode to avoid the penetration of solid B. The third image shows the application of a filter with the strict parameter set to false. On the most right image, the effect of a positive offset value is displayed.

Note

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

Parameters

bodyA

Solid that is moved into direction dir or towards 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 attraction 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 enfolding bodyA onto bodyB.

See also