Class MeshEditor
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
Constructors
MeshEditor(DMesh3)
Declaration
public MeshEditor(DMesh3 mesh)
Parameters
Type |
Name |
Description |
DMesh3 |
mesh |
|
Fields
Mesh
Declaration
Field Value
Methods
AddTriangleFan_OrderedEdgeLoop(Int32, Int32[], Int32)
Declaration
public virtual int[] AddTriangleFan_OrderedEdgeLoop(int center, int[] edge_loop, int group_id = -1)
Parameters
Returns
AddTriangleFan_OrderedVertexLoop(Int32, Int32[], Int32)
Declaration
public virtual int[] AddTriangleFan_OrderedVertexLoop(int center, int[] vertex_loop, int group_id = -1)
Parameters
Returns
AddTriangleStrip(IList<Frame3f>, IList<Interval1d>, Int32)
Declaration
public virtual int[] AddTriangleStrip(IList<Frame3f> frames, IList<Interval1d> spans, int group_id = -1)
Parameters
Returns
Append(DMesh3, DMesh3)
Declaration
public static void Append(DMesh3 appendTo, DMesh3 append)
Parameters
AppendBox(DMesh3, Frame3f, Vector3f, Colorf)
Declaration
public static void AppendBox(DMesh3 mesh, Frame3f frame, Vector3f size, Colorf color)
Parameters
AppendBox(DMesh3, Vector3d, Vector3d, Single)
Declaration
public static void AppendBox(DMesh3 mesh, Vector3d pos, Vector3d normal, float size)
Parameters
AppendBox(DMesh3, Vector3d, Vector3d, Single, Colorf)
Declaration
public static void AppendBox(DMesh3 mesh, Vector3d pos, Vector3d normal, float size, Colorf color)
Parameters
AppendBox(DMesh3, Vector3d, Single)
Declaration
public static void AppendBox(DMesh3 mesh, Vector3d pos, float size)
Parameters
AppendBox(DMesh3, Vector3d, Single, Colorf)
Declaration
public static void AppendBox(DMesh3 mesh, Vector3d pos, float size, Colorf color)
Parameters
AppendBox(Frame3f, Vector3f)
Declaration
public void AppendBox(Frame3f frame, Vector3f size)
Parameters
AppendBox(Frame3f, Vector3f, Colorf)
Declaration
public void AppendBox(Frame3f frame, Vector3f size, Colorf color)
Parameters
AppendBox(Frame3f, Single)
Declaration
public void AppendBox(Frame3f frame, float size)
Parameters
AppendLine(DMesh3, Segment3d, Single)
Declaration
public static void AppendLine(DMesh3 mesh, Segment3d seg, float size)
Parameters
AppendLine(Segment3d, Single)
Declaration
public void AppendLine(Segment3d seg, float size)
Parameters
AppendLine(Segment3d, Single, Colorf)
Declaration
public void AppendLine(Segment3d seg, float size, Colorf color)
Parameters
AppendMesh(IMesh, IndexMap, out Int32[], Int32)
Declaration
public bool AppendMesh(IMesh appendMesh, IndexMap mergeMapV, out int[] mapV, int appendGID = -1)
Parameters
Returns
AppendMesh(IMesh, Int32)
Declaration
public bool AppendMesh(IMesh appendMesh, int appendGID = -1)
Parameters
Type |
Name |
Description |
IMesh |
appendMesh |
|
Int32 |
appendGID |
|
Returns
AppendMesh(IMesh, out Int32[], Int32)
Declaration
public bool AppendMesh(IMesh appendMesh, out int[] mapV, int appendGID = -1)
Parameters
Returns
AppendPathSolid(IEnumerable<Vector3d>, Double, Colorf)
Declaration
public void AppendPathSolid(IEnumerable<Vector3d> vertices, double radius, Colorf color)
Parameters
Combine(IMesh[])
Declaration
public static DMesh3 Combine(params IMesh[] appendMeshes)
Parameters
Type |
Name |
Description |
IMesh[] |
appendMeshes |
|
Returns
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
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
Returns
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
Returns
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
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
Returns
RemoveIsolatedTriangles(DMesh3)
Remove 'loner' triangles that have no connected neighbours.
Declaration
public static bool RemoveIsolatedTriangles(DMesh3 mesh)
Parameters
Type |
Name |
Description |
DMesh3 |
mesh |
|
Returns
RemoveSmallComponents(DMesh3, Double, Double)
Declaration
public static int RemoveSmallComponents(DMesh3 mesh, double min_volume, double min_area)
Parameters
Returns
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
Returns
RemoveTriangles(DMesh3, IEnumerable<Int32>, Boolean)
Declaration
public static bool RemoveTriangles(DMesh3 Mesh, IEnumerable<int> triangles, bool bRemoveIsolatedVerts = true)
Parameters
Returns
RemoveTriangles(DMesh3, IList<Int32>, Boolean)
Declaration
public static bool RemoveTriangles(DMesh3 Mesh, IList<int> triangles, bool bRemoveIsolatedVerts = true)
Parameters
Returns
RemoveTriangles(IEnumerable<Int32>, Boolean)
Declaration
public bool RemoveTriangles(IEnumerable<int> triangles, bool bRemoveIsolatedVerts)
Parameters
Returns
RemoveTriangles(IList<Int32>, Boolean)
Declaration
public bool RemoveTriangles(IList<int> triangles, bool bRemoveIsolatedVerts)
Parameters
Returns
RemoveTriangles(Func<Int32, Boolean>, Boolean)
Declaration
public bool RemoveTriangles(Func<int, bool> selectorF, bool bRemoveIsolatedVerts)
Parameters
Returns
RemoveUnusedVertices()
Remove any unused vertices in mesh, ie vertices with no edges.
Returns number of removed vertices.
Declaration
public int RemoveUnusedVertices()
Returns
RemoveUnusedVertices(DMesh3)
Declaration
public static int RemoveUnusedVertices(DMesh3 mesh)
Parameters
Type |
Name |
Description |
DMesh3 |
mesh |
|
Returns
ReverseTriangles(IEnumerable<Int32>, Boolean)
Reverse face orientation on a subset of triangles
Declaration
public void ReverseTriangles(IEnumerable<int> triangles, bool bFlipVtxNormals = true)
Parameters
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
Returns
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
Returns
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
Returns
StitchUnorderedEdges(List<Index2i>, Int32, Boolean)
Declaration
public virtual int[] StitchUnorderedEdges(List<Index2i> EdgePairs, int group_id = -1, bool bAbortOnFailure = true)
Parameters
Returns
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
Returns
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
Returns