public class MxPolygonCellExtract
extends java.lang.Object
Utility class that provides a static implementation of the
MiSurfaceCell
interface methods for a polygon cell. This class is
provided to make it easier to create a class that implements the
MiSurfaceCell
interface for a polygon cell.
Localization test
See
isPointInsideCell(MiGeometryI, MiSurfaceCell, double[], double[])
Modifier and Type | Method and Description |
---|---|
static double |
getArea(MiGeometryI meshGeometry,
MiSurfaceCell polygonCell)
Computes the area of all planar or almost-planar irregular polygon (convex
and concave).
|
static double |
getLongestEdgeLength(MiGeometryI meshGeometry,
MiSurfaceCell polygonCell)
Gets the longest edge of a polygon cell.
|
static SbVec3d |
getNormal(MiGeometryI meshGeometry,
MiSurfaceCell polygonCell)
Computes the average normal to the given planar or almost-planar polygon
cell.
|
static double |
getShortestEdgeLength(MiGeometryI meshGeometry,
MiSurfaceCell polygonCell)
Gets the shortest edge of a polygon cell.
|
static boolean |
isPointInsideCell(MiGeometryI meshGeometry,
MiSurfaceCell polygonCell,
double[] point,
double[] weights)
Checks if a point is inside the given polygon cell.
|
public static SbVec3d getNormal(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)
This is done by using Newell's method.
meshGeometry
- The geometry of the mesh.polygonCell
- The input cell.public static boolean isPointInsideCell(MiGeometryI meshGeometry, MiSurfaceCell polygonCell, double[] point, double[] weights)
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)
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.public static double getLongestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)
meshGeometry
- The geometry of the mesh.polygonCell
- The input cell.public static double getShortestEdgeLength(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)
meshGeometry
- The geometry of the mesh.polygonCell
- The input cell.public static double getArea(MiGeometryI meshGeometry, MiSurfaceCell polygonCell)
meshGeometry
- The geometry of the mesh.polygonCell
- The input cell.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com