RaptorMeshQueries
Read-only queries on Blocks, their meshes and the Mesh tool's element selection.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Read-only queries for modules that derive a copy of a Block's mesh. Mesh values are in the mesh core's coordinate space.
public static class RaptorMeshQueriesMethods
CornerNormals
public static List<SVector3> CornerNormals(PolygonMesh mesh)Returns every face's corner normals in FaceHandles order, with corners in face order. They match the normals a build packs, which come from the smoothing angle and each edge's Hard or Soft setting. Returns a new list on each call.
| Parameter | Type | Description |
|---|---|---|
mesh | PolygonMesh | The Block's editable mesh. |
Returns: The normals.
EdgeFaces
public static bool EdgeFaces(PolygonMesh mesh, HalfEdgeHandle h, out FaceHandle a, out FaceHandle b)Gets the two faces of the closed edge h.
| Parameter | Type | Description |
|---|---|---|
mesh | PolygonMesh | The Block's editable mesh. |
| h | HalfEdgeHandle | The half-edge. |
| a | out FaceHandle | The first face. |
| b | out FaceHandle | The second face. |
Returns: True for a closed edge. False for an open or invalid edge.
FaceMaterialIndex
public static int FaceMaterialIndex(PolygonMesh mesh, FaceHandle face)Returns the index of face's material in mesh's material list. Faces with the same index use the same material.
| Parameter | Type | Description |
|---|---|---|
mesh | PolygonMesh | The Block's editable mesh. |
face | FaceHandle | The face. |
Returns: The index.
FaceTriangles
public static int[] FaceTriangles(SVector3[] positions)Returns the build's triangulation of one face as indices into positions, wound like the face.
| Parameter | Type | Description |
|---|---|---|
positions | SVector3[] | The face's corners, in order. |
Returns: The indices, or null when the build emits no triangles for the face.
LiveMeshOf
public static PolygonMesh LiveMeshOf(RaptorMesh km)Returns the live or preview mesh of km while the Mesh tool edits it. Does not create an edit session or load anything.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
Returns: The mesh, or null when the Block is not being edited (read the packed data instead).
LiveVersionOf
public static int LiveVersionOf(RaptorMesh km)Returns a number that changes whenever the live or preview mesh of km may have changed. Use it as a cache key alongside the Block's revision.
| Parameter | Type | Description |
|---|---|---|
km | RaptorMesh | The Block. |
Returns: The version, or 0 when there is no live mesh.
SelectedClosedEdges
public static List<MeshEdge> SelectedClosedEdges(IEnumerable<RaptorMesh> meshes)Returns the closed edges selected in Edge mode on meshes. Returns a new list on each call.
| Parameter | Type | Description |
|---|---|---|
meshes | IEnumerable<RaptorMesh> | The Blocks. |
Returns: The edges. Empty unless Mesh mode and Edge mode are active and some of the Blocks' edges are selected.
Related types
- RaptorMesh: A RAPTOR Mesh Block.