Skip to content

MeshModel ¤

MeshModel(*args, **kwargs)

Model for mesh (re)meshing.

Functions¤

find_point_at_vertex ¤

find_point_at_vertex(vertex: int) -> int

Find the model point at a vertex of the input mesh.

Parameters:

  • vertex (int) –

    A vertex of the input mesh.

Returns:

  • int

    The point identifier.

from_mesh classmethod ¤

from_mesh(
    mesh: Mesh, name: str = "Mesh", targetlength: float | dict | None = None
) -> MeshModel

Create a mesh model from a mesh.

Parameters:

  • mesh (Mesh) –

    A COMPAS mesh.

  • name (str, default: 'Mesh' ) –

    The name of the model.

  • target_length

    Target value for the length of the mesh edges.

Returns:

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_targetlength_at_vertex ¤

mesh_targetlength_at_vertex(vertex: int, target: float) -> None

Set the target length at a particular mesh vertex.

Parameters:

  • vertex (int) –

    The vertex identifier.

  • target (float) –

    The target length value.

Returns:

  • None

read_options_from_attributes ¤

read_options_from_attributes() -> None

Read the model options from the attributes of the mesh data structure.

Returns:

  • None