jvx.geom

## Class PwCleanMesh

- java.lang.Object
- - jv.object.PsObject
  - - jvx.project.PjWorkshop
    - - jvx.geom.PwCleanMesh

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf

      public class PwCleanMesh
      extends PjWorkshop

  Utility programs for cleaning and correcting a polyhedral mesh. Contains static functions to operate on a PgElementSet.

  Identification of vertices incorporated into loader manager jv.loader.PgLoader. Therefore functionality to identify vertices moved from jvx.geom.PwCleanMesh to jv.geom.PuCleanMesh.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class jv.object.PsObject

      `HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS`

    - ### Fields inherited from interface jv.project.PjWorkshopIf

      `MODE_BUG, MODE_STANDARD, MODE_VALIDATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PwCleanMesh(java.lang.String name)` Construct a new PwCleanMesh.
    `PwCleanMesh(java.lang.String name, PgElementSet geom)` Construct a new PwCleanMesh from a given geometry.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `centralSplit(PgElementSet geom, int elIndex)` Split a single element of a PgElementSet into triangles by inserting a center vertex.
    `static void` | `centralSplitSelectedElements(PgElementSet geom)` Split all selected elements by inserting center vertices.
    `static boolean` | `checkManifold(PgElementSet geom, boolean bMessage)` Check if a given element set is a 2D manifold.
    `static void` | `cleanMesh(PgElementSet geom, boolean identifyVertices, boolean triangulate, boolean removeDegeneratedElements, boolean removeDuplicateElements, boolean removeUnusedVertices, boolean makeManifold, boolean removeOverlaps)` Cleans a given element set.
    `static void` | `closeHoles(PgElementSet geom)` Close all holes in a geometry by the triangles that are generated by the triangulation of boundary polygons.
    `static int` | `collapseEdge(PgElementSet geom, int elementIndex, int localIndex)` Collapse a single edge in a PgElementSet.
    `static void` | `collapseEdges(PgElementSet geom, double eps)` Collapse all edges which are shorter than PuMath.EPS.
    `static void` | `collapseEdgesBetweenSelectedElements(PgElementSet geom)` Collapse edges between pairs of selected elements - elements will be unselected, so no element will be collapsed at more than one edge.
    `static int` | `computeConnectivityComponents(PgElementSet geom, PiVector compInd)` Compute the connectivity components of a surface.
    `static PdVector` | `computeElementNormal(PdVector[] vertex)` Compute normal of an element, given by its vertices in cyclic order.
    `static void` | `computeElementNormal(PgElementSet geom, int elementIndex)` Compute an element normal anew.
    `static void` | `cutAlongPolygonSet(PgElementSet geom, PgPolygonSet polygonSet)` Cut a surface along polygons consisting of element edges, duplicate all vertices along this polygons, and set the polygons as additional boundary polygons.
    `static void` | `flipEdge(PgElementSet geom, int elementIndex, int localIndex)` Flip a single edge of a PgElementSet.
    `static void` | `flipEdgesBetweenSelectedElements(PgElementSet geom)` Flip edges between pairs of selected elements - elements will be unselected, so no element will be flipped at more than one edge.
    `static void` | `flipOrientationOfElement(PgElementSet geom, int index)` Flip orientation of a single element.
    `static void` | `flipOrientationSelectedElements(PgElementSet geom)` Flip orientation of all elements tagged by PsObject.IS_SELECTED.
    `java.lang.String` | `getName()` Get the name of the workshop.
    `static int` | `getNumComponents(PgElementSet geom)` Get number of connectivity components.
    `static int` | `getNumNeighbourhoodDegenerations(PgElementSet geom)` Count pairs of elements, which have common vertices, which are not connected by a common edge.
    `static int` | `getNumNonManifoldEdges(PgElementSet geom)` Count non-manifold edges contained in the geometry.
    `static int` | `getNumNonManifoldVertices(PgElementSet geom)` Count vertices with more than one coherent link of adjacent elements.
    `static PgPolygonSet` | `getParameterLines(PgElementSet geom)` Deprecated. method is moved to PwParameterLines.
    `static boolean` | `hasPlanarElements(PgElementSet geom, double eps)` Test if faces of geometry are planar.
    `static int[]` | `identifyEqualElements(PgElementSet geom)` Identify and remove (combinatorially) equal elements.
    `static int` | `identifyFlatEdges(PgElementSet geom, double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.identifyFlatEdges(PgElementSet, double) instead.
    `static int` | `identifyFlatRegions(PgElementSet geom, double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.identifyFlatRegions(PgElementSet, double) instead.
    `static void` | `identifyMarkedVertices(PgElementSet elementSet)` Identify Selected Vertices, the position of the new vertex will be averaged from the identified vertices.
    `static int` | `identifyVertices(PgPointSet geom, double eps)` Deprecated. starting with JavaView 2.99.018 this functionality is provided by jv.geom.PuCleanMesh#identifiyVertices(PgPointSet, double).
    `void` | `init()` Initializes the workshop.
    `static boolean` | `isDegenerated(PgElementSet geom)` Checks whether edges of elements have length smaller than PuMath.EPS.
    `static boolean` | `isOrientatable(PgElementSet geom)` Check orientability of PgElementSet.
    `static void` | `joinElements(PgElementSet elementSet, int index, int localIndex)` Join two elements.
    `static void` | `joinPolygons(PgPolygonSet polygonSet)` Join polygons of a polygon set to new polygons.
    `static void` | `makeManifold(PgElementSet geom)` Adapts the given input surface to be manifold, i.e. the stars of all vertices become topological disks.
    `static boolean` | `makeOrientation(PgElementSet geom)` Try to generate a consistent orientation all elements of the PgElementSet according to the orientation of all their neighbour elements.
    `void` | `markBoundaryEndPoints()` Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED.
    `static void` | `markBoundaryEndPoints(PgElementSet geom)` Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED.
    `void` | `markCornerVertices(double angle)` Search in a PgElementSet for boundary vertices with surface angle less than a threshold value (in degrees) and mark those with the tag PsObject.IS_SELECTED.
    `static void` | `markCornerVertices(PgElementSet geom, double angle)` Search in a PgElementSet for boundary vertices with surface angle less than a threshold value (in degrees) and mark those with the tag PsObject.IS_SELECTED.
    `static int` | `markFlatEdges(PgElementSet geom, double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.markFlatEdges(PgElementSet, double) instead.
    `static int` | `markFlatRegions(PgElementSet geom, double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.markFlatRegions(PgElementSet, double) instead.
    `void` | `markVertices(double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.markVertices(double) instead.
    `static void` | `markVertices(PgPointSet geom, double eps)` Deprecated. since JavaView 3.99.003, use PwIdentify.markVertices(PgPointSet, double) instead.
    `static void` | `mergeSelectedElements(PgElementSet geom)` Merge pairs of neighbouring selected elements.
    `static void` | `orientate(PgElementSet geom)` Deprecated. JavaView 3.97.051, use makeOrientation(PgElementSet) instead.
    `static void` | `refineParameterLines(PgElementSet geom, int grade)` Deprecated. method is moved to PwParameterLines.
    `static void` | `removeDegenerateElements(PgElementSet geom)` Deprecated. starting with JavaView 2.99.018 this functionality is provided by jv.geom.PuCleanMesh#removeDegenerateElements(PgElementSet).
    `static boolean` | `removeHangingNodes(PgElementSet geom)` Remove hanging nodes: Find adjacent boundary edges with opposite direction and insert the not common end point of the shorter edge upon the longer edge, split the resp. face.
    `static boolean` | `removeHangingNodes(PgElementSet geom, double maxAngle, boolean splitElements)` Remove hanging nodes: Find adjacent boundary edges with opposite direction and insert the not common end point of the shorter edge upon the longer edge, split the resp. face.
    `void` | `removeMarks()` Deprecated. since JavaView 3.99.003, use PwIdentify.removeMarks() instead.
    `static void` | `removeMarks(PgGeometry geom)` Deprecated. since JavaView 3.99.003, use PwIdentify.removeMarks(PgGeometry) instead.
    `static int` | `removeNeighbourhoodDegenerations(PgElementSet geom)` Detect pairs of elements, which have common vertices, which are not connected by a common edge.
    `static void` | `removeNonManifoldEdges(PgElementSet geom)` Remove non-manifold edges from the geometry.
    `static void` | `removeSelectedVerticesAndFill(PgElementSet elementSet)` Remove all selected vertices and fill the holes by new elements given by the neighbouring vertices.
    `static void` | `removeSmallAngles(PgElementSet geom, double eps, boolean bRemove)` Clean mesh from small angles i.e. flip edges opposite to angles close to `PI`, collapse edges opposite of angles close to 0.
    `static void` | `removeVertexAndFill(PgElementSet elementSet, int index, int elIndex)` Remove a vertex and fill the hole by a new element given by all neighbouring vertices.
    `static void` | `resamplePolygon(PgPolygon polygon, int numSamples)` Uniformly resample a PgPolygon.
    `void` | `reset()` Reset the geometry.
    `static void` | `rotateStar(PgElementSet elementSet, int index, int elIndex)` Rotate a vertex star - each edge connecting the center vertex to a vertex in the link will be moved to the next vertex in the vertex star's boundary.
    `static void` | `rotateStarsSelectedVertices(PgElementSet elementSet)` Rotate Vertex stars of all vertices tagged by PsObject.IS_SELECTED.
    `static void` | `scrambleElements(PgElementSet elementSet)` Change the internal order of indices of the vertices in all triangles by random to get arbitrary examples for testing the algorithm.
    `void` | `setDisplay(PvDisplayIf display)` Set the active display when this workshop was launched.
    `void` | `setGeometry(PgGeometry geom)` Set the geometry.
    `static PgElementSet` | `splitBySelection(PgElementSet geom)` Split a surface into selected and not selected part.
    `static void` | `splitCurvedPolygons(PgPolygonSet polySet, double threshold)` Split polygons, until all polygons satisfy a straghtness criterion: All interiour vertices are sorted by their distance to the straight line between start and end point.
    `static void` | `splitElement(PgElementSet geom, int elIndex, int locInd0, int locInd1)` Split a single element of a PgElementSet into two elements.
    `static void` | `splitElement(PgElementSet geom, int elIndex, int locInd0, int locInd1, boolean splitNeighbours)` Split a single element of a PgElementSet into two elements.
    `static void` | `splitElementsByVertexSelection(PgElementSet geom)` Split elements by inserting edges between selected vertices.
    `static PgElementSet[]` | `splitIntoComponents(PgElementSet geom)` Split a surface into a set of connectivity components.
    `static PiVector` | `splitNonManifoldVertices(PgElementSet geom)` Search for vertices with more than one coherent link of adjacent elements and disconnect those to good discrete manifold vertices, each belonging to one of the element links.
    `void` | `start()` Start mesh cleaning.
    `boolean` | `update(java.lang.Object event)` Update the class whenever a child has changed.

    - ### Methods inherited from class jvx.project.PjWorkshop

      `cancel, close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, setDisplays, setModal, setMode, setStandalone, setViewer`

    - ### Methods inherited from class jv.object.PsObject

      `addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jv.object.PsUpdateIf

      `getFather, setParent`

- - ### Constructor Detail

    - #### PwCleanMesh

          public PwCleanMesh(java.lang.String name)

      Construct a new PwCleanMesh.
      Parameters:
        `name` - Name of the workshop.

    - #### PwCleanMesh

          public PwCleanMesh(java.lang.String name,
                     PgElementSet geom)

      Construct a new PwCleanMesh from a given geometry.
      Parameters:
        `name` - Name of the workshop.
        `geom` - Geometry to work on.

  - ### Method Detail

    - #### init

          public void init()

      Initializes the workshop.
      Overrides:
        `init` in class `PjWorkshop`

    - #### setGeometry

          public void setGeometry(PgGeometry geom)

      Set the geometry.
      Specified by:
        `setGeometry` in interface `PjWorkshopIf`
      Overrides:
        `setGeometry` in class `PjWorkshop`
      Parameters:
        `geom` - the workshop modifies this geometry.

    - #### setDisplay

          public void setDisplay(PvDisplayIf display)

      Set the active display when this workshop was launched.
      Specified by:
        `setDisplay` in interface `PjWorkshopIf`
      Overrides:
        `setDisplay` in class `PjWorkshop`

    - #### reset

          public void reset()

      Reset the geometry. This method will copy the original surface back.
      Overrides:
        `reset` in class `PjWorkshop`

    - #### update

          public boolean update(java.lang.Object event)

      Update the class whenever a child has changed. Method is usually invoked from the children.
      Specified by:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PjWorkshop`
      Parameters:
        `event` - sender of this update.
      Returns:
        true if update was correctly handled by superclass.
      See Also:
        `PsObject.setParent(PsUpdateIf)`, `PsObject.getFather()`, `PsObject.addUpdateListener(PsUpdateIf)`

    - #### getName

          public java.lang.String getName()

      Get the name of the workshop.
      Specified by:
        `getName` in interface `PsUpdateIf`
      Overrides:
        `getName` in class `PsObject`

    - #### start

          public void start()

      Start mesh cleaning.

    - #### cleanMesh

          public static void cleanMesh(PgElementSet geom,
                       boolean identifyVertices,
                       boolean triangulate,
                       boolean removeDegeneratedElements,
                       boolean removeDuplicateElements,
                       boolean removeUnusedVertices,
                       boolean makeManifold,
                       boolean removeOverlaps)

      Cleans a given element set.

    - #### markFlatEdges

          public static int markFlatEdges(PgElementSet geom,
                          double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.markFlatEdges(PgElementSet, double) instead.

    - #### identifyFlatEdges

          public static int identifyFlatEdges(PgElementSet geom,
                              double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.identifyFlatEdges(PgElementSet, double) instead.

    - #### identifyFlatRegions

          public static int identifyFlatRegions(PgElementSet geom,
                                double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.identifyFlatRegions(PgElementSet, double) instead.

    - #### markFlatRegions

          public static int markFlatRegions(PgElementSet geom,
                            double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.markFlatRegions(PgElementSet, double) instead.

    - #### identifyVertices

          public static int identifyVertices(PgPointSet geom,
                             double eps)

      Deprecated. starting with JavaView 2.99.018 this functionality is provided by jv.geom.PuCleanMesh#identifiyVertices(PgPointSet, double).
      Identify vertices which are identical, or within an epsilon box of each other. Vertices are first sorted along the diagonal of the bounding box to accelerate the comparison.
      Parameters:
        `geom` - Geometry whose vertices shall be identified
        `eps` - tolerance of coordinate components, not distance
      Returns:
        number of removed vertices

    - #### markVertices

          public void markVertices(double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.markVertices(double) instead.

    - #### markVertices

          public static void markVertices(PgPointSet geom,
                          double eps)

      Deprecated. since JavaView 3.99.003, use PwIdentify.markVertices(PgPointSet, double) instead.

    - #### removeMarks

          public void removeMarks()

      Deprecated. since JavaView 3.99.003, use PwIdentify.removeMarks() instead.

    - #### removeMarks

          public static void removeMarks(PgGeometry geom)

      Deprecated. since JavaView 3.99.003, use PwIdentify.removeMarks(PgGeometry) instead.

    - #### removeDegenerateElements

          public static void removeDegenerateElements(PgElementSet geom)

      Deprecated. starting with JavaView 2.99.018 this functionality is provided by jv.geom.PuCleanMesh#removeDegenerateElements(PgElementSet).
      Adapt triangulation to the following conventions: - the vertices of an element must be pairwise different. - every element has at least three vertices.

    - #### isDegenerated

          public static boolean isDegenerated(PgElementSet geom)

      Checks whether edges of elements have length smaller than PuMath.EPS.
      See Also:
        `PuMath`

    - #### collapseEdges

          public static void collapseEdges(PgElementSet geom,
                           double eps)

      Collapse all edges which are shorter than PuMath.EPS. Occurrence of second vertex of a collapsed edge is replaced with first vertex in the vertex star of the second vertex.
      Parameters:
        `eps` - All edges with length smaller than eps are collapsed.

    - #### identifyEqualElements

          public static int[] identifyEqualElements(PgElementSet geom)

      Identify and remove (combinatorially) equal elements. Two elements are identical if they refer the same vertex indices.
      Returns:
        Array with indices of new positions of all previously existing elements

    - #### orientate

          public static void orientate(PgElementSet geom)

      Deprecated. JavaView 3.97.051, use makeOrientation(PgElementSet) instead.
      Try to orient all elements of the PgElementSet according to the orientation of all their neighbour elements. This will obviously lead to a success only for orientable surfaces.

    - #### makeOrientation

          public static boolean makeOrientation(PgElementSet geom)

      Try to generate a consistent orientation all elements of the PgElementSet according to the orientation of all their neighbour elements. This will obviously lead to a success only for orientable surfaces.
      Returns:
        `true`, if surface could be successfully oriented
      Since:
        JavaView 3.97.051, renamed from previous orientate().

    - #### isOrientatable

          public static boolean isOrientatable(PgElementSet geom)

      Check orientability of PgElementSet.
      Returns:
        `true`, if surface is orientable.
      Since:
        JavaView 3.97.052.

    - #### getNumComponents

          public static int getNumComponents(PgElementSet geom)

      Get number of connectivity components.

    - #### computeConnectivityComponents

          public static int computeConnectivityComponents(PgElementSet geom,
                                          PiVector compInd)

      Compute the connectivity components of a surface. Method fills an array with the index of the component for each element of the surface. The elements are indexed with numbers in [0, numComponents-1].
      Parameters:
        `compInd` - Filled with component index for each element, may be null.
      Returns:
        Number of connectivity components

    - #### splitBySelection

          public static PgElementSet splitBySelection(PgElementSet geom)

      Split a surface into selected and not selected part. All selected elements, identified by a tag

           geom.hasTagElement(i, PsObject.IS_SELECTED)

      are removed from the original geometry and added to the new returned geometry.

      Currently, all unused vertices remain in original geometry. The new returned geometry contains only used vertices.

      Returns:
        element set containing all selected elements.

    - #### splitIntoComponents

          public static PgElementSet[] splitIntoComponents(PgElementSet geom)

      Split a surface into a set of connectivity components.
      Returns:
        Array of components as individual element sets.

    - #### joinPolygons

          public static void joinPolygons(PgPolygonSet polygonSet)

      Join polygons of a polygon set to new polygons. The new polygons will not have ending points of other polygons as inner points and inner points will not have the tag PsObject.IS_SELECTED, and at no vertex will be exactly two ends of polygons, except the ends of a closed polygon.

    - #### getNumNonManifoldVertices

          public static int getNumNonManifoldVertices(PgElementSet geom)

      Count vertices with more than one coherent link of adjacent elements. This method requires correct neighbourhood information.

    - #### makeManifold

          public static void makeManifold(PgElementSet geom)

      Adapts the given input surface to be manifold, i.e. the stars of all vertices become topological disks.

      This is the order of actions, in which all degenerations should disappear:
      [1] remove element degenerations:
      - every element will have at least three vertices, the vertices of an element are pairwise distinct. When this is done, element - edge incidences are well defined.
      [2] remove non-manifold edges:
      - every edge is edge of exactly two elements (then it is an interior edge) or of exactly one element (then it is a boundary edge).
      [3] compute neighbourhood.
      - after [1] and [2], all edges of elements are o.k., each edge is incident to one element or to two distinct elements; so the PgElementSet.makeNeighbour() method will produce intact neighbourhood information.
      [4] split non-manifold vertices:
      - each vertex will be contained in exactly one ring-neighbourhood of faces (may be open or closed) or it is an unused vertex. this method needs correct neighbourhood information, since it runs on PgVertexStar.
      [5] remove neighbourhood degenerations:
      - a pair of adjacent elements will have exactly two common vertices (the end points of the unique common edge), other pairs of elements may have at most one common vertex. This method needs correct neighbourhood information, since it also runs on PgVertexStar.

    - #### splitNonManifoldVertices

          public static PiVector splitNonManifoldVertices(PgElementSet geom)

      Search for vertices with more than one coherent link of adjacent elements and disconnect those to good discrete manifold vertices, each belonging to one of the element links. This method requires correct neighbourhood information.
      Returns:
        PiVector containing the index map new vertex index-> old vertex index.

    - #### markBoundaryEndPoints

          public void markBoundaryEndPoints()

      Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED. This is a non-static call for PjWorkshop use.

    - #### markBoundaryEndPoints

          public static void markBoundaryEndPoints(PgElementSet geom)

      Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED.

    - #### markCornerVertices

          public void markCornerVertices(double angle)

      Search in a PgElementSet for boundary vertices with surface angle less than a threshold value (in degrees) and mark those with the tag PsObject.IS_SELECTED. Vertices already marked get not unmarked. This is a non-static call for PjWorkshop use.

    - #### markCornerVertices

          public static void markCornerVertices(PgElementSet geom,
                                double angle)

      Search in a PgElementSet for boundary vertices with surface angle less than a threshold value (in degrees) and mark those with the tag PsObject.IS_SELECTED. Vertices already marked get not unmarked.

    - #### hasPlanarElements

          public static boolean hasPlanarElements(PgElementSet geom,
                                  double eps)

      Test if faces of geometry are planar.

    - #### getParameterLines

          public static PgPolygonSet getParameterLines(PgElementSet geom)

      Deprecated. method is moved to PwParameterLines.
      Get parameter lines of a PgElementSet, extracted from its combinational properties, as a new PgPolygonSet. Existing boundary polygons are used as parameter lines along the boundary; if no boundary polygons exist, all boundary edges are returned as parameter lines of only one single edge.

    - #### refineParameterLines

          public static void refineParameterLines(PgElementSet geom,
                                  int grade)

      Deprecated. method is moved to PwParameterLines.
      Refine the parameter lines of an PgElementSet by DLG refinement. Attention, the PgElementSet will have bad neighbourhood properties afterwards: If an edge gets refined, the adjacent elements will have each other as neighbours more than once.

    - #### cutAlongPolygonSet

          public static void cutAlongPolygonSet(PgElementSet geom,
                                PgPolygonSet polygonSet)

      Cut a surface along polygons consisting of element edges, duplicate all vertices along this polygons, and set the polygons as additional boundary polygons.

      HACK: Method expects the polygonSet indices to be the indices of elementSet vertices...

    - #### closeHoles

          public static void closeHoles(PgElementSet geom)

      Close all holes in a geometry by the triangles that are generated by the triangulation of boundary polygons. Boundary polygons will be deleted, as there are no boundaries any longer.

    - #### getNumNonManifoldEdges

          public static int getNumNonManifoldEdges(PgElementSet geom)

      Count non-manifold edges contained in the geometry.

    - #### removeNonManifoldEdges

          public static void removeNonManifoldEdges(PgElementSet geom)

      Remove non-manifold edges from the geometry. This method will insert new vertices upon non-manifold edges, so these degenerations are removed combinatorially; the geometry will not not be changed.

    - #### removeNeighbourhoodDegenerations

          public static int removeNeighbourhoodDegenerations(PgElementSet geom)

      Detect pairs of elements, which have common vertices, which are not connected by a common edge. Split those elements. Correct neighbourhood information is required, element degenerations shall be removed beforehand, all vertices are supposed to be proper 2-manifold vertices.

    - #### getNumNeighbourhoodDegenerations

          public static int getNumNeighbourhoodDegenerations(PgElementSet geom)

      Count pairs of elements, which have common vertices, which are not connected by a common edge. Correct neighbourhood information is required, element degenerations shall be removed beforehand, all vertices are supposed to be proper 2-manifold vertices.

    - #### splitElementsByVertexSelection

          public static void splitElementsByVertexSelection(PgElementSet geom)

      Split elements by inserting edges between selected vertices.

    - #### splitElement

          public static void splitElement(PgElementSet geom,
                          int elIndex,
                          int locInd0,
                          int locInd1)

      Split a single element of a PgElementSet into two elements.

    - #### splitElement

          public static void splitElement(PgElementSet geom,
                          int elIndex,
                          int locInd0,
                          int locInd1,
                          boolean splitNeighbours)

      Split a single element of a PgElementSet into two elements.
      Parameters:
        `splitNeighbours` - If true, the neighbour information between the new elements will be destroyed.

    - #### centralSplitSelectedElements

          public static void centralSplitSelectedElements(PgElementSet geom)

      Split all selected elements by inserting center vertices.

    - #### centralSplit

          public static void centralSplit(PgElementSet geom,
                          int elIndex)

      Split a single element of a PgElementSet into triangles by inserting a center vertex.

    - #### checkManifold

          public static boolean checkManifold(PgElementSet geom,
                              boolean bMessage)

      Check if a given element set is a 2D manifold.
      Parameters:
        `geom` - Geometry.
        `bMessage` - Flag to send messages to the JavaView console.
      Returns:
        True, if geom is a manifold surface.

    - #### removeHangingNodes

          public static boolean removeHangingNodes(PgElementSet geom)

      Remove hanging nodes: Find adjacent boundary edges with opposite direction and insert the not common end point of the shorter edge upon the longer edge, split the resp. face. Edges of vanishing length are not handled, those may be removed by the identifyVertices method.

      This method will kill all those simple case that consist of a collinear closed three-vertex boundary; if longer collinear closed boundaries are in a geometry, they should disappear with repeated calls of this method.

      Returns:
        true if a hanging node was removed, false if no one was found.

    - #### removeHangingNodes

          public static boolean removeHangingNodes(PgElementSet geom,
                                   double maxAngle,
                                   boolean splitElements)

      Remove hanging nodes: Find adjacent boundary edges with opposite direction and insert the not common end point of the shorter edge upon the longer edge, split the resp. face. Edges of vanishing length are not handled, those may be removed by the identifyVertices method.

      This method will kill all those simple case that consist of a collinear closed three-vertex boundary; if longer collinear closed boundaries are in a geometry, they should disappear with repeated calls of this method.

      Parameters:
        `maxAngle` - Two vectors are assumed to be parallel if the angle between them is smaller than maxAngle (in degrees).
        `splitElements` - Split elements instead of appending an existing element.
      Returns:
        true if a hanging node was removed, false if no one was found.

    - #### collapseEdgesBetweenSelectedElements

          public static void collapseEdgesBetweenSelectedElements(PgElementSet geom)

      Collapse edges between pairs of selected elements - elements will be unselected, so no element will be collapsed at more than one edge.

    - #### collapseEdge

          public static int collapseEdge(PgElementSet geom,
                         int elementIndex,
                         int localIndex)

      Collapse a single edge in a PgElementSet.
      Parameters:
        `geom` - The PgElementSet.
        `elementIndex` - Index of element containing the edge to be collapsed.
        `localIndex` - Local index in the element (numbered as in neighbour).

    - #### computeElementNormal

          public static void computeElementNormal(PgElementSet geom,
                                  int elementIndex)

      Compute an element normal anew.

    - #### computeElementNormal

          public static PdVector computeElementNormal(PdVector[] vertex)

      Compute normal of an element, given by its vertices in cyclic order.

    - #### splitCurvedPolygons

          public static void splitCurvedPolygons(PgPolygonSet polySet,
                                 double threshold)

      Split polygons, until all polygons satisfy a straghtness criterion: All interiour vertices are sorted by their distance to the straight line between start and end point. If the ratio of distance and length of the line between the start and end point is greater than the given threshold parameter, the polygon will be split at the farest vertex.

    - #### flipEdgesBetweenSelectedElements

          public static void flipEdgesBetweenSelectedElements(PgElementSet geom)

      Flip edges between pairs of selected elements - elements will be unselected, so no element will be flipped at more than one edge.

    - #### flipEdge

          public static void flipEdge(PgElementSet geom,
                      int elementIndex,
                      int localIndex)

      Flip a single edge of a PgElementSet.

    - #### mergeSelectedElements

          public static void mergeSelectedElements(PgElementSet geom)

      Merge pairs of neighbouring selected elements.

    - #### joinElements

          public static void joinElements(PgElementSet elementSet,
                          int index,
                          int localIndex)

      Join two elements. The indicated element will be replaced by the joined element, the neighbour element will be tagged as PsObject.IS_DELETED.

    - #### flipOrientationSelectedElements

          public static void flipOrientationSelectedElements(PgElementSet geom)

      Flip orientation of all elements tagged by PsObject.IS_SELECTED.

    - #### flipOrientationOfElement

          public static void flipOrientationOfElement(PgElementSet geom,
                                      int index)

      Flip orientation of a single element.

    - #### rotateStarsSelectedVertices

          public static void rotateStarsSelectedVertices(PgElementSet elementSet)

      Rotate Vertex stars of all vertices tagged by PsObject.IS_SELECTED.
      Parameters:
        `elementSet` - The geometry to be modified.

    - #### rotateStar

          public static void rotateStar(PgElementSet elementSet,
                        int index,
                        int elIndex)

      Rotate a vertex star - each edge connecting the center vertex to a vertex in the link will be moved to the next vertex in the vertex star's boundary. Method does up to now work for closed vertex stars only.
      Parameters:
        `elementSet` - The geometry to be modified.
        `index` - Index of the vertex star to be rotated.
        `elIndex` - Index of an adjacent element, may be -1.

    - #### removeSelectedVerticesAndFill

          public static void removeSelectedVerticesAndFill(PgElementSet elementSet)

      Remove all selected vertices and fill the holes by new elements given by the neighbouring vertices.
      Parameters:
        `elementSet` - The geometry to be modified.

    - #### removeVertexAndFill

          public static void removeVertexAndFill(PgElementSet elementSet,
                                 int index,
                                 int elIndex)

      Remove a vertex and fill the hole by a new element given by all neighbouring vertices.
      Parameters:
        `elementSet` - The geometry to be modified.
        `index` - Index of the vertex to be removed
        `elIndex` - Index of an adjacent element, may be -1.

    - #### identifyMarkedVertices

          public static void identifyMarkedVertices(PgElementSet elementSet)

      Identify Selected Vertices, the position of the new vertex will be averaged from the identified vertices.

    - #### scrambleElements

          public static void scrambleElements(PgElementSet elementSet)

      Change the internal order of indices of the vertices in all triangles by random to get arbitrary examples for testing the algorithm.

    - #### removeSmallAngles

          public static void removeSmallAngles(PgElementSet geom,
                               double eps,
                               boolean bRemove)

      Clean mesh from small angles i.e. flip edges opposite to angles close to `PI`, collapse edges opposite of angles close to 0.
      Parameters:
        `geom` - Triangulated geometry.
        `eps` - Treshold in radians.
        `bRemove` - Flag whether or not to remove elements/vertices marked as `PsObject.IS_DELETED`.

    - #### resamplePolygon

          public static void resamplePolygon(PgPolygon polygon,
                             int numSamples)

      Uniformly resample a PgPolygon.

"

The software JavaView? is copyright protected. All Rights Reserved.
"