Search Results for

    Show / Hide Table of Contents

    Class MeshEditor

    Inheritance
    Object
    MeshEditor
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: g3
    Assembly: cs.temp.dll.dll
    Syntax
    public class MeshEditor

    Constructors

    MeshEditor(DMesh3)

    Declaration
    public MeshEditor(DMesh3 mesh)
    Parameters
    Type Name Description
    DMesh3 mesh

    Fields

    Mesh

    Declaration
    public DMesh3 Mesh
    Field Value
    Type Description
    DMesh3

    Methods

    AddTriangleFan_OrderedEdgeLoop(Int32, Int32[], Int32)

    Declaration
    public virtual int[] AddTriangleFan_OrderedEdgeLoop(int center, int[] edge_loop, int group_id = -1)
    Parameters
    Type Name Description
    Int32 center
    Int32[] edge_loop
    Int32 group_id
    Returns
    Type Description
    Int32[]

    AddTriangleFan_OrderedVertexLoop(Int32, Int32[], Int32)

    Declaration
    public virtual int[] AddTriangleFan_OrderedVertexLoop(int center, int[] vertex_loop, int group_id = -1)
    Parameters
    Type Name Description
    Int32 center
    Int32[] vertex_loop
    Int32 group_id
    Returns
    Type Description
    Int32[]

    AddTriangleStrip(IList<Frame3f>, IList<Interval1d>, Int32)

    Declaration
    public virtual int[] AddTriangleStrip(IList<Frame3f> frames, IList<Interval1d> spans, int group_id = -1)
    Parameters
    Type Name Description
    IList<Frame3f> frames
    IList<Interval1d> spans
    Int32 group_id
    Returns
    Type Description
    Int32[]

    Append(DMesh3, DMesh3)

    Declaration
    public static void Append(DMesh3 appendTo, DMesh3 append)
    Parameters
    Type Name Description
    DMesh3 appendTo
    DMesh3 append

    AppendBox(DMesh3, Frame3f, Vector3f, Colorf)

    Declaration
    public static void AppendBox(DMesh3 mesh, Frame3f frame, Vector3f size, Colorf color)
    Parameters
    Type Name Description
    DMesh3 mesh
    Frame3f frame
    Vector3f size
    Colorf color

    AppendBox(DMesh3, Vector3d, Vector3d, Single)

    Declaration
    public static void AppendBox(DMesh3 mesh, Vector3d pos, Vector3d normal, float size)
    Parameters
    Type Name Description
    DMesh3 mesh
    Vector3d pos
    Vector3d normal
    Single size

    AppendBox(DMesh3, Vector3d, Vector3d, Single, Colorf)

    Declaration
    public static void AppendBox(DMesh3 mesh, Vector3d pos, Vector3d normal, float size, Colorf color)
    Parameters
    Type Name Description
    DMesh3 mesh
    Vector3d pos
    Vector3d normal
    Single size
    Colorf color

    AppendBox(DMesh3, Vector3d, Single)

    Declaration
    public static void AppendBox(DMesh3 mesh, Vector3d pos, float size)
    Parameters
    Type Name Description
    DMesh3 mesh
    Vector3d pos
    Single size

    AppendBox(DMesh3, Vector3d, Single, Colorf)

    Declaration
    public static void AppendBox(DMesh3 mesh, Vector3d pos, float size, Colorf color)
    Parameters
    Type Name Description
    DMesh3 mesh
    Vector3d pos
    Single size
    Colorf color

    AppendBox(Frame3f, Vector3f)

    Declaration
    public void AppendBox(Frame3f frame, Vector3f size)
    Parameters
    Type Name Description
    Frame3f frame
    Vector3f size

    AppendBox(Frame3f, Vector3f, Colorf)

    Declaration
    public void AppendBox(Frame3f frame, Vector3f size, Colorf color)
    Parameters
    Type Name Description
    Frame3f frame
    Vector3f size
    Colorf color

    AppendBox(Frame3f, Single)

    Declaration
    public void AppendBox(Frame3f frame, float size)
    Parameters
    Type Name Description
    Frame3f frame
    Single size

    AppendLine(DMesh3, Segment3d, Single)

    Declaration
    public static void AppendLine(DMesh3 mesh, Segment3d seg, float size)
    Parameters
    Type Name Description
    DMesh3 mesh
    Segment3d seg
    Single size

    AppendLine(Segment3d, Single)

    Declaration
    public void AppendLine(Segment3d seg, float size)
    Parameters
    Type Name Description
    Segment3d seg
    Single size

    AppendLine(Segment3d, Single, Colorf)

    Declaration
    public void AppendLine(Segment3d seg, float size, Colorf color)
    Parameters
    Type Name Description
    Segment3d seg
    Single size
    Colorf color

    AppendMesh(IMesh, IndexMap, out Int32[], Int32)

    Declaration
    public bool AppendMesh(IMesh appendMesh, IndexMap mergeMapV, out int[] mapV, int appendGID = -1)
    Parameters
    Type Name Description
    IMesh appendMesh
    IndexMap mergeMapV
    Int32[] mapV
    Int32 appendGID
    Returns
    Type Description
    Boolean

    AppendMesh(IMesh, Int32)

    Declaration
    public bool AppendMesh(IMesh appendMesh, int appendGID = -1)
    Parameters
    Type Name Description
    IMesh appendMesh
    Int32 appendGID
    Returns
    Type Description
    Boolean

    AppendMesh(IMesh, out Int32[], Int32)

    Declaration
    public bool AppendMesh(IMesh appendMesh, out int[] mapV, int appendGID = -1)
    Parameters
    Type Name Description
    IMesh appendMesh
    Int32[] mapV
    Int32 appendGID
    Returns
    Type Description
    Boolean

    AppendPathSolid(IEnumerable<Vector3d>, Double, Colorf)

    Declaration
    public void AppendPathSolid(IEnumerable<Vector3d> vertices, double radius, Colorf color)
    Parameters
    Type Name Description
    IEnumerable<Vector3d> vertices
    Double radius
    Colorf color

    Combine(IMesh[])

    Declaration
    public static DMesh3 Combine(params IMesh[] appendMeshes)
    Parameters
    Type Name Description
    IMesh[] appendMeshes
    Returns
    Type Description
    DMesh3

    DisconnectAllBowties(Int32)

    Disconnect all bowtie vertices in mesh. Iterates because sometimes disconnecting a bowtie creates new bowties (how??). Returns number of remaining bowties after iterations.

    Declaration
    public int DisconnectAllBowties(int nMaxIters = 10)
    Parameters
    Type Name Description
    Int32 nMaxIters
    Returns
    Type Description
    Int32

    DisconnectBowtie(Int32)

    separate triangle one-ring at vertex into connected components, and then duplicate vertex once for each component

    Declaration
    public void DisconnectBowtie(int vid)
    Parameters
    Type Name Description
    Int32 vid

    DuplicateTriangles(IEnumerable<Int32>, ref IndexMap, Int32)

    Make a copy of provided triangles, with new vertices. You provide MapV because you know if you are doing a small subset or a full-mesh-copy.

    Declaration
    public List<int> DuplicateTriangles(IEnumerable<int> triangles, ref IndexMap MapV, int group_id = -1)
    Parameters
    Type Name Description
    IEnumerable<Int32> triangles
    IndexMap MapV
    Int32 group_id
    Returns
    Type Description
    List<Int32>

    ReinsertSubmesh(DSubmesh3, ref Int32[], out IndexMap, MeshEditor.DuplicateTriBehavior)

    Declaration
    public bool ReinsertSubmesh(DSubmesh3 sub, ref int[] new_tris, out IndexMap SubToNewV, MeshEditor.DuplicateTriBehavior eDuplicateBehavior = MeshEditor.DuplicateTriBehavior.AssertAbort)
    Parameters
    Type Name Description
    DSubmesh3 sub
    Int32[] new_tris
    IndexMap SubToNewV
    MeshEditor.DuplicateTriBehavior eDuplicateBehavior
    Returns
    Type Description
    Boolean

    RemoveAllBowtieVertices(Boolean)

    Remove all bowtie vertices in mesh. Makes one pass unless bRepeatUntilClean = true, in which case repeats until no more bowties found Returns true if any vertices were removed

    Declaration
    public bool RemoveAllBowtieVertices(bool bRepeatUntilClean)
    Parameters
    Type Name Description
    Boolean bRepeatUntilClean
    Returns
    Type Description
    Boolean

    RemoveFinTriangles(DMesh3, Func<DMesh3, Int32, Boolean>, Boolean)

    Remove 'fin' triangles that have only one connected triangle. Removing one fin can create another, by default will keep iterating until all fins removed (in a not very efficient way!). Pass bRepeatToConvergence=false to only do one pass. [TODO] if we are repeating, construct face selection from nbrs of first list and iterate over that on future passes!

    Declaration
    public static int RemoveFinTriangles(DMesh3 mesh, Func<DMesh3, int, bool> removeF = null, bool bRepeatToConvergence = true)
    Parameters
    Type Name Description
    DMesh3 mesh
    Func<DMesh3, Int32, Boolean> removeF
    Boolean bRepeatToConvergence
    Returns
    Type Description
    Int32

    RemoveIsolatedTriangles(DMesh3)

    Remove 'loner' triangles that have no connected neighbours.

    Declaration
    public static bool RemoveIsolatedTriangles(DMesh3 mesh)
    Parameters
    Type Name Description
    DMesh3 mesh
    Returns
    Type Description
    Boolean

    RemoveSmallComponents(DMesh3, Double, Double)

    Declaration
    public static int RemoveSmallComponents(DMesh3 mesh, double min_volume, double min_area)
    Parameters
    Type Name Description
    DMesh3 mesh
    Double min_volume
    Double min_area
    Returns
    Type Description
    Int32

    RemoveSmallComponents(Double, Double)

    Remove any connected components with volume < min_volume area lt; min_area

    Declaration
    public int RemoveSmallComponents(double min_volume, double min_area)
    Parameters
    Type Name Description
    Double min_volume
    Double min_area
    Returns
    Type Description
    Int32

    RemoveTriangles(DMesh3, IEnumerable<Int32>, Boolean)

    Declaration
    public static bool RemoveTriangles(DMesh3 Mesh, IEnumerable<int> triangles, bool bRemoveIsolatedVerts = true)
    Parameters
    Type Name Description
    DMesh3 Mesh
    IEnumerable<Int32> triangles
    Boolean bRemoveIsolatedVerts
    Returns
    Type Description
    Boolean

    RemoveTriangles(DMesh3, IList<Int32>, Boolean)

    Declaration
    public static bool RemoveTriangles(DMesh3 Mesh, IList<int> triangles, bool bRemoveIsolatedVerts = true)
    Parameters
    Type Name Description
    DMesh3 Mesh
    IList<Int32> triangles
    Boolean bRemoveIsolatedVerts
    Returns
    Type Description
    Boolean

    RemoveTriangles(IEnumerable<Int32>, Boolean)

    Declaration
    public bool RemoveTriangles(IEnumerable<int> triangles, bool bRemoveIsolatedVerts)
    Parameters
    Type Name Description
    IEnumerable<Int32> triangles
    Boolean bRemoveIsolatedVerts
    Returns
    Type Description
    Boolean

    RemoveTriangles(IList<Int32>, Boolean)

    Declaration
    public bool RemoveTriangles(IList<int> triangles, bool bRemoveIsolatedVerts)
    Parameters
    Type Name Description
    IList<Int32> triangles
    Boolean bRemoveIsolatedVerts
    Returns
    Type Description
    Boolean

    RemoveTriangles(Func<Int32, Boolean>, Boolean)

    Declaration
    public bool RemoveTriangles(Func<int, bool> selectorF, bool bRemoveIsolatedVerts)
    Parameters
    Type Name Description
    Func<Int32, Boolean> selectorF
    Boolean bRemoveIsolatedVerts
    Returns
    Type Description
    Boolean

    RemoveUnusedVertices()

    Remove any unused vertices in mesh, ie vertices with no edges. Returns number of removed vertices.

    Declaration
    public int RemoveUnusedVertices()
    Returns
    Type Description
    Int32

    RemoveUnusedVertices(DMesh3)

    Declaration
    public static int RemoveUnusedVertices(DMesh3 mesh)
    Parameters
    Type Name Description
    DMesh3 mesh
    Returns
    Type Description
    Int32

    ReverseTriangles(IEnumerable<Int32>, Boolean)

    Reverse face orientation on a subset of triangles

    Declaration
    public void ReverseTriangles(IEnumerable<int> triangles, bool bFlipVtxNormals = true)
    Parameters
    Type Name Description
    IEnumerable<Int32> triangles
    Boolean bFlipVtxNormals

    SeparateTriangles(IEnumerable<Int32>, Boolean, out List<Index2i>)

    Disconnect the given triangles from their neighbours, by duplicating "boundary" vertices, ie vertices on edges for which one triangle is in-set and the other is not. If bComputeEdgePairs is true, we return list of old/new edge pairs (useful for stitching) [TODO] currently boundary-edge behaviour is to not duplicate boundary verts

    Declaration
    public bool SeparateTriangles(IEnumerable<int> triangles, bool bComputeEdgePairs, out List<Index2i> EdgePairs)
    Parameters
    Type Name Description
    IEnumerable<Int32> triangles
    Boolean bComputeEdgePairs
    List<Index2i> EdgePairs
    Returns
    Type Description
    Boolean

    StitchLoop(Int32[], Int32[], Int32)

    Trivial back-and-forth stitch between two vertex loops with same length. Loops must have appropriate orientation (which is...??) [TODO] check and fail on bad orientation

    Declaration
    public virtual int[] StitchLoop(int[] vloop1, int[] vloop2, int group_id = -1)
    Parameters
    Type Name Description
    Int32[] vloop1
    Int32[] vloop2
    Int32 group_id
    Returns
    Type Description
    Int32[]

    StitchSpan(IList<Int32>, IList<Int32>, Int32)

    Trivial back-and-forth stitch between two vertex spans with same length. vertex ordering must reslut in appropriate orientation (which is...??) [TODO] check and fail on bad orientation

    Declaration
    public virtual int[] StitchSpan(IList<int> vspan1, IList<int> vspan2, int group_id = -1)
    Parameters
    Type Name Description
    IList<Int32> vspan1
    IList<Int32> vspan2
    Int32 group_id
    Returns
    Type Description
    Int32[]

    StitchUnorderedEdges(List<Index2i>, Int32, Boolean)

    Declaration
    public virtual int[] StitchUnorderedEdges(List<Index2i> EdgePairs, int group_id = -1, bool bAbortOnFailure = true)
    Parameters
    Type Name Description
    List<Index2i> EdgePairs
    Int32 group_id
    Boolean bAbortOnFailure
    Returns
    Type Description
    Int32[]

    StitchUnorderedEdges(List<Index2i>, Int32, Boolean, out Boolean)

    Stitch two sets of boundary edges that are provided as unordered pairs of edges, by adding triangulated quads between each edge pair. If bAbortOnFailure==true and a failure is encountered during stitching, the triangles added up to that point are removed. If bAbortOnFailure==false, failures are ignored and the returned triangle list may contain invalid values!

    Declaration
    public virtual int[] StitchUnorderedEdges(List<Index2i> EdgePairs, int group_id, bool bAbortOnFailure, out bool stitch_incomplete)
    Parameters
    Type Name Description
    List<Index2i> EdgePairs
    Int32 group_id
    Boolean bAbortOnFailure
    Boolean stitch_incomplete
    Returns
    Type Description
    Int32[]

    StitchVertexLoops_NearestV(Int32[], Int32[], Int32)

    Trivial back-and-forth stitch between two vertex loops with same length. If nearest vertices of input loops would not be matched, cycles loops so that this is the case. Loops must have appropriate orientation.

    Declaration
    public virtual int[] StitchVertexLoops_NearestV(int[] loop0, int[] loop1, int group_id = -1)
    Parameters
    Type Name Description
    Int32[] loop0
    Int32[] loop1
    Int32 group_id
    Returns
    Type Description
    Int32[]
    In This Article
    Back to top ViRGIS VR GIS