Class MeshBuilderHelper
Inheritance
MeshBuilderHelper
Assembly: CAMAPI.DotnetHelper.dll
Syntax
public static class MeshBuilderHelper
Methods
AddFaceLoop(ComWrapper<ICamApiMeshBuilder>, ReadOnlySpan<double>)
Add a whole planar-face contour loop in one call (X,Y,Z per point), the bulk
alternative to BeginFaceLoop + per-point AddLoopPoint + EndFaceLoop. Wrap the
loops of one face between BeginFace and EndFace.
Declaration
public static void AddFaceLoop(this ComWrapper<ICamApiMeshBuilder> com, ReadOnlySpan<double> coords)
Parameters
AddLoopPoint(ComWrapper<ICamApiMeshBuilder>, TST3DPoint)
Add a point to the current face loop.
Declaration
public static void AddLoopPoint(this ComWrapper<ICamApiMeshBuilder> com, TST3DPoint p)
Parameters
AddTriangle(ComWrapper<ICamApiMeshBuilder>, int, int, int)
Add a triangle referencing vertex indices from AddVertex.
Declaration
public static void AddTriangle(this ComWrapper<ICamApiMeshBuilder> com, int i1, int i2, int i3)
Parameters
AddTriangles(ComWrapper<ICamApiMeshBuilder>, ReadOnlySpan<int>)
Bulk-add triangles from a flat index span (3 indices per triangle) - the fast
path for large meshes. Indices reference vertices from AddVertex/AddVertices.
Declaration
public static void AddTriangles(this ComWrapper<ICamApiMeshBuilder> com, ReadOnlySpan<int> indices)
Parameters
AddVertex(ComWrapper<ICamApiMeshBuilder>, TST3DPoint, TST3DPoint)
Add a vertex with its position and shading normal; returns its index.
Declaration
public static int AddVertex(this ComWrapper<ICamApiMeshBuilder> com, TST3DPoint p, TST3DPoint normal)
Parameters
Returns
AddVertexColored(ComWrapper<ICamApiMeshBuilder>, TST3DPoint, TST3DPoint, int)
Add a vertex with an explicit per-vertex color ($AARRGGBB); returns its index.
The renderer interpolates the color across each triangle.
Declaration
public static int AddVertexColored(this ComWrapper<ICamApiMeshBuilder> com, TST3DPoint p, TST3DPoint normal, int color)
Parameters
Returns
AddVertexUV(ComWrapper<ICamApiMeshBuilder>, TST3DPoint, TST3DPoint, double, double)
Declaration
public static int AddVertexUV(this ComWrapper<ICamApiMeshBuilder> com, TST3DPoint p, TST3DPoint normal, double u, double v)
Parameters
Returns
AddVertices(ComWrapper<ICamApiMeshBuilder>, ReadOnlySpan<double>, ReadOnlySpan<double>)
Bulk-add vertices from flat spans - the fast path for large meshes (one
interop call instead of one per vertex). Coords is X,Y,Z per vertex; normals
is the same layout or empty for a default up-normal. The spans are pinned for
the duration of the call; the kernel copies the data.
Declaration
public static void AddVertices(this ComWrapper<ICamApiMeshBuilder> com, ReadOnlySpan<double> coords, ReadOnlySpan<double> normals = default)
Parameters
AddVerticesColored(ComWrapper<ICamApiMeshBuilder>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<int>)
Bulk per-vertex-colored variant of AddVertices. coords/normals as in
AddVertices; colors is one packed $AARRGGBB per vertex (length = coords.Length / 3).
The spans are pinned for the duration of the call; the kernel copies the data.
Declaration
public static void AddVerticesColored(this ComWrapper<ICamApiMeshBuilder> com, ReadOnlySpan<double> coords, ReadOnlySpan<double> normals, ReadOnlySpan<int> colors)
Parameters
AddVerticesUV(ComWrapper<ICamApiMeshBuilder>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>)
Bulk UV variant of AddVertices. coords/normals as in AddVertices; uvs is one
U,V pair per vertex (length = coords.Length / 3 * 2). The spans are pinned for
the duration of the call; the kernel copies the data.
Declaration
public static void AddVerticesUV(this ComWrapper<ICamApiMeshBuilder> com, ReadOnlySpan<double> coords, ReadOnlySpan<double> normals, ReadOnlySpan<double> uvs)
Parameters
BeginFace(ComWrapper<ICamApiMeshBuilder>)
Begin a planar face defined by loops.
Declaration
public static void BeginFace(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
BeginFaceLoop(ComWrapper<ICamApiMeshBuilder>)
Begin a loop of the current face (first = outer boundary, rest = holes).
Declaration
public static void BeginFaceLoop(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
Clear(ComWrapper<ICamApiMeshBuilder>)
Drop all accumulated geometry so the builder can be reused.
Declaration
public static void Clear(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
EndFace(ComWrapper<ICamApiMeshBuilder>)
Triangulate the accumulated face and append it.
Declaration
public static void EndFace(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
EndFaceLoop(ComWrapper<ICamApiMeshBuilder>)
Finish the current face loop.
Declaration
public static void EndFaceLoop(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
GetTriangleCount(ComWrapper<ICamApiMeshBuilder>)
Number of triangles added so far.
Declaration
public static int GetTriangleCount(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
Returns
GetVertexCount(ComWrapper<ICamApiMeshBuilder>)
Number of vertices added so far.
Declaration
public static int GetVertexCount(this ComWrapper<ICamApiMeshBuilder> com)
Parameters
Returns