mesh.Mesh.generate_triangle_mesh_multi#
- classmethod Mesh.generate_triangle_mesh_multi(curves, div=None)#
Generate a triangle surface mesh from multiple line2 meshes.
The input meshes (curves) must together form a closed loop.
Parameters#
- curveslist of Mesh
List of at least two line2 meshes forming a closed boundary loop.
- divlist of int, optional
Number of divisions along each input curve.
If provided,
divmust be a list (or tuple) with one positive integer per input curve, specifying the target number of divisions used for meshing along that curve. Each curve is subdivided into edges of equal length, and new nodes may be introduced.If
divisNone, the target number of divisions is inferred automatically from the discretization of each input line mesh. In this mode, the elements of the input curves become the boundary edges of the triangle mesh, provided that all edges along the curve are of equal length.
Returns#
- Mesh
Triangle surface mesh (tri3).
Important
If a curve contains edges of unequal length, meshing will enforce equal edge spacing along that curve, which will introduce new boundary nodes even when
divisNone. Preserving edges of unequal length can be done usinggenerate_triangle_mesh()If new boundary nodes are introduced, they are placed on a spline that interpolates all original nodes of the corresponding input curve.
See Also#
Examples#
>>> arc = shapes.arc(div=6) >>> l1 = shapes.line_segment([0,1,0], [0,0,0], div=4) >>> l2 = shapes.line_segment([1,0,0], [0,0,0], div=4) >>> triangle_mesh = Mesh.generate_triangle_mesh_multi([arc, l1, l2], div=None) >>> triangle_mesh.eltype.lname 'tri3' >>> print(triangle_mesh.n_elems()) 30
>>> div_vals = [8, 6, 6] # one integer per curve >>> triangle_mesh = Mesh.generate_triangle_mesh_multi([arc, l1, l2], div=div_vals) >>> print(triangle_mesh.n_elems()) 64