MeshExtensionMethods

public static class MeshExtensionMethods

Methods

public static double Area(
this MeshFace
face,
mesh,
boundary
)
public static double Area(
this MeshFace
face,
mesh
)

Boundary

#Example
public static Polyline Boundary(
this MeshFace
face,
mesh
)

EdgeRange

#Example
public static (double shortest, double longest) EdgeRange(
this MeshFace
face,
mesh
)

EdgeTouchesVertex

#Example
Test whether a specific topological edge involves a specific vertex. This test checks whether any of the faces using this edge also use the vertex in question.
public static bool EdgeTouchesVertex(
this Mesh
mesh,
Mesh containing edges and vertices.
edgeIndex,
Index of topological edge.
vertexIndex
Index of regular vertex.
)

FindEdge

#Example
Try and find the edge index which connects vertices A and B.
public static int FindEdge(
this Mesh
mesh,
Mesh.
vertexA,
First vertex index.
vertexB
Second vertex index.
)
Index of edge connecting A and B or -1.

FindNeighbours

#Example
Find the vertices, if any, that come before and after a given vertex around the face. This method assumes the face is valid.
public static bool FindNeighbours(
this MeshFace
face,
vertex,
out int
before,
out int
after
)
True if vertices were found, false if otherwise.

Shade360

#Example
Apply a full shading to all the vertices of a mesh. This requires vertices already having false colours.
public static void Shade360(
this Mesh
mesh,
Mesh to shade.
light,
Direction *towards* the light source.
lit = 0.3,
Amount of lightening towards light.
shade = 0.3
Amount of darkening away from light.
)

ShadeFlat

#Example
Apply a flat shading to all the faces of a mesh. This involves unwelding *all* edges.
public static void ShadeFlat(
this Mesh
mesh,
Mesh to colour.
params Color[]
palette
Palette of colours to apply randomly.
)

ShadeGooch

#Example
Apply a gooch shading to all the vertices of a mesh. This requires vertices already having false colours.
public static void ShadeGooch(
this Mesh
mesh,
Mesh to shade.
light,
Direction *towards* the light sourc.
Color
warm,
Warm gooch colour for tinting of lit areas.
Color
cold
Cool gooch colour for tinting of shaded areas.
)

ShadeGooch

#Example
Apply a gooch shading to all the vertices of a mesh. This requires vertices already having false colours.
public static void ShadeGooch(
this Mesh
mesh,
Mesh to shade.
light
Direction *towards* the lght source.
)

ShadeLambertian

#Example
Apply a lamberian smooth shading to all the vertices of a mesh. This requires vertices already having false colours.
public static void ShadeLambertian(
this Mesh
mesh,
Mesh to shade.
light,
Direction *towards* the light source.
lit = 0.3,
Amount of lighting to apply to fully lit vertices.
shade = -0.3
Amount of darkening to apply to fully shaded vertices.
)

Touches

#Example
Test whether any of the face corners equals the vertex index.
public static bool Touches(
this MeshFace
face,
vertex
)