Table of Contents

Class NwcMeasureEngine

Namespace
NwcIO.Model.Measure
Assembly
NwcIO.dll

High-precision 3D measurement engine providing point-to-point, point-to-mesh, mesh-to-mesh clearance, triangle area, normal vector, and polyline distance calculations.

public static class NwcMeasureEngine

Inheritance

Inherited Members

Methods

ClosestPointOnTriangle(Vector3d, Vector3d, Vector3d, Vector3d)

Computes the point on a 3D triangle closest to the specified query point. Implements Christer Ericson's Voronoi region algorithm.

public static Vector3d ClosestPointOnTriangle(Vector3d p, Vector3d a, Vector3d b, Vector3d c)

Parameters

p Vector3d
a Vector3d
b Vector3d
c Vector3d

Returns

Vector3d

ComputeMeshCentroid(NwcMesh, bool)

Computes the average vertex centroid of a mesh.

public static Vector3d ComputeMeshCentroid(NwcMesh mesh, bool useWorldCoordinates = true)

Parameters

mesh NwcMesh
useWorldCoordinates bool

Returns

Vector3d

ComputeMeshSurfaceArea(NwcMesh, bool)

Computes the total surface area of all triangles in a mesh.

public static double ComputeMeshSurfaceArea(NwcMesh mesh, bool useWorldCoordinates = true)

Parameters

mesh NwcMesh
useWorldCoordinates bool

Returns

double

ComputeMeshVolume(NwcMesh, bool)

Computes the signed volume of a closed 3D manifold solid mesh.

public static double ComputeMeshVolume(NwcMesh mesh, bool useWorldCoordinates = true)

Parameters

mesh NwcMesh
useWorldCoordinates bool

Returns

double

ComputeTriangleArea(Vector3d, Vector3d, Vector3d)

Computes the surface area of a 3D triangle defined by three vertices.

public static double ComputeTriangleArea(Vector3d a, Vector3d b, Vector3d c)

Parameters

a Vector3d
b Vector3d
c Vector3d

Returns

double

ComputeTriangleNormal(Vector3d, Vector3d, Vector3d)

Computes the unit normal vector of a 3D triangle defined by three vertices in CCW order.

public static Vector3d ComputeTriangleNormal(Vector3d a, Vector3d b, Vector3d c)

Parameters

a Vector3d
b Vector3d
c Vector3d

Returns

Vector3d

MeasureAngle(Vector3d, Vector3d)

Computes the angle in degrees between two 3D direction vectors.

public static double MeasureAngle(Vector3d dirA, Vector3d dirB)

Parameters

dirA Vector3d
dirB Vector3d

Returns

double

MeasureAngle(Vector3d, Vector3d, Vector3d)

Computes the angle in degrees between two line segments meeting at a common vertex: angle(A - Vertex - B).

public static double MeasureAngle(Vector3d a, Vector3d vertex, Vector3d b)

Parameters

a Vector3d
vertex Vector3d
b Vector3d

Returns

double

MeasureDistance(Vector3d, Vector3d)

Measures the 3D Euclidean distance and directional projections between two points.

public static NwcDistanceMeasurement MeasureDistance(Vector3d a, Vector3d b)

Parameters

a Vector3d
b Vector3d

Returns

NwcDistanceMeasurement

MeasureMeshToMesh(NwcMesh, NwcMesh, bool)

Measures the clearance (minimum distance) between two 3D polygon meshes.

public static NwcMeshToMeshMeasurement MeasureMeshToMesh(NwcMesh meshA, NwcMesh meshB, bool useWorldCoordinates = true)

Parameters

meshA NwcMesh
meshB NwcMesh
useWorldCoordinates bool

Returns

NwcMeshToMeshMeasurement

MeasurePath(IEnumerable<Vector3d>)

Measures cumulative polyline distance across a sequence of 3D points.

public static NwcPolylineMeasurement MeasurePath(IEnumerable<Vector3d> points)

Parameters

points IEnumerable<Vector3d>

Returns

NwcPolylineMeasurement

MeasurePointToMesh(Vector3d, NwcMesh, bool)

Measures the shortest distance from a 3D point to a mesh surface, locating the closest point.

public static NwcPointToMeshMeasurement MeasurePointToMesh(Vector3d point, NwcMesh mesh, bool useWorldCoordinates = true)

Parameters

point Vector3d
mesh NwcMesh
useWorldCoordinates bool

Returns

NwcPointToMeshMeasurement