Class MeshBody
Graphical representation of a Body.
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class MeshBody : MeshBase
Constructors
MeshBody()
Creates an empty MeshBody.
Declaration
public MeshBody()
MeshBody(IEnumerable<MeshFace>)
Declaration
public MeshBody(IEnumerable<MeshFace> faces)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<MeshFace> | faces |
Properties
Body
Declaration
public Body Body { get; }
Property Value
Type | Description |
---|---|
Body |
BodyId
Internal use
Declaration
public int BodyId { get; }
Property Value
Type | Description |
---|---|
Int32 |
Faces
Declaration
public List<MeshFace> Faces { get; }
Property Value
Type | Description |
---|---|
List<MeshFace> |
Methods
Clone()
Returns a deep clone of this MeshBody.
Declaration
public MeshBody Clone()
Returns
Type | Description |
---|---|
MeshBody | The cloned MeshBody. |
CreateBox(Matrix4, Vector3)
Creates a box-shaped MeshBody.
Declaration
public static MeshBody CreateBox(Matrix4 origin, Vector3 size)
Parameters
Type | Name | Description |
---|---|---|
Matrix4 | origin | Defines the origin position and rotation of the box. |
Vector3 | size | Length, width and height of the box. |
Returns
Type | Description |
---|---|
MeshBody |
CreateBox(Vector3)
Creates a box-shaped MeshBody.
Declaration
public static MeshBody CreateBox(Vector3 size)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | size | Length, width and height of the box. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The box extends from (0,0,0) to (size).
CreateCapsule(Double, Double, Int32)
Creates a capsule-shaped MeshBody.
Declaration
public static MeshBody CreateCapsule(double radius, double height, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | radius | Radius of the capsule |
Double | height | Height of the cylindrical part of the capsule. Total height is height + 2 * radius. |
Int32 | precision | Number of vertices along the circumference. Must be a multiple of 4. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The capsule is centered around the z axis with the base of the cylindrical part at (0,0,0).
CreateCone(Double, Double, Int32)
Creates a cone-shaped MeshBody.
Declaration
public static MeshBody CreateCone(double radius, double height, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | radius | Radius of the cone base |
Double | height | Height of the cone |
Int32 | precision | Number of vertices along the circumference. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The cone is centered around the z axis with the base at (0,0,0).
CreateCylinder(Double, Double, Int32)
Creates a cylinder-shaped MeshBody.
Declaration
public static MeshBody CreateCylinder(double radius, double height, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | radius | Radius of the cylinder |
Double | height | Height of the cylinder. |
Int32 | precision | Number of vertices along the circumference. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The cylinder is centered around the z axis with the base at (0,0,0).
CreatePolyline(Vector3[])
Creates a polyline MeshBody
Declaration
public static MeshBody CreatePolyline(Vector3[] vertices)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | vertices | Defines the vertices of the polyline. |
Returns
Type | Description |
---|---|
MeshBody |
CreatePyramid(Double, Double, Int32)
Creates a pyramid-shaped MeshBody.
Declaration
public static MeshBody CreatePyramid(double centerToSide, double height, int numSides)
Parameters
Type | Name | Description |
---|---|---|
Double | centerToSide | Distance from the center to one side of the pyramid |
Double | height | Height of the pyramid |
Int32 | numSides | Number of sides |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The pyramid is centered around the z axis with the base at (0,0,0).
CreateSphere(Double, Int32)
Creates a sphere-shaped MeshBody.
Declaration
public static MeshBody CreateSphere(double radius, int precision = 24)
Parameters
Type | Name | Description |
---|---|---|
Double | radius | Radius of the sphere |
Int32 | precision |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The sphere is centered around (0,0,0).
CreateSurfaceCircle(Double, Int32)
Creates a surface circle MeshBody.
Declaration
public static MeshBody CreateSurfaceCircle(double radius, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | radius | Circle radius |
Int32 | precision | Number of vertices along the circumference. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The circle is created in the x-y plane and centered at (0,0,0).
CreateSurfaceCircleSector(Double, Double, Double, Double, Int32)
Creates a surface circular sector MeshBody.
Declaration
public static MeshBody CreateSurfaceCircleSector(double innerRadius, double outerRadius, double startAngle, double endAngle, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | innerRadius | Inner radius (typically 0) |
Double | outerRadius | Outer radius |
Double | startAngle | Sector start angle |
Double | endAngle | Sector end angle |
Int32 | precision | Number of vertices along the circumference for the full circle. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The circle sector is created in the x-y plane and centered at (0,0,0).
CreateSurfacePolygon(IEnumerable<Vector3>)
Creates a surface polygon MeshBody.
Declaration
public static MeshBody CreateSurfacePolygon(IEnumerable<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector3> | vertices | Polygon vertices. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The front face of the polygon is determined by counter-clockwise winding. The polygon must be planar and not self-intersecting.
Exceptions
Type | Condition |
---|---|
ArgumentException | Too few vertices, or the polygon is self-intersecting. |
CreateSurfaceRectangle(Matrix4, Double, Double)
Creates a surface rectangle MeshBody
Declaration
public static MeshBody CreateSurfaceRectangle(Matrix4 origin, double dx, double dy)
Parameters
Type | Name | Description |
---|---|---|
Matrix4 | origin | Origin of the rectangle |
Double | dx | Size of the rectangle in the x direction of origin |
Double | dy | Size of the rectangle in the y direction of origin |
Returns
Type | Description |
---|---|
MeshBody |
CreateSurfaceRectangle(Double, Double, Double, Double)
Creates a surface rectangle MeshBody
Declaration
public static MeshBody CreateSurfaceRectangle(double x, double y, double dx, double dy)
Parameters
Type | Name | Description |
---|---|---|
Double | x | Position of the rectangle in the x direction |
Double | y | Position of the rectangle in the y direction |
Double | dx | Size of the rectangle in the x direction |
Double | dy | Size of the rectangle in the y direction |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The rectangle is created in the x-y plane.
CreateSurfaceTriangle(Vector3, Vector3, Vector3)
Creates a surface triangle MeshBody.
Declaration
public static MeshBody CreateSurfaceTriangle(Vector3 v1, Vector3 v2, Vector3 v3)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | v1 | First triangle vertex |
Vector3 | v2 | Second triangle vertex |
Vector3 | v3 | Third triangle vertex |
Returns
Type | Description |
---|---|
MeshBody |
CreateTruncatedCone(Double, Double, Double, Int32)
Creates a truncated cone MeshBody.
Declaration
public static MeshBody CreateTruncatedCone(double bottomRadius, double topRadius, double height, int precision = 36)
Parameters
Type | Name | Description |
---|---|---|
Double | bottomRadius | Radius of the cone base |
Double | topRadius | Radius of the top surface |
Double | height | Height of the cone |
Int32 | precision | Number of vertices along the circumference. |
Returns
Type | Description |
---|---|
MeshBody |
Remarks
The cone is centered around the z axis with the base at (0,0,0).
GetBoundingBox()
Calculates the BoundingBox of this MeshBody.
Declaration
public BoundingBox GetBoundingBox()
Returns
Type | Description |
---|---|
BoundingBox |
SetMaterial(Material)
Declaration
public void SetMaterial(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material |
Transform(Matrix4)
Transforms all vertices and normals in the MeshBody.
Declaration
public void Transform(Matrix4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix4 | matrix |
Transform(Matrix4, ProgressNotification)
Transforms all vertices and normals in the MeshBody.
Declaration
public void Transform(Matrix4 matrix, ProgressNotification progress)
Parameters
Type | Name | Description |
---|---|---|
Matrix4 | matrix | |
ProgressNotification | progress |