ImageDev

PolylineExtrusion3d

Extrudes a three-dimensional polyline in a given direction to produce a quadrilateral mesh surface.

Access to parameter description

This algorithm replicates the input polyline in a predefined direction and in its opposite direction with a regular spacing. A quadrilateral mesh is thus generated, considering each polyline vertex as a mesh vertex.

<b> (a) </b>
(a)
<b> (b) </b>
(b)
Figure 1. Polyline extrusion: (a) input polyline regularized by PolylineResampler3d, (b) extruded quadrilateral mesh in blue
See also

Function Syntax

This function returns outputSurface.
// Function prototype
std::shared_ptr<iolink::ArrayXd> polylineExtrusion3d( std::shared_ptr<iolink::ArrayXd> inputPolyline, double forwardLength, double backwardLength, uint32_t nodeCount, iolink::Vector3d direction, std::shared_ptr<iolink::ArrayXd> outputSurface = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputPolyline
The input ArrayXd to extrude.
The indexation needs to be {coordinate, index}, where coordinate is the axis index (0 for X, 1 for Y and 2 for Z) and index is a label identifying the vertex.
ArrayXd nullptr
input
forwardLength
The extrusion length from the input polyline in the extrusion direction.
This length is expressed in world coordinates.
Float64 >=0 1
input
backwardLength
The extrusion length from the input polyline opposite to the extrusion direction.
This length is expressed in world coordinates.
Float64 >=0 1
input
nodeCount
Number of nodes to create along the whole extruded section along the sum of forward and backward lengths. UInt32 Any value 20
input
direction
The extrusion direction.
This direction is expressed in the coordinate system of the input polyline.
Vector3d Any value {0.f, 0.f, 1.f}
output
outputSurface
The output surface.
The dimensions of the generated ArrayXd is [3, n, m] with:
  • 3, the number of coordinates of a 3D point respectively corresponding to X, Y, and Z, expressed in world coordinates.
  • n, the number of columns of the mesh.
  • m, the number of rows of the mesh.
ArrayXd nullptr

Object Examples

std::shared_ptr< iolink::ArrayXd> polyline3d_1( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "polyline3d_1.arrayxd", polyline3d_1);

PolylineExtrusion3d polylineExtrusion3dAlgo;
polylineExtrusion3dAlgo.setInputPolyline( polyline3d_1 );
polylineExtrusion3dAlgo.setForwardLength( 1 );
polylineExtrusion3dAlgo.setBackwardLength( 1 );
polylineExtrusion3dAlgo.setNodeCount( 20 );
polylineExtrusion3dAlgo.setDirection( {0, 0, 1} );
polylineExtrusion3dAlgo.execute();

std::cout << "outputSurface:" << polylineExtrusion3dAlgo.outputSurface()->shape();

Function Examples

std::shared_ptr< iolink::ArrayXd> polyline3d_1( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "polyline3d_1.arrayxd", polyline3d_1);

auto result = polylineExtrusion3d( polyline3d_1, 1, 1, 20, {0, 0, 1} );

std::cout << "outputSurface:" << result->shape();