Click or drag to resize
AB4D logo

Mesh3DFactoryCreateExtrudedMeshGeometry(IListPoint, Boolean, Vector3D, Vector3D, Boolean, Boolean) Method

Returns a MeshGeometry3D that is created from 2D polygon defined by positions and that is extruded by using extrudeVector.

Namespace: Ab3d.Meshes
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public static MeshGeometry3D CreateExtrudedMeshGeometry(
	IList<Point> positions,
	bool isSmooth,
	Vector3D modelOffset,
	Vector3D extrudeVector,
	bool addBottomTriangles = true,
	bool addTopTriangles = true
)

Parameters

positions  IListPoint
IList of 2D position that define the polygon that is used as the bottom and top surface
isSmooth  Boolean
If true than the mesh appears smooth, if false the edges are sharp
modelOffset  Vector3D
Vector3D that defines an offset of the model - offset is added to each position
extrudeVector  Vector3D
vector that defines the extrusion - direction and distance of bottom and top surfaces
addBottomTriangles  Boolean  (Optional)
when true (by default) the triangles for the bottom part of the object are created, otherwise the bottom part is opened
addTopTriangles  Boolean  (Optional)
when true (by default) the triangles for the top part of the object are created, otherwise the top part is opened

Return Value

MeshGeometry3D
MeshGeometry3D that is created from 2D polygon defined by positions and that is extruded by using extrudeVector
Exceptions
ExceptionCondition
FormatExceptionThis method can throw FormatException when positions are not correctly defined - for example if lines intersect each other
Remarks

CreateExtrudedMeshGeometry creates a MeshGeometry3D that represent an extruded 3D objects that is defined with 2D polygon (defined by positions) and that is extruded by using extrudeVector.

This method uses Triangulator to create 3D surface from 2D positions.

NOTE:
Because CreateExtrudedMeshGeometry is calling CreateTriangleIndices method (defined in Ab3d.Utilities.Triangulator class), it can throw FormatException when positions are not correctly defined - for example if lines intersect each other.

See Also