C# Class HelixToolkit.Wpf.MeshGeometryHelper

Provides helper methods for mesh geometries.
ファイルを表示 Open project: litdev1/LitDev Class Usage Examples

Public Methods

Method Description
CalculateNormals ( IList positions, IList triangleIndices ) : System.Windows.Media.Media3D.Vector3DCollection

Calculates the normal vectors.

CalculateNormals ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Media3D.Vector3DCollection

Calculates the normal vectors.

CombineSegments ( IList segments, double eps ) : IEnumerable>

Combines the segments.

Cut ( System.Windows.Media.Media3D.MeshGeometry3D mesh, System.Windows.Media.Media3D.Point3D p, System.Windows.Media.Media3D.Vector3D n ) : System.Windows.Media.Media3D.MeshGeometry3D

Cuts the mesh with the specified plane.

FindBorderEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Int32Collection

Finds edges that are only connected to one triangle.

FindEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Int32Collection

Finds all edges in the mesh (each edge is only included once).

FindSharpEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh, double minimumAngle ) : System.Windows.Media.Int32Collection

Finds all edges where the angle between adjacent triangle normal vectors. is larger than minimumAngle

GetContourSegments ( System.Windows.Media.Media3D.MeshGeometry3D mesh, System.Windows.Media.Media3D.Point3D p, System.Windows.Media.Media3D.Vector3D n ) : IList

Gets the contour segments.

NoSharedVertices ( System.Windows.Media.Media3D.MeshGeometry3D input ) : System.Windows.Media.Media3D.MeshGeometry3D

Creates a new mesh where no vertices are shared.

Simplify ( System.Windows.Media.Media3D.MeshGeometry3D mesh, double eps ) : System.Windows.Media.Media3D.MeshGeometry3D

Simplifies the specified mesh.

Validate ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : void

Validates the specified mesh.

Private Methods

Method Description
CreateKey ( uint i0, uint i1 ) : ulong

Create a 64-bit key from two 32-bit indices

FindConnectedSegment ( IList segments, System.Windows.Media.Media3D.Point3D point, double eps ) : int

Finds the nearest connected segment to the specified point.

ReverseKey ( ulong key, uint &i0, uint &i1 ) : void

Extract two 32-bit indices from the 64-bit key

Method Details

CalculateNormals() public static method

Calculates the normal vectors.
public static CalculateNormals ( IList positions, IList triangleIndices ) : System.Windows.Media.Media3D.Vector3DCollection
positions IList /// The positions. ///
triangleIndices IList /// The triangle indices. ///
return System.Windows.Media.Media3D.Vector3DCollection

CalculateNormals() public static method

Calculates the normal vectors.
public static CalculateNormals ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Media3D.Vector3DCollection
mesh System.Windows.Media.Media3D.MeshGeometry3D /// The mesh. ///
return System.Windows.Media.Media3D.Vector3DCollection

CombineSegments() public static method

Combines the segments.
public static CombineSegments ( IList segments, double eps ) : IEnumerable>
segments IList /// The segments. ///
eps double /// The tolerance. ///
return IEnumerable>

Cut() public static method

Cuts the mesh with the specified plane.
public static Cut ( System.Windows.Media.Media3D.MeshGeometry3D mesh, System.Windows.Media.Media3D.Point3D p, System.Windows.Media.Media3D.Vector3D n ) : System.Windows.Media.Media3D.MeshGeometry3D
mesh System.Windows.Media.Media3D.MeshGeometry3D /// The mesh. ///
p System.Windows.Media.Media3D.Point3D /// The plane origin. ///
n System.Windows.Media.Media3D.Vector3D /// The plane normal. ///
return System.Windows.Media.Media3D.MeshGeometry3D

FindBorderEdges() public static method

Finds edges that are only connected to one triangle.
public static FindBorderEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Int32Collection
mesh System.Windows.Media.Media3D.MeshGeometry3D /// A mesh geometry. ///
return System.Windows.Media.Int32Collection

FindEdges() public static method

Finds all edges in the mesh (each edge is only included once).
public static FindEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : System.Windows.Media.Int32Collection
mesh System.Windows.Media.Media3D.MeshGeometry3D /// A mesh geometry. ///
return System.Windows.Media.Int32Collection

FindSharpEdges() public static method

Finds all edges where the angle between adjacent triangle normal vectors. is larger than minimumAngle
public static FindSharpEdges ( System.Windows.Media.Media3D.MeshGeometry3D mesh, double minimumAngle ) : System.Windows.Media.Int32Collection
mesh System.Windows.Media.Media3D.MeshGeometry3D /// A mesh geometry. ///
minimumAngle double /// The minimum angle between the normal vectors of two adjacent triangles (degrees). ///
return System.Windows.Media.Int32Collection

GetContourSegments() public static method

Gets the contour segments.
public static GetContourSegments ( System.Windows.Media.Media3D.MeshGeometry3D mesh, System.Windows.Media.Media3D.Point3D p, System.Windows.Media.Media3D.Vector3D n ) : IList
mesh System.Windows.Media.Media3D.MeshGeometry3D /// The mesh. ///
p System.Windows.Media.Media3D.Point3D /// The plane origin. ///
n System.Windows.Media.Media3D.Vector3D /// The plane normal. ///
return IList

NoSharedVertices() public static method

Creates a new mesh where no vertices are shared.
public static NoSharedVertices ( System.Windows.Media.Media3D.MeshGeometry3D input ) : System.Windows.Media.Media3D.MeshGeometry3D
input System.Windows.Media.Media3D.MeshGeometry3D /// The input mesh. ///
return System.Windows.Media.Media3D.MeshGeometry3D

Simplify() public static method

Simplifies the specified mesh.
public static Simplify ( System.Windows.Media.Media3D.MeshGeometry3D mesh, double eps ) : System.Windows.Media.Media3D.MeshGeometry3D
mesh System.Windows.Media.Media3D.MeshGeometry3D /// The mesh. ///
eps double /// The tolerance. ///
return System.Windows.Media.Media3D.MeshGeometry3D

Validate() public static method

Validates the specified mesh.
public static Validate ( System.Windows.Media.Media3D.MeshGeometry3D mesh ) : void
mesh System.Windows.Media.Media3D.MeshGeometry3D /// The mesh. ///
return void