mesh.Mesh.generate_quad_mesh_multi#
- classmethod Mesh.generate_quad_mesh_multi(curves, div=None)#
Generate a quad 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. Note that an even number of edges per curve will be enforced; if an odd number is given, it will be automatically adjusted.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 typically become the boundary edges of the quad mesh, provided that:All edges along the curve are of equal length.
Each curve has an even number of edges.
Returns#
- Mesh
Quad surface mesh (quad4).
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.An even number of edges per curve is required for boundary preservation to be possible, but does not guarantee that no additional boundary nodes will be introduced.
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) >>> quad_mesh = Mesh.generate_quad_mesh_multi([arc, l1, l2], div=None) >>> quad_mesh.eltype.lname 'quad4' >>> print(quad_mesh.n_elems()) 15
>>> div_vals = [8, 6, 6] # one integer per curve >>> quad_mesh = Mesh.generate_quad_mesh_multi([arc, l1, l2], div=div_vals) >>> print(quad_mesh.n_elems()) 32