PolygonMesher¶
(Source code, svg)
- class otmeshing.PolygonMesher¶
2-d Polygon meshing algorithm.
Methods
build(points)Generate a mesh from polygon coordinates.
Accessor to the object's name.
getName()Accessor to the object's name.
hasName()Test if the object is named.
setName(name)Accessor to the object's name.
Examples
Triangulate a parallelogram:
>>> import otmeshing >>> mesher = otmeshing.PolygonMesher() >>> polyline = [[0, 0], [3, 0], [4, 2], [1, 2]] >>> triangulation = mesher.build(polyline)
- __init__()¶
- build(points)¶
Generate a mesh from polygon coordinates.
- Parameters:
- polyline
openturns.Sample An ordered set of vertices defining a 2-d polygon, possibly non-convex. The polygon must be simple (with no redundant vertex). The vertices can be of dimension greater than 2, but the polygon itsef should be within a single plane.
- polyline
- Returns:
- mesh
openturns.Mesh The triangulation generated.
- mesh
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
otmeshing