public sealed class Sandbox.PolygonMesh
An editable mesh made up of polygons, triangulated into a model
Constructors
Showing 1 constructors
public PolygonMesh()
No results match this filter.
Methods
Showing 140 methods
public HalfEdgeMesh.FaceHandle AddFace(HalfEdgeMesh.VertexHandle[] hVertices)
Connect these vertices to make a face
public HalfEdgeMesh.VertexHandle AddVertex(Vector3 position)
Add a vertex to the topology
public bool AddVertexToEdge(HalfEdgeMesh.VertexHandle hVertexA, HalfEdgeMesh.VertexHandle hVertexB, float flParam, HalfEdgeMesh.VertexHandle pOutNewVertex)
public bool AddVertexToEdgeAndUpdateTable(HalfEdgeMesh.VertexHandle hVertexA, HalfEdgeMesh.VertexHandle hVertexB, float flParam, HalfEdgeMesh.VertexHandle pNewVertex, System.Collections.Generic.SortedSet`1<HalfEdgeMesh.HalfEdgeHandle> pEdgeTable)
public HalfEdgeMesh.VertexHandle[] AddVertices(Vector3[] positions)
Add multiple vertices to the topology
public void ApplyTransform(Transform transform)
Transform all the vertices
public bool AreEdgesCoLinear(HalfEdgeMesh.HalfEdgeHandle hEdgeA, HalfEdgeMesh.HalfEdgeHandle hEdgeB, float flAngleToleranceInDegrees)
public void AverageEdgeUVs(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges)
public void AverageVertexUVs(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.VertexHandle> vertices)
public bool BevelEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, Sandbox.PolygonMesh.BevelEdgesMode edgeRemoveMode, int numSegments, float distance, float shape, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outNewOuterEdges = null, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outNewInnerEdges = null, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outNewFaces = null, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outFacesNeedingUVs = null)
Parameters
outNewOuterEdges: Default: nulloutNewInnerEdges: Default: nulloutNewFaces: Default: nulloutFacesNeedingUVs: Default: null
public bool BevelVertices(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.VertexHandle> vertices, float distance, System.Collections.Generic.List`1<HalfEdgeMesh.VertexHandle> newVertices)
public bool BridgeEdgesInterpolated(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> fromEdges, System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> toEdges, Sandbox.PolygonMesh.BridgeInterpolationParameters parameters, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outEdgesCreated)
public HalfEdgeMesh.ComponentConnectivityType ClassifyEdgeListConnectivity(System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> edgeList, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outSortedEdges = null)
Parameters
outSortedEdges: Default: null
public void ClipFacesByPlaneAndCap(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, Sandbox.Plane planeInMeshSpace, bool removeFacesBehindPlane, bool attemptToCap, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outNewEdges = null, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outCapFaces = null)
Parameters
outNewEdges: Default: nulloutCapFaces: Default: null
public void CollapseEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges)
public bool CollapseFace(HalfEdgeMesh.FaceHandle hFace, HalfEdgeMesh.VertexHandle hOutVertex)
public void CombineFaces(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces)
public bool ComputeClosestPointOnEdge(HalfEdgeMesh.VertexHandle hVertexA, HalfEdgeMesh.VertexHandle hVertexB, Vector3 vTargetPoint, float pOutBaseEdgeParam)
public void ComputeFaceNormal(HalfEdgeMesh.FaceHandle hFace, Vector3 pOutNormal)
public Vector3 ComputeOpenEdgeExtendDirection(HalfEdgeMesh.HalfEdgeHandle edge)
public bool ConnectEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> newEdges)
public bool ConnectVertices(HalfEdgeMesh.VertexHandle hVertexA, HalfEdgeMesh.VertexHandle hVertexB, HalfEdgeMesh.HalfEdgeHandle hNewEdge)
public bool CorrelateOpenEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edgeSetA, System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edgeSetB, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outA, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outB)
public HalfEdgeMesh.VertexHandle CreateEdgesConnectingVertexToPoint(HalfEdgeMesh.VertexHandle hStartVertex, Vector3 vTargetPosition, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> pOutEdgeList, bool pOutIsLastEdgeConnector, System.Collections.Generic.SortedSet`1<HalfEdgeMesh.HalfEdgeHandle> pEdgeTable)
public Sandbox.Vertex[] CreateFace(HalfEdgeMesh.FaceHandle hFace, Transform transform, Color color)
public bool CreateFaceInEdgeLoop(HalfEdgeMesh.HalfEdgeHandle hOpenEdge, HalfEdgeMesh.FaceHandle hNewFace)
Add a face filling in the open edge loop specified by the provided edge
public void DetachFaces(HalfEdgeMesh.FaceHandle[] faces, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> newFaces)
public void DissolveEdge(HalfEdgeMesh.HalfEdgeHandle edge)
public void DissolveEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, bool bFaceMustBePlanar, Sandbox.PolygonMesh.DissolveRemoveVertexCondition removeCondition)
public bool ExtendEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, float amount, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> newEdges, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> newFaces)
public void ExtrudeFaces(HalfEdgeMesh.FaceHandle[] faces, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> newFaces, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> connectingFaces, Vector3 offset = null)
Parameters
offset: Default: null
public HalfEdgeMesh.FaceHandle FaceHandleFromIndex(int index)
public void FindBoundaryEdgesConnectedToFaces(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outBoundaryEdges)
public void FindClosedFaces(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faceList, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outClosedFaces)
public void FindCornerVerticesForFace(HalfEdgeMesh.FaceHandle hFace, float minCornerAngle, System.Collections.Generic.List`1<HalfEdgeMesh.VertexHandle> outCornerVertices)
public void FindEdgeIslands(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edgeList, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle>> outEdgeList)
public void FindEdgeLoopForEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> originalEdges, HalfEdgeMesh.HalfEdgeHandle[] pOutEdgeLoopEdges)
public int FindEdgeRibs(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle>> outLeftRibs, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle>> outRightRibs)
public void FindEdgeRing(HalfEdgeMesh.HalfEdgeHandle hEdge, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outEdgeList)
public void FindFaceIslands(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle>> outFaces)
public HalfEdgeMesh.HalfEdgeHandle FindFaceVertexConnectedToVertex(HalfEdgeMesh.VertexHandle hVertex, HalfEdgeMesh.FaceHandle hFace)
public bool FindHalfEdgesConnectedToFace(HalfEdgeMesh.FaceHandle face, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> halfEdges)
public void FindOpenEdgeIslands(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edgeList, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle>> outEdgeIslands)
public void FlipAllFaces()
public void GenerateUVsForFaces(System.ReadOnlySpan`1<HalfEdgeMesh.FaceHandle> faces, int generationMode, int edgeAlignMode, HalfEdgeMesh.HalfEdgeHandle alignEdgeVertexA, HalfEdgeMesh.HalfEdgeHandle alignEdgeVertexB, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> outFaceVertices, System.Collections.Generic.List`1<Vector2> outFaceVertexUVs)
public static void GetBestPlanesForEdgeBetweenFaces(Sandbox.PolygonMesh pMesh1, HalfEdgeMesh.FaceHandle hFace1, Transform mLocalToWorld1, Sandbox.PolygonMesh pMesh2, HalfEdgeMesh.FaceHandle hFace2, Transform mLocalToWorld2, Sandbox.Plane pOutPlane1, Sandbox.Plane pOutPlane2)
public Line GetEdgeLine(HalfEdgeMesh.HalfEdgeHandle hEdge)
Get start and end points of an edge
public System.Collections.Generic.IEnumerable`1<Line> GetEdges()
Get the start and end points of all edges
public bool GetEdgesConnectedToFace(HalfEdgeMesh.FaceHandle hFace, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> edges)
public bool GetEdgesConnectedToVertex(HalfEdgeMesh.VertexHandle hVertex, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> edges)
public Sandbox.PolygonMesh.EdgeSmoothMode GetEdgeSmoothing(HalfEdgeMesh.HalfEdgeHandle hEdge)
Get the smoothing of this edge
public void GetEdgeVertexPositions(HalfEdgeMesh.HalfEdgeHandle hEdge, Transform transform, Vector3 outVertexA, Vector3 outVertexB)
public void GetEdgeVertices(HalfEdgeMesh.HalfEdgeHandle hEdge, HalfEdgeMesh.VertexHandle hVertexA, HalfEdgeMesh.VertexHandle hVertexB)
Get the two vertices of this half edge
public Vector3 GetFaceCenter(HalfEdgeMesh.FaceHandle hFace)
Calculate the center point of a face
public HalfEdgeMesh.HalfEdgeHandle[] GetFaceEdges(HalfEdgeMesh.FaceHandle hFace)
Get all edge handles of a face
public Sandbox.Material GetFaceMaterial(HalfEdgeMesh.FaceHandle hFace)
Get a material a face is using
public void GetFacePlaneUsingEdge(HalfEdgeMesh.FaceHandle hFace, HalfEdgeMesh.HalfEdgeHandle hEdge, Transform transform, Sandbox.Plane outPlane)
public void GetFacesConnectedToEdge(HalfEdgeMesh.HalfEdgeHandle hEdge, HalfEdgeMesh.FaceHandle hOutFaceA, HalfEdgeMesh.FaceHandle hOutFaceB)
public bool GetFacesConnectedToFace(HalfEdgeMesh.FaceHandle hFace, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> faces)
public bool GetFacesConnectedToVertex(HalfEdgeMesh.VertexHandle hVertex, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> faces)
public Vector2[] GetFaceTextureCoords(HalfEdgeMesh.FaceHandle hFace)
public void GetFaceTextureParameters(HalfEdgeMesh.FaceHandle hFace, Vector4 outAxisU, Vector4 outAxisV, Vector2 outScale)
public System.Collections.Generic.IEnumerable`1<Vector3> GetFaceVertexPositions(HalfEdgeMesh.FaceHandle hFace, Transform transform)
public HalfEdgeMesh.VertexHandle[] GetFaceVertices(HalfEdgeMesh.FaceHandle hFace)
Get all vertex handles of a face
public bool GetFaceVerticesConnectedToFace(HalfEdgeMesh.FaceHandle hFace, HalfEdgeMesh.HalfEdgeHandle[] hEdges)
public bool GetFaceVerticesConnectedToVertex(HalfEdgeMesh.VertexHandle hVertex, System.Collections.Generic.List`1<HalfEdgeMesh.HalfEdgeHandle> faceVertices)
public HalfEdgeMesh.FaceHandle GetHalfEdgeFace(HalfEdgeMesh.HalfEdgeHandle hEdge)
Get the face connected to this half edge
public static bool GetNearestEdgesBetweenFaces(Sandbox.PolygonMesh pMesh1, HalfEdgeMesh.FaceHandle hFace1, Transform mLocalToWorld1, Sandbox.PolygonMesh pMesh2, HalfEdgeMesh.FaceHandle hFace2, Transform mLocalToWorld2, HalfEdgeMesh.HalfEdgeHandle pOutEdge1, HalfEdgeMesh.HalfEdgeHandle pOutEdge2)
public HalfEdgeMesh.HalfEdgeHandle GetNextVertexInFace(HalfEdgeMesh.HalfEdgeHandle hFaceVertex)
public HalfEdgeMesh.FaceHandle GetOppositeFaceConnectedToEdge(HalfEdgeMesh.HalfEdgeHandle hEdge, HalfEdgeMesh.FaceHandle hFace)
public HalfEdgeMesh.HalfEdgeHandle GetOppositeHalfEdge(HalfEdgeMesh.HalfEdgeHandle hEdge)
public Vector2 GetTextureCoord(HalfEdgeMesh.HalfEdgeHandle faceVertex)
Get face vertex texture coord
public static void GetTextureExtents(Vector4 vAxisU, Vector4 vAxisV, Vector2 vScale, Sandbox.PolygonMesh.FaceExtents extents, Vector2 topLeft, Vector2 bottomRight)
public Vector2 GetTextureOffset(HalfEdgeMesh.FaceHandle hFace)
Get texture offset of a face
public Vector2 GetTextureScale(HalfEdgeMesh.FaceHandle hFace)
Get texture scale of a face
public Color32 GetVertexBlend(HalfEdgeMesh.HalfEdgeHandle hFaceVertex)
Get the blend of a vertex
public Color32 GetVertexColor(HalfEdgeMesh.HalfEdgeHandle hFaceVertex)
Get the color of a vertex
public HalfEdgeMesh.VertexHandle GetVertexConnectedToFaceVertex(HalfEdgeMesh.HalfEdgeHandle hFaceVertex)
public System.Collections.Generic.IEnumerable`1<Vector3> GetVertexPositions()
Get the positions of all vertices
public bool GetVerticesConnectedToFace(HalfEdgeMesh.FaceHandle hFace, HalfEdgeMesh.VertexHandle[] vertices)
public HalfEdgeMesh.HalfEdgeHandle HalfEdgeHandleFromIndex(int index)
public bool IsEdgeOpen(HalfEdgeMesh.HalfEdgeHandle hEdge)
Determine if the specified edge is open (only has one connected face)
public bool IsEdgeSmooth(HalfEdgeMesh.HalfEdgeHandle hEdge)
public static override object JsonRead(System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert)
public static override void JsonWrite(object value, System.Text.Json.Utf8JsonWriter writer)
public void JustifyFaceTextureParameters(System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.FaceHandle> hFaces, Sandbox.PolygonMesh.TextureJustification justification, Sandbox.PolygonMesh.FaceExtents extents)
public bool MergeEdges(HalfEdgeMesh.HalfEdgeHandle hEdgeA, HalfEdgeMesh.HalfEdgeHandle hEdgeB, HalfEdgeMesh.HalfEdgeHandle hOutNewEdge)
public void MergeMesh(Sandbox.PolygonMesh sourceMesh, Transform transform, System.Collections.Generic.Dictionary`2<HalfEdgeMesh.VertexHandle,HalfEdgeMesh.VertexHandle> newVertices, System.Collections.Generic.Dictionary`2<HalfEdgeMesh.HalfEdgeHandle,HalfEdgeMesh.HalfEdgeHandle> newHalfEdges, System.Collections.Generic.Dictionary`2<HalfEdgeMesh.FaceHandle,HalfEdgeMesh.FaceHandle> newFaces)
public int MergeVerticesWithinDistance(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.VertexHandle> originalVertices, float flMaxDistance, bool bPreConnect, bool bAveragePositions, System.Collections.Generic.List`1<HalfEdgeMesh.VertexHandle> pOutFinalVertices)
public void QuadSliceFaces(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, int cutsX, int cutsY, float minCornerAngleDegrees, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outNewFaceList)
public Sandbox.Model Rebuild()
Triangulate the polygons into a model
public void RemoveBadFaces()
public bool RemoveColinearVertexAndUpdateTable(HalfEdgeMesh.VertexHandle hVertex, System.Collections.Generic.SortedSet`1<HalfEdgeMesh.HalfEdgeHandle> edgeTable, float flColinearAngleTolerance = 5)
Parameters
flColinearAngleTolerance: Default: 5
public void RemoveEdges(System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.HalfEdgeHandle> hEdges)
public void RemoveFaces(System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.FaceHandle> hFaces)
public bool RemoveVertex(HalfEdgeMesh.VertexHandle hVertex, bool removeFreeVerts)
public void RemoveVertices(System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.VertexHandle> hVertices)
public void Scale(Vector3 scale)
Scale all vertices
public void SetEdgeSmoothing(HalfEdgeMesh.HalfEdgeHandle hEdge, Sandbox.PolygonMesh.EdgeSmoothMode mode)
Set the smoothing of this edge
public void SetFaceTextureCoords(HalfEdgeMesh.FaceHandle hFace, System.Collections.Generic.IReadOnlyList`1<Vector2> texcoords)
public void SetSmoothingAngle(float smoothingAngle)
public void SetTextureCoord(HalfEdgeMesh.HalfEdgeHandle faceVertex, Vector2 texcoord)
Set face vertex texture coord
public void SetTextureOffset(HalfEdgeMesh.FaceHandle hFace, Vector2 offset)
Set texture offset of a face
public void SetTextureScale(HalfEdgeMesh.FaceHandle hFace, Vector2 scale)
Set texture scale of a face
public void SetTransform(Transform transform)
Set transform without computing texture parameters from coordinates.
public void SetVertexBlend(HalfEdgeMesh.HalfEdgeHandle hFaceVertex, Color32 blend)
Set the blend of a vertex
public void SetVertexColor(HalfEdgeMesh.HalfEdgeHandle hFaceVertex, Color32 color)
Set the color of a vertex
public void SetVertexPosition(HalfEdgeMesh.VertexHandle hVertex, Vector3 position)
Set the position of a vertex
public bool SplitEdges(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.HalfEdgeHandle> edges, HalfEdgeMesh.HalfEdgeHandle[] newEdgesA, HalfEdgeMesh.HalfEdgeHandle[] pOutNewEdgesB)
public void SplitFacesIntoIslandsForUVMapping(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, System.Collections.Generic.List`1<System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle>> faceIslands)
public void TextureAlignToFace(Transform transform, HalfEdgeMesh.FaceHandle hFace)
Align face texture properties to face
public bool ThickenFaces(System.Collections.Generic.IReadOnlyList`1<HalfEdgeMesh.FaceHandle> faces, float amount, System.Collections.Generic.List`1<HalfEdgeMesh.FaceHandle> outFaces)
public HalfEdgeMesh.FaceHandle TriangleToFace(int triangle)
Convert a triangle index to a face handle
public void UnionExtentsForFaces(System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.FaceHandle> hFaces, Transform transform, Sandbox.PolygonMesh.FaceExtents extents)
public HalfEdgeMesh.VertexHandle VertexHandleFromIndex(int index)
No results match this filter.
Properties
Showing 5 properties
public System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.FaceHandle> Sandbox.PolygonMesh.FaceHandles { get; set; }
All of the face handles being used
public System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.HalfEdgeHandle> Sandbox.PolygonMesh.HalfEdgeHandles { get; set; }
All of the half edge handles being used
public bool Sandbox.PolygonMesh.IsDirty { get; set; }
Has there been changes to the mesh that need rebuilding?
public System.Collections.Generic.IEnumerable`1<HalfEdgeMesh.VertexHandle> Sandbox.PolygonMesh.VertexHandles { get; set; }
All of the vertex handles being used
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.PolygonMesh |