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.
Figure 1. Polyline extrusion: (a) input polyline regularized by PolylineResampler3d,
(b) extruded quadrilateral mesh in blue
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.
(a) |
(b) |
- The extrusion direction is defined by the direction parameter.
- The total length of the extrusion is defined by the sum of the forwardLength and backwardLength parameters.
- The number of parallel polylines forming the output surface is deduced from the nodeCount parameter.
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 = nullptr );
This function returns outputSurface.
// Function prototype. polyline_extrusion_3d(input_polyline: Union[idt.NDArrayFloat, None], forward_length: float = 1, backward_length: float = 1, node_count: int = 20, direction: Union[Iterable[int], Iterable[float]] = [0, 0, 1], output_surface: Union[idt.NDArrayFloat, None] = None) -> Union[idt.NDArrayFloat, None]
This function returns outputSurface.
// Function prototype. public static IOLink.ArrayXd PolylineExtrusion3d( IOLink.ArrayXd inputPolyline, double forwardLength = 1, double backwardLength = 1, UInt32 nodeCount = 20, double[] direction = null, IOLink.ArrayXd outputSurface = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
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 | ||
forwardLength |
The extrusion length from the input polyline in the extrusion direction.
This length is expressed in world coordinates. |
Float64 | >=0 | 1 | |
backwardLength |
The extrusion length from the input polyline opposite to the extrusion direction.
This length is expressed in world coordinates. |
Float64 | >=0 | 1 | |
nodeCount |
Number of nodes to create along the whole extruded section along the sum of forward and backward lengths. | UInt32 | Any value | 20 | |
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} | |
outputSurface |
The output surface.
The dimensions of the generated ArrayXd is [3, n, m] with:
|
ArrayXd | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
input_polyline |
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 | ||
forward_length |
The extrusion length from the input polyline in the extrusion direction.
This length is expressed in world coordinates. |
float64 | >=0 | 1 | |
backward_length |
The extrusion length from the input polyline opposite to the extrusion direction.
This length is expressed in world coordinates. |
float64 | >=0 | 1 | |
node_count |
Number of nodes to create along the whole extruded section along the sum of forward and backward lengths. | uint32 | Any value | 20 | |
direction |
The extrusion direction.
This direction is expressed in the coordinate system of the input polyline. |
vector3d | Any value | [0, 0, 1] | |
output_surface |
The output surface.
The dimensions of the generated ArrayXd is [3, n, m] with:
|
arrayXd | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
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 | ||
forwardLength |
The extrusion length from the input polyline in the extrusion direction.
This length is expressed in world coordinates. |
Float64 | >=0 | 1 | |
backwardLength |
The extrusion length from the input polyline opposite to the extrusion direction.
This length is expressed in world coordinates. |
Float64 | >=0 | 1 | |
nodeCount |
Number of nodes to create along the whole extruded section along the sum of forward and backward lengths. | UInt32 | Any value | 20 | |
direction |
The extrusion direction.
This direction is expressed in the coordinate system of the input polyline. |
Vector3d | Any value | {0f, 0f, 1f} | |
outputSurface |
The output surface.
The dimensions of the generated ArrayXd is [3, n, m] with:
|
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();
polyline_3d_1 = np.zeros(0, dtype=np.double) polyline_3d_1 = imagedev.read_array_xd(imagedev_data.get_object_path("polyline3d_1.arrayxd"), polyline_3d_1) polyline_extrusion_3d_algo = imagedev.PolylineExtrusion3d() polyline_extrusion_3d_algo.input_polyline = polyline_3d_1 polyline_extrusion_3d_algo.forward_length = 1 polyline_extrusion_3d_algo.backward_length = 1 polyline_extrusion_3d_algo.node_count = 20 polyline_extrusion_3d_algo.direction = [0, 0, 1] polyline_extrusion_3d_algo.execute() print("output_surface:", str(polyline_extrusion_3d_algo.output_surface))
IOLink.ArrayXd polyline3d_1 = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ; polyline3d_1 = Data.ReadArrayXd( @"Data/objects/polyline3d_1.arrayxd", polyline3d_1 ); PolylineExtrusion3d polylineExtrusion3dAlgo = new PolylineExtrusion3d { inputPolyline = polyline3d_1, forwardLength = 1, backwardLength = 1, nodeCount = 20, direction = new double[]{0, 0, 1} }; polylineExtrusion3dAlgo.Execute(); Console.WriteLine( "outputSurface:" + polylineExtrusion3dAlgo.outputSurface.ToString() );
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();
polyline_3d_1 = np.zeros(0, dtype=np.double) polyline_3d_1 = imagedev.read_array_xd(imagedev_data.get_object_path("polyline3d_1.arrayxd"), polyline_3d_1) result = imagedev.polyline_extrusion_3d(polyline_3d_1, 1, 1, 20, [0, 0, 1]) print("output_surface:", str(result))
IOLink.ArrayXd polyline3d_1 = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ; polyline3d_1 = Data.ReadArrayXd( @"Data/objects/polyline3d_1.arrayxd", polyline3d_1 ); IOLink.ArrayXd result = Processing.PolylineExtrusion3d( polyline3d_1, 1, 1, 20, new double[]{0, 0, 1} ); Console.WriteLine( "outputSurface:" + result.ToString() );