public class PwCleanMesh extends PjWorkshop
Identification of vertices incorporated into loader manager jv.loader.PgLoader. Therefore functionality to identify vertices moved from jvx.geom.PwCleanMesh to jv.geom.PuCleanMesh.
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
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
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.
|
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 orer.
|
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 PgElementSet |
extractElements(PgElementSet geom,
PbVector markedElements)
Extract a set of elements from an element set.
|
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) |
static void |
flipOrientationSelectedElements(PgElementSet geom) |
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.
|
void |
reset()
Reset the geometry.
|
static void |
rotateStar(PgElementSet elementSet,
int index,
int elIndex) |
static void |
rotateStarsSelectedVertices(PgElementSet elementSet) |
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_slow(PgElementSet geom)
Split a surface into a set of connectivity components.
|
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.
|
cancel, close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, openDialog, removeGeometry, setDisplays, setModal, setMode, setStandalone, setViewer
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFather, setParent
public PwCleanMesh(java.lang.String name)
name
- Name of the workshop.public PwCleanMesh(java.lang.String name, PgElementSet geom)
name
- Name of the workshop.geom
- Geometry to work on.public void init()
init
in class PjWorkshop
public void setGeometry(PgGeometry geom)
setGeometry
in interface PjWorkshopIf
setGeometry
in class PjWorkshop
geom
- the workshop modifies this geometry.public void setDisplay(PvDisplayIf display)
setDisplay
in interface PjWorkshopIf
setDisplay
in class PjWorkshop
public void reset()
reset
in class PjWorkshop
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PjWorkshop
event
- sender of this update.PsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public java.lang.String getName()
getName
in interface PsUpdateIf
getName
in class PsObject
public void start()
public static void cleanMesh(PgElementSet geom, boolean identifyVertices, boolean triangulate, boolean removeDegeneratedElements, boolean removeDuplicateElements, boolean removeUnusedVertices, boolean makeManifold, boolean removeOverlaps)
public static int markFlatEdges(PgElementSet geom, double eps)
public static int identifyFlatEdges(PgElementSet geom, double eps)
public static int identifyFlatRegions(PgElementSet geom, double eps)
public static int markFlatRegions(PgElementSet geom, double eps)
public static int identifyVertices(PgPointSet geom, double eps)
geom
- Geometry whose vertices shall be identifiedeps
- tolerance of coordinate components, not distancepublic void markVertices(double eps)
public static void markVertices(PgPointSet geom, double eps)
public void removeMarks()
public static void removeMarks(PgGeometry geom)
public static void removeDegenerateElements(PgElementSet geom)
public static boolean isDegenerated(PgElementSet geom)
PuMath
public static void collapseEdges(PgElementSet geom, double eps)
eps
- All edges with length smaller than eps are collapsed.public static int[] identifyEqualElements(PgElementSet geom)
public static void orientate(PgElementSet geom)
public static boolean makeOrientation(PgElementSet geom)
true
, if surface could be successfully orientedpublic static boolean isOrientatable(PgElementSet geom)
true
, if surface is orientable.public static int getNumComponents(PgElementSet geom)
public static int computeConnectivityComponents(PgElementSet geom, PiVector compInd)
compInd
- Filled with component index for each element, may be null.public static PgElementSet splitBySelection(PgElementSet geom)
public static PgElementSet[] splitIntoComponents(PgElementSet geom)
public static PgElementSet[] splitIntoComponents_slow(PgElementSet geom)
public static PgElementSet extractElements(PgElementSet geom, PbVector markedElements)
geom
- Given element set.markedElements
- For each element, entry is true if the element should be extracted.public static void joinPolygons(PgPolygonSet polygonSet)
public static int getNumNonManifoldVertices(PgElementSet geom)
public static void makeManifold(PgElementSet geom)
public static PiVector splitNonManifoldVertices(PgElementSet geom)
public void markBoundaryEndPoints()
public static void markBoundaryEndPoints(PgElementSet geom)
public void markCornerVertices(double angle)
public static void markCornerVertices(PgElementSet geom, double angle)
public static boolean hasPlanarElements(PgElementSet geom, double eps)
public static PgPolygonSet getParameterLines(PgElementSet geom)
public static void refineParameterLines(PgElementSet geom, int grade)
public static void cutAlongPolygonSet(PgElementSet geom, PgPolygonSet polygonSet)
HACK: Method expects the polygonSet indices to be the indices of elementSet vertices...
public static void closeHoles(PgElementSet geom)
public static int getNumNonManifoldEdges(PgElementSet geom)
public static void removeNonManifoldEdges(PgElementSet geom)
public static int removeNeighbourhoodDegenerations(PgElementSet geom)
public static int getNumNeighbourhoodDegenerations(PgElementSet geom)
public static void splitElementsByVertexSelection(PgElementSet geom)
public static void splitElement(PgElementSet geom, int elIndex, int locInd0, int locInd1)
public static void splitElement(PgElementSet geom, int elIndex, int locInd0, int locInd1, boolean splitNeighbours)
splitNeighbours
- If true, the neighbour information between the new elements will be destroyed.public static void centralSplitSelectedElements(PgElementSet geom)
public static void centralSplit(PgElementSet geom, int elIndex)
public static boolean checkManifold(PgElementSet geom, boolean bMessage)
geom
- Geometry.bMessage
- Flag to send messages to the JavaView console.public static boolean removeHangingNodes(PgElementSet geom)
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.
public static boolean removeHangingNodes(PgElementSet geom, double maxAngle, boolean splitElements)
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.
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.public static void collapseEdgesBetweenSelectedElements(PgElementSet geom)
public static int collapseEdge(PgElementSet geom, int elementIndex, int localIndex)
geom
- The PgElementSet.elementIndex
- Index of element containing the edge to be collapsed.localIndex
- Local index in the element (numbered as in neighbour).public static void computeElementNormal(PgElementSet geom, int elementIndex)
public static PdVector computeElementNormal(PdVector[] vertex)
public static void splitCurvedPolygons(PgPolygonSet polySet, double threshold)
public static void flipEdgesBetweenSelectedElements(PgElementSet geom)
public static void flipEdge(PgElementSet geom, int elementIndex, int localIndex)
public static void mergeSelectedElements(PgElementSet geom)
public static void joinElements(PgElementSet elementSet, int index, int localIndex)
public static void flipOrientationSelectedElements(PgElementSet geom)
public static void flipOrientationOfElement(PgElementSet geom, int index)
public static void rotateStarsSelectedVertices(PgElementSet elementSet)
public static void rotateStar(PgElementSet elementSet, int index, int elIndex)
public static void removeSelectedVerticesAndFill(PgElementSet elementSet)
elementSet
- The geometry to be modified.public static void removeVertexAndFill(PgElementSet elementSet, int index, int elIndex)
elementSet
- The geometry to be modified.index
- Index of the vertex to be removedelIndex
- Index of an adjacent element, may be -1.public static void identifyMarkedVertices(PgElementSet elementSet)
public static void scrambleElements(PgElementSet elementSet)
public static void removeSmallAngles(PgElementSet geom, double eps, boolean bRemove)
PI
,
collapse edges opposite of angles close to 0.geom
- Triangulated geometry.eps
- Treshold in radians.bRemove
- Flag whether or not to remove elements/vertices marked as PsObject.IS_DELETED
."