Class EdgeDetection
This utility analyses a mesh, finding a hash that indicates what it can connect two.
There's two steps to the analysis.
- For each corner of the cell, determine if it is inside or outside the mesh. This handles non watertight meshes.
- For each face of the cell, find the mesh edges coincident to that face.
The hashes are unique to a specific face and specific rotation of the tile, and are structured in a way that
you can get the same has for a left pointing and right pointing face if they share the same mesh edges and corners.
Inheritance
EdgeDetection
Assembly: Tessera.dll
Syntax
public static class EdgeDetection
Fields
DefaultTolerance
Declaration
public const float DefaultTolerance = 1E-06
Field Value
Methods
GetFaces(TesseraTileBase, IEnumerable<CellRotation>, MeshData, HashSet<(Vector3Int, CellCorner)>, float, bool)
Declaration
public static IList<EdgeDetection.Face> GetFaces(TesseraTileBase tile, IEnumerable<CellRotation> rotations, MeshData meshData, HashSet<(Vector3Int, CellCorner)> interiorCorners, float tolerance = 1E-06, bool debug = false)
Parameters
Returns
GetFaces(TesseraTileBase, IEnumerable<CellRotation>, Mesh, float, bool)
Extracts a summary of all the tile faces.
Declaration
public static IList<EdgeDetection.Face> GetFaces(TesseraTileBase tile, IEnumerable<CellRotation> rotations, Mesh mesh, float tolerance = 1E-06, bool debug = false)
Parameters
Returns
GetInteriorCorners(TesseraTileBase, MeshData, bool)
null mesh => all exterior
empty mesh => all interior
Declaration
public static HashSet<(Vector3Int, CellCorner)> GetInteriorCorners(TesseraTileBase tile, MeshData meshData, bool debug = false)
Parameters
Returns
Type |
Description |
HashSet<(Vector3Int, CellCorner)> |
|