Version 0.59.0

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 )
  •   infold( solid bodyA, vector& pointsA[], solid bodyB[], curve cynosure[], float filterLen, bool strict, float offset )

Details

The infold function infolds one or more solids bodyB with another bodyA plastically. bodyB is then covered by the deformed bodyA from the inside.

The movement of bodyA is either defined by a vector dir or by a cynosure object that acts as a source of repulsion onto bodyA. Object bodyB is placed in the way of the movement trajectory of bodyA. The movement of bodyA is blocked by bodyB in a way that bodyA adapts to the shape of bodyB.

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.

See also the description in the advanced construction section for this function.

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.

Return value

A solid that is created by infolding bodyA into bodyB.

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

Opposite direction bodyA is moved into. I.e. bodyA is moved into -dir.

cynosure

Center of repulsion for bodyA. This is either a curve or an array of curves. Note that it is possible to use curves that contain only one single points what results in a spherical repulsion geometry.

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. Default value is 0.

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 is 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.

See also

🗙

Search results for