class PolygonMesh

book_4_sparkGenerated
code_blocksInput

Description

The PolygonMesh class in the Sandbox namespace represents an editable mesh composed of polygons, which can be triangulated into a model. This class provides a comprehensive set of methods for manipulating the mesh's vertices, edges, and faces, allowing for complex geometric transformations and operations.

Members

Properties

Member NameSummary
IsDirtyIndicates if there have been changes to the mesh that require rebuilding.
TransformSpecifies the mesh's position in world space.
VertexHandlesProvides all the vertex handles being used.
FaceHandlesProvides all the face handles being used.
HalfEdgeHandlesProvides all the half edge handles being used.

Methods

Member NameSummary
BevelEdgesBevels the specified edges with given parameters.
VertexHandleFromIndexRetrieves a vertex handle from an index.
HalfEdgeHandleFromIndexRetrieves a half-edge handle from an index.
FaceHandleFromIndexRetrieves a face handle from an index.
MergeMeshMerges another mesh into this one with a transformation.
AddVertexAdds a vertex to the topology.
AddVerticesAdds multiple vertices to the topology.
AddFaceConnects vertices to form a face.
CalculateBoundsCalculates the bounds of all vertices.
ScaleScales all vertices by a given vector.
SetFaceMaterialAssigns a material to a face.
GetFaceMaterialRetrieves the material used by a face.
GetEdgeSmoothingGets the smoothing mode of an edge.
SetEdgeSmoothingSets the smoothing mode of an edge.
SetSmoothingAngleSets the smoothing angle for the mesh.
TriangleToFaceConverts a triangle index to a face handle.
ExtrudeFacesExtrudes multiple faces along an offset.
DetachFacesDetaches multiple faces from the mesh.
ExtendEdgesExtends the specified edges by a given amount.
CombineFacesCombines multiple faces into one.
DissolveEdgesDissolves the specified edges under certain conditions.
MergeEdgesMerges two edges into one.
FlipAllFacesFlips all faces in the mesh.
MergeVerticesWithinDistanceMerges vertices within a specified distance.
CreateFaceInEdgeLoopAdds a face filling in the open edge loop specified by the provided edge.
GetHalfEdgeFaceGets the face connected to a half edge.
IsEdgeOpenDetermines if the specified edge is open.
FindEdgeRingFinds all edges in the ring with the specified edge.
BridgeEdgesBridges two edges by creating a face connecting them.
ConnectEdgesConnects specified edges by adding a vertex to their midpoint.
AddVertexToEdgeAdds a vertex to an edge at a specified parameter.
RemoveVertexRemoves a vertex from the mesh.
BevelVerticesBevels the specified vertices by a given distance.
GetFacesConnectedToVertexGets all faces connected to a vertex.
FindFaceVertexConnectedToVertexFinds the face vertex connected to another vertex.
GetNextVertexInFaceGets the next vertex in a face.
ConnectVerticesConnects two vertices with an edge.
InsideTriangleDetermines if a point is inside a triangle.
FindEdgeLoopForEdgesFinds the edge loop for the specified edges.
FindEdgeIslandsFinds edge islands in the mesh.
FindEdgeRibsFinds edge ribs in the mesh.
GetEdgeLineGets the start and end points of an edge.
GetEdgeVerticesGets the two vertices of a half edge.
SetVertexPositionSets the position of a vertex.
GetVertexPositionGets the position of a vertex.
GetVertexPositionsGets the positions of all vertices.
ComputeFaceNormalComputes the normal of a face.
GetFaceCenterCalculates the center point of a face.
GetEdgesGets the start and end points of all edges.
GetFaceVertexPositionsGets the vertex positions of a face.
GetFaceVerticesConnectedToFaceGets vertices connected to a face.
GetVertexConnectedToFaceVertexGets the vertex connected to a face vertex.
ComputeFaceTextureParametersFromCoordinatesComputes texture parameters from coordinates.
ComputeFaceTextureCoordinatesFromParametersComputes texture coordinates from parameters.
ApplyTransformApplies a transformation to all vertices.
GetFaceEdgesGets all edge handles of a face.
GetFaceVerticesGets all vertex handles of a face.
GetTextureOffsetGets the texture offset of a face.
SetTextureOffsetSets the texture offset of a face.
GetTextureScaleGets the texture scale of a face.
SetTextureScaleSets the texture scale of a face.
TextureAlignToGridAligns face texture properties to grid.
TextureAlignToFaceAligns face texture properties to face.
SetFaceTextureCoordsSets face texture coordinates.
SetFaceTextureParametersSets face texture properties.
GetFaceTextureParametersGets face texture properties.
RemoveFacesRemoves specified faces from the mesh.
RemoveVerticesRemoves specified vertices from the mesh.
RemoveEdgesRemoves specified edges from the mesh.
CollapseEdgeCollapses an edge into a vertex.
CollapseFaceCollapses a face into a vertex.
SplitEdgesSplits the specified edges.
CollapseEdgesCollapses the specified edges.
RebuildTriangulates the polygons into a model.
GetEdgesConnectedToFaceGets edges connected to a face.
GetVerticesConnectedToEdgeGets vertices connected to an edge.
GetEdgeVertexPositionsGets vertex positions of an edge.
GetOppositeFaceConnectedToEdgeGets the opposite face connected to an edge.
QuadSliceFacesSlices faces into quads.
RemoveBadFacesRemoves faces that are considered bad.
AverageEdgeUVsAverages UVs across edges.
AverageVertexUVsAverages UVs across vertices.
GetBestPlanesForEdgeBetweenFacesGets the best planes for an edge between two faces.
GetNearestEdgesBetweenFacesFinds the nearest edges between two faces.
GetFacePlaneUsingEdgeGets the plane of a face using an edge.
GetOppositeHalfEdgeGets the opposite half-edge of a given edge.
GetTextureExtentsGets the texture extents for a face.
JustifyFaceTextureParametersJustifies face texture parameters.
UnionExtentsForFacesUnions extents for multiple faces.
CreateFaceCreates a face with specified parameters.
JsonReadReads a PolygonMesh from JSON.
JsonWriteWrites a PolygonMesh to JSON.