JavaView© v3.95.000

jvx.geom
Class PwCleanMesh

java.lang.Object
  extended byjv.object.PsObject
      extended byjvx.project.PjWorkshop
          extended byjvx.geom.PwCleanMesh
All Implemented Interfaces:
java.lang.Cloneable, PjWorkshopIf, PsUpdateIf, java.io.Serializable

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_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
 
Constructor Summary
PwCleanMesh()
          Constructor.
 
Method Summary
 void close()
          Close workshop and remove itself as listener from various classes.
static void closeHoles(PgElementSet geom)
          Close all holes in a geometry by the triangles, that are generated by the triangulation of boundary polygons.
static void collapseEdges(PgElementSet geom, double eps)
          Collapse all edges which are shorter than PuMath.EPS.
static int computeConnectivityComponents(PgElementSet geom, PiVector cc)
          Compute the connectivity components of a surface.
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 int getNumComponents(PgElementSet geom)
          Get number of connectivity components.
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 void identifyEqualElements(PgElementSet geom)
          Identify and remove (combinatorially) equal elements.
static int identifyFlatEdges(PgElementSet geom, double eps)
          Identify pairs of adjacent elements whose dihedral angle is less than a given threshold.
static int identifyFlatRegions(PgElementSet geom, double eps)
          Identify flat vertex stars to a single elements if the discrete Gauss curvature is less or equal than a given threshold.
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).
static boolean isDegenerated(PgElementSet geom)
          Checks whether edges of elements have length smaller than PuMath.EPS.
static void joinPolygons(PgPolygonSet polygonSet)
          Join polygons of a polygon set to new polygons.
static void makeManifold(PgElementSet geom)
          Search for vertices with more than one coherent link of neighboured elements and disjoin those to good discrete manifold vertices, each belonging to one of the element links.
static void markBoundaryEndPoints(PgElementSet geom)
          Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED.
static int markFlatEdges(PgElementSet geom, double eps)
          Mark pairs of adjacent elements whose dihedral angle is less than a given threshold.
static int markFlatRegions(PgElementSet geom, double eps)
          Mark flat regions by identifying adjacent elements whose dihedral angle is less or equal than a given threshold.
static void markVertices(PgPointSet geom, double eps)
          Mark vertices which are identical, or within an epsilon box of each other.
 void ok()
          Accept the current state of the geometry and close the workshop.
static void orientate(PgElementSet geom)
          Try to orientate all elements of the PgElementSet according to the orientation of all their neighbour elements.
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 void removeMarks(PgGeometry geom)
          Remove tag IS_SELECTED from all vertices and elements in geometry.
 void reset()
          Reset this workshop to its initial state from which computations can start.
static PgElementSet[] splitIntoComponents(PgElementSet geom)
          Split a surface into a set of connectivity components.
 
Methods inherited from class jvx.project.PjWorkshop
cancel, getDisplay, getDisplays, getGeometry, getSavedGeometry, getViewer, init, isModal, removeGeometry, setDisplay, setDisplays, setGeometry, setModal, setViewer, update
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, 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, getName, setParent
 

Constructor Detail

PwCleanMesh

public PwCleanMesh()
Constructor.

Method Detail

reset

public void reset()
Reset this workshop to its initial state from which computations can start.

Overrides:
reset in class PjWorkshop

close

public void close()
Close workshop and remove itself as listener from various classes. The workshop will no longer be functional after this call.

Overrides:
close in class PjWorkshop

ok

public void ok()
Accept the current state of the geometry and close the workshop.

Overrides:
ok in class PjWorkshop

markFlatEdges

public static int markFlatEdges(PgElementSet geom,
                                double eps)
Mark pairs of adjacent elements whose dihedral angle is less than a given threshold. Identification at long edges is preferred since presumable for triangles they are diagonals in a quadrilateral.

Parameters:
geom - geometry whose elements shall be identified
eps - threshold in [0, 180]
Returns:
number of removed elements

identifyFlatEdges

public static int identifyFlatEdges(PgElementSet geom,
                                    double eps)
Identify pairs of adjacent elements whose dihedral angle is less than a given threshold. Identification at long edges is preferred since presumable for triangles they are diagonals in a quadrilateral.

Parameters:
geom - geometry whose elements shall be identified
eps - threshold in [0, 180]
Returns:
number of removed elements

identifyFlatRegions

public static int identifyFlatRegions(PgElementSet geom,
                                      double eps)
Identify flat vertex stars to a single elements if the discrete Gauss curvature is less or equal than a given threshold.

Parameters:
geom - Geometry whose vertices shall be identified
eps - threshold in [0, 180]
Returns:
number of removed elements

markFlatRegions

public static int markFlatRegions(PgElementSet geom,
                                  double eps)
Mark flat regions by identifying adjacent elements whose dihedral angle is less or equal than a given threshold.

Parameters:
geom - Geometry whose vertices shall be identified
eps - threshold in [0, 180]
Returns:
number of removed elements

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 static void markVertices(PgPointSet geom,
                                double eps)
Mark vertices which are identical, or within an epsilon box of each other.

Parameters:
geom - Geometry whose vertices shall be marked
eps - tolerance of coordinate components, not distance

removeMarks

public static void removeMarks(PgGeometry geom)
Remove tag IS_SELECTED from all vertices and elements in geometry.


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. Occurance 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 void identifyEqualElements(PgElementSet geom)
Identify and remove (combinatorially) equal elements. Two elements are identical if they refer the same vertex indices.


orientate

public static void orientate(PgElementSet geom)
Try to orientate 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.


getNumComponents

public static int getNumComponents(PgElementSet geom)
Get number of connectivity components.


computeConnectivityComponents

public static int computeConnectivityComponents(PgElementSet geom,
                                                PiVector cc)
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:
cc - To be filled array containing the component index for each element
Returns:
Number of connectivity components

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.


makeManifold

public static void makeManifold(PgElementSet geom)
Search for vertices with more than one coherent link of neighboured elements and disjoin those to good discrete manifold vertices, each belonging to one of the element links. This method requires correct neighbourhood information.


markBoundaryEndPoints

public static void markBoundaryEndPoints(PgElementSet geom)
Mark all start and end vertices of a PgElementSets boundary Polygons with the tag PsObject.IS_SELECTED.


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 bondary 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.


JavaView© v3.95.000

The software JavaView© is copyright protected. All Rights Reserved.