proj_shape

Creates a solid by applying a shape projection.

Signatures

  • proj_shape( solid s, vector dir )
  • proj_shape( solid s, vector dir, vector onBasePlane )

Details

The function creates a new solid by projecting the solid argument s along a given projection direction dir in a way as depicted in the figure.

The general concept of the proj_shape function is depicted on the left: the (elliptic) solid s is projected along the direction of vector dir (black arrow) onto the base plane (black dashed line). The right hand side shows this for the Standford bunny.

The base plane can be defined by giving one point on the plane as argument onBasePlane. Note that this allows also to generate "hollow" projections, if this onset point is placed in opposite direction of dir.

A typical use case of this function is to create holes that are suitable as intake for a given solid.

Example

 make proj_shape( mesh ( "bunny.stl" ), <[ 0, -1, 0 ]> )
 

Note

The function uses a sampling technique to generate the final solid. This may lead to slight deviations from the input s.

Parameters

s

An input solid that gets projected by the function.

dir

A vector that defines the direction of the linear projection that is used for constructing the output.

onBasePlane

One point on the base plane that is used to specify the base plane's position. If this is omitted, the base plane is positioned right at the backside of s.

Return value

A solidthat is defined by the projection.