Class MxPolygonCellExtract
- java.lang.Object
- 
- com.openinventor.meshvizxlm.extractors.cell.MxPolygonCellExtract
 
- 
 public class MxPolygonCellExtract extends java.lang.ObjectUtility class for polygon cells.Utility class that provides a static implementation of the MiSurfaceCellinterface methods for a polygon cell. This class is provided to make it easier to create a class that implements theMiSurfaceCellinterface for a polygon cell.Localization test 
 SeeisPointInsideCell(MiGeometryI, MiSurfaceCell, double[], double[])
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static doublegetArea(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)Computes the area of all planar or almost-planar irregular polygon (convex and concave).static doublegetLongestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)Gets the longest edge of a polygon cell.static SbVec3dgetNormal(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)Computes the average normal to the given planar or almost-planar polygon cell.static doublegetShortestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)Gets the shortest edge of a polygon cell.static booleanisPointInsideCell(MiGeometryI meshGeometry, MiSurfaceCell polygonCell, double[] point, double[] weights)Checks if a point is inside the given polygon cell.
 
- 
- 
- 
Method Detail- 
getNormalpublic static SbVec3d getNormal(MiGeometryI meshGeometry, MiSurfaceCell polygonCell) Computes the average normal to the given planar or almost-planar polygon cell.This is done by using Newell's method. - Parameters:
- meshGeometry- The geometry of the mesh.
- polygonCell- The input cell.
 
 - 
isPointInsideCellpublic static boolean isPointInsideCell(MiGeometryI meshGeometry, MiSurfaceCell polygonCell, double[] point, double[] weights) Checks if a point is inside the given polygon cell.Note: Each node coordinate of the given cell is retrieved in the following way: 
 for each i with 0 <= i < polygonCell.getNumNodes() nodeIndex = polygonCell.getNodeIndex(i) meshGeometry.getX(nodeIndex) meshGeometry.getY(nodeIndex) meshGeometry.getZ(nodeIndex)- Parameters:
- meshGeometry- The geometry of the mesh.
- polygonCell- The input cell.
- point- The input point given in the same space coordinate as- meshGeometry.
- weights- The array into which the weight values are to be stored.This method computes the N values weights[0,N-1], where- N=polygonCell.getNumNodes(). It assumes the weights array has been already allocated. Its size must be set to N (at least) before calling this method.
 
 - 
getLongestEdgeLengthpublic static double getLongestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell) Gets the longest edge of a polygon cell.- Parameters:
- meshGeometry- The geometry of the mesh.
- polygonCell- The input cell.
- Returns:
- the longest edge
 
 - 
getShortestEdgeLengthpublic static double getShortestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell) Gets the shortest edge of a polygon cell.- Parameters:
- meshGeometry- The geometry of the mesh.
- polygonCell- The input cell.
- Returns:
- the shortest edge
 
 - 
getAreapublic static double getArea(MiGeometryI meshGeometry, MiSurfaceCell polygonCell) Computes the area of all planar or almost-planar irregular polygon (convex and concave).- Parameters:
- meshGeometry- The geometry of the mesh.
- polygonCell- The input cell.
- Returns:
- the area
 
 
- 
 
-