![]() |
GeomProcess
The GeMA Geometry Process Plugin
|
geom.getConvexHull(coordAccessor, inclusive) | ||
---|---|---|
Description: | Get the 2D convex hull of all the nodes in a given mesh. The implementation is based on https://www.algorithmist.com/index.php/Monotone_Chain_Convex_Hull.cpp algorithm. | |
Parameters: | coordAccessor | An accessor for the mesh node coordinates (see mesh: nodeCoordAccessor() ). |
inclusive | When set to true , the returned list will contain the potential colinear nodes. In this case a home-made and not-so-fast algorithm is used. | |
Returns: | The returning list of CCW ordered node ids defining the convex hull. |
geom.pointInConvexPolygon(pointCoord, coordAccessor, nodeIds) | ||
---|---|---|
Description: | Check if a 2D point is inside or outside the convex polygon delimited by a set of mesh nodes. | |
Parameters: | pointCoord | A lua table with the coordinates of the point. |
coordAccessor | An accessor for the mesh node coordinates (see mesh: nodeCoordAccessor() ). | |
nodeIds | The list of CCW ordered node ids defining the convex polygon. Important: no check is done in regard to the convexity of the input polygon! | |
Returns: | true if the point is inside, or false otherwise. |
Example using the two previous functions:
geom.delaunayTriangulation(coordAccessor) | ||
---|---|---|
Description: | Compute the 2D delaunay triangulation of all the nodes in a given mesh. The implementation uses the https://github.com/mapbox/delaunator code. | |
Parameters: | coordAccessor | An accessor for the mesh node coordinates (see mesh: nodeCoordAccessor() ). |
Returns: | Three equal-size lua tables which size is equal to the number of triangles in the computed triangulation. The returned tables respectively store the first, second and third node id of each triangle. |
Example: