Skip to content

compas_cgal.projection ¤

Functions¤

project_mesh_on_mesh ¤

project_mesh_on_mesh(
    mesh_source: VerticesFaces, mesh_target: VerticesFaces
) -> VerticesFaces

Project mesh_source vertices onto mesh_target surface.

Parameters:

Name Type Description Default
mesh_source :attr:`compas_cgal.types.VerticesFaces`

Mesh that is projected onto the target mesh.

required
mesh_target :attr:`compas_cgal.types.VerticesFaces`

Mesh that is projected onto.

required

Returns:

Type Description
attr:`compas_cgal.types.VerticesFaces`

The projected mesh (vertices on mesh_source surface, original faces).

project_points_on_mesh ¤

project_points_on_mesh(
    points: list[list[float]], mesh: VerticesFaces
) -> list[list[float]]

Project points onto a mesh by closest perpendicular distance.

Parameters:

Name Type Description Default
points list[list[float]]

The points to project.

required
mesh :attr:`compas_cgal.types.VerticesFaces`

Mesh that the points are projected onto.

required

Returns:

Type Description
list[list[float]]

The projected points (vertices on the mesh surface).

pull_mesh_on_mesh ¤

pull_mesh_on_mesh(
    mesh_source: VerticesFaces, mesh_target: VerticesFaces
) -> VerticesFaces

Pull mesh_source vertices onto mesh_target surface using mesh_source normals.

Parameters:

Name Type Description Default
mesh_source :attr:`compas_cgal.types.VerticesFaces`

Mesh that is projected onto the target mesh.

required
mesh_target :attr:`compas_cgal.types.VerticesFaces`

Mesh that is projected onto.

required

Returns:

Type Description
attr:`compas_cgal.types.VerticesFaces`

The projected mesh (vertices on mesh_source surface, original faces).

pull_points_on_mesh ¤

pull_points_on_mesh(
    points: list[list[float]], normals: list[list[float]], mesh: VerticesFaces
) -> list[list[float]]

Pull points onto a mesh surface using ray-mesh intersection along normal vectors.

Parameters:

Name Type Description Default
points list[list[float]]

The points to pull.

required
normals list[list[float]]

The normal vectors used for directing the projection.

required
mesh :attr:`compas_cgal.types.VerticesFaces`

Mesh that the points are pulled onto.

required

Returns:

Type Description
list[list[float]]

The pulled points (vertices on the mesh surface).