Table of Contents

Method Triangulate

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

Triangulate()

Breaks every face into triangles, giving the surface of the solid as a triangle mesh, using the default tolerance.

public GeoTriangle3[] Triangulate()

Returns

GeoTriangle3[]

Triangulate(Tolerance)

Breaks every face into triangles, giving the surface of the solid as a triangle mesh, within a tolerance.

public GeoTriangle3[] Triangulate(Tolerance tolerance)

Parameters

tolerance Tolerance

The tolerance deciding what counts as a degenerate triangle.

Returns

GeoTriangle3[]

Remarks

Every triangle lies within the material of the face it came from: a concave face is followed rather than spanned, and a hole cut in a face is left open.

The openings are not meshed, and so this is not the boundary of the material when there are any. They are whole bodies subtracted from this one rather than holes in its faces, so a plate with a bolt hole meshes its top face as a whole square. Anything that reads the mesh as where the material ends — clash detection, ray casting, distance — wants TriangulateSurface(Tolerance), which cuts the openings in first. For a body without openings the two are the same mesh.

A face thinner than the tolerance is a seam at it and has no triangles: a slab 100 by 100 and 0.0008 thick, built within 1E-5, is 12 triangles at 1E-5 but 4 at 0.001, its four sides gone, and a Debug line in GeometryHelperLog says how many faces were left out whole and how much area they had; a face meshed in part is not counted. The mesh is then open edge by edge but closed within the tolerance: the top and the bottom meet along every edge where the sides were, and those 4 triangles leave 8 edges with no triangle on the other side. A mesh closed edge by edge is had at the tolerance the body was built within: the slab's 12 triangles at 1E-5.

A triangle is left out only when it has no width, its corners on a line within a millionth of the point tolerance. Each half of a small face 0.002 by 0.002 has its Normal and its GetPlane(), and reads as a face, where they threw; one thinner than the point tolerance, 100 by 0.0008, has IsDegenerate(Tolerance) true, its height over its longest side being within it, and keeps its normal all the same.