Class MxPolyhedronCellExtract
java.lang.Object
com.openinventor.meshvizxlm.extractors.cell.MxPolyhedronCellExtract
Utility class for polyhedron cells.
Utility class that provides a static implementation of the
MiVolumeCell
methods for a polyhedron cell. This class is provided to
make easier the creation of a class that implements the MiVolumeCell
interface for a polyhedron cell.
Localization test
See isPointInsideCell(MiGeometryI, MiVolumeCell, double[], double[])
This implementation assumes that a polyhedron is defined as a set of oriented polygons such that their normal is pointing to the inside ( each facet vertices are ordered in an counter-clockwise direction looking from the inside).
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getLongestDistance
(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell) Gets the longest distance inside the given polyhedron cell.static double
getShortestEdgeLength
(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell) Gets the shortest distance inside the given polyhedron cell.static boolean
isPointInsideCell
(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell, double[] point, double[] weights) Checks if a point is inside the given polyhedron cell.
-
Method Details
-
getLongestDistance
Gets the longest distance inside the given polyhedron cell.- Parameters:
meshGeometry
- The geometry of the mesh.polyhedronCell
- The input cell.- Returns:
- the longest distance
-
getShortestEdgeLength
Gets the shortest distance inside the given polyhedron cell.- Parameters:
meshGeometry
- The geometry of the mesh.polyhedronCell
- The input cell.- Returns:
- the shortest distance
-
isPointInsideCell
public static boolean isPointInsideCell(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell, double[] point, double[] weights) Checks if a point is inside the given polyhedron cell. All weights must be positive. This static method helps to implement the methodMiCell.isPointInsideCell(MiGeometryI, double[], double[])
for a polyhedron cell.Note: Each node coordinate of the given cell is retrieved in the following way:
for each i with 0 <= i < polyhedronCell.getNumNodes() nodeIndex = polyhedronCell.getNodeIndex(i) meshGeometry.getX(nodeIndex) meshGeometry.getY(nodeIndex) meshGeometry.getZ(nodeIndex)
- Parameters:
meshGeometry
- The geometry of the mesh.polyhedronCell
- The input cell.point
- The input point given in the same space coordinate asmeshGeometry
.weights
- The array into which the weight values are to be stored.This method computes the N values weights[0,N-1], whereN=polygonCell.getNumNodes()
. It assumes the weights array has been already allocated. Its size must be set to N (at least) before calling this method.
-