MultiPolyMesherIo¶
The MultiPolyMesherIo contains the options for meshing using XmsMesh library. This class uses
a collection of xmsmesh.meshing.PolyInput
objects, xmsmesh.meshing.RefinePoint
objects
and several other options that can be used to generate meshes.
This class is also used to retrieve a mesh after it has been generated. The points and cells
properties on this class are used to pass back the geometry of the mesh that is generated using
functions from the xmsmesh.meshing.mesh_utils
module.
The points property is just a list of (x, y, z) coordinates representing the points of the mesh. Cells, is a cell stream that is used to define the mesh. The cell stream is a list of integers used to describe the mesh cells.
For example a cell stream from a MultiPolyMesherIo might look something like this.
>> print(mesh_io.cells)
>> [5, 3, 0, 40, 1, 5, 3, 40, 0, 39, ...]
The cell stream is organized as follows: [<CELL_TYPE>, <NUMBER_OF_POINTS> <POINT_ID_1>, … <POINT_ID_N>, <CELL_TYPE>, <NUMBER_OF_POINTS> <POINT_ID_1>, … <POINT_ID_N>, …]. So our example above could be read as CELL_TYPE = 5 (TRIANGLE), there are 3 points, and the point ID’s are 0, 40, and 1, and so on.
The cell_polygons property is a list of ints referring to the index of the PolyInput that each cell was generated from. The length of cell_polygons will be the total number of cells in your mesh. This property can be useful because each mesh can be generated from many different polygons. It may sometimes be useful to know which polygon each cell came from.
-
class
xmsmesh.meshing.
MultiPolyMesherIo
¶ -
__init__
(self: xmsmesh.meshing.MultiPolyMesherIo, poly_inputs: iterable, refine_points: iterable=(), check_topology: bool=False, return_cell_polygons: bool=True) → None¶ Creates a mesh from one or more PolyInputs, and other settings that are defined in the PolyMesherIo that is passed into this class.
Parameters: - poly_inputs (collections.Iterable[xmsmesh.meshing.PolyInput]) – A list of PolyInputs.
- refine_points (collections.Iterable[xmsmesh.meshing.RefinePoint]) – A list of RefinePoints.
- check_topology (bool) – Check polygon input topology for errors.
- return_cell_polygons (bool) – Return the polygon index of each cell.
-
cell_polygons
¶ The index of the PolyInput in cell_polygons that each cell was generated from.
-
cells
¶ A cell stream representing the mesh. (Populated by meshing functions)
-
check_topology
¶ If True, checks PolyInput topology for errors.
-
points
¶ A list of (x, y, z) coordinates of the resulting mesh. (Populated by meshing functions)
-
poly_inputs
¶ A list of PolyInput objects to be used by the meshing functions.
-
refine_points
¶ A list of RefinePoint objects used for mesh refinement.
-
return_cell_polygons
¶ If True, the cell_polygons list will be be filled when meshing occurs.
-