Model
¤
Base model for mesh generation.
Parameters:
-
name(str | None, default:None) –The name of the model.
-
verbose(bool, default:False) –Flag indicating if output should be printed to the terminal.
-
options–The meshing options.
Functions¤
curve_coordinates_at
¤
curve_domain
¤
curve_to_polyline
¤
curve_vertices
¤
find_points_at_xy
¤
find_points_at_xyz
¤
find_points_within_distance_of_location
¤
find_points_within_horizontal_distance_of_location
¤
from_brep
classmethod
¤
from_step
classmethod
¤
generate_mesh
¤
generate_mesh(dim: int = 2) -> None
Generate a mesh of the current model.
Parameters:
-
dim(int, default:2) –The dimension of the mesh.
Returns:
-
None–The mesh is stored in the model for further refinement and optimisation. To retrieve the generated mesh, use :meth:
mesh_to_compas, :meth:mesh_to_openmesh, or :meth:mesh_to_tets.
Notes
The geometry is automatically synchronised with the underlying OCC model.
Therefore, there is no need to call :meth:synchronize before generating the mesh.
To influence the meshing process, use the options of the model (:attr:options.mesh).
mesh_node_xyz
¤
Get the coordinates of the mesh nodes.
Returns:
-
dict–A dictionary mapping node tags to node coordinates.
mesh_targetlength_at_point
¤
mesh_to_openmesh
¤
Convert the model mesh to a COMPAS mesh data structure.
Returns:
-
TriMesh or PolyMesh–An OpenMesh mesh.
mesh_to_quads
¤
mesh_to_tets
¤
mesh_to_tets() -> list[Polyhedron]
Convert the model mesh to a COMPAS mesh data structure.
Returns:
-
list[Polyhedron]–A list of COMPAS polyhedra.
mesh_to_triangles
¤
mesh_to_vertices_and_faces
¤
optimize_mesh
¤
optimize_mesh(algo: OptimizationAlgorithm = Default, niter: int = 1) -> None
Optimize the model mesh using the specified method.
Parameters:
-
algo(OptimizationAlgorithm, default:Default) –The optimization algorithm to use.
-
niter(int, default:1) –The number of iterations.
Returns:
-
None–Optimisation is applied to the internally stored mesh.
point_to_point
¤
recombine_mesh
¤
Recombine the mesh into quadrilateral faces.
Returns:
-
None–Recombination is applied to the internally stored mesh.
refine_mesh
¤
Refine the model mesh by uniformly splitting the edges.
Returns:
-
None–Refinement is applied to the internally stored mesh.
surface_coordinates_at
¤
surface_curves
¤
surface_domain
¤
surface_faces
¤
surface_mesh
¤
Get the mesh of a surface entity.
Parameters:
-
tag(int) –The identifier of the surface.
Returns:
-
class:`Mesh`–The mesh of the surface.
surface_vertices
¤
volume_curves
¤
volume_faces
¤
volume_mesh
¤
volume_points
¤
volume_surfaces
¤
volume_tets
¤
volume_tets(tag: int) -> list[Polyhedron]
Get the tetrahedra of a volume entity.
Parameters:
-
tag(int) –The identifier of the volume.
Returns:
-
list[Polyhedron]–The tetrahedra of the volume.