Class MxPolyhedronCellExtract
- java.lang.Object
-
- com.openinventor.meshvizxlm.extractors.cell.MxPolyhedronCellExtract
-
public class MxPolyhedronCellExtract extends java.lang.ObjectUtility class for polyhedron cells.Utility class that provides a static implementation of the
MiVolumeCellmethods for a polyhedron cell. This class is provided to make easier the creation of a class that implements theMiVolumeCellinterface for a polyhedron cell.Localization test
SeeisPointInsideCell(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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublegetLongestDistance(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell)Gets the longest distance inside the given polyhedron cell.static doublegetShortestEdgeLength(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell)Gets the shortest distance inside the given polyhedron cell.static booleanisPointInsideCell(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell, double[] point, double[] weights)Checks if a point is inside the given polyhedron cell.
-
-
-
Method Detail
-
getLongestDistance
public static double getLongestDistance(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell)
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
public static double getShortestEdgeLength(MiGeometryI meshGeometry, MiVolumeCell polyhedronCell)
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.
-
-