Skip to content

compas_cgal.intersections ¤

Functions¤

intersection_mesh_mesh ¤

intersection_mesh_mesh(A: VerticesFaces, B: VerticesFaces) -> PolylinesNumpy

Compute the intersection of tow meshes.

Parameters:

Name Type Description Default
A VerticesFaces

Mesh A.

required
B VerticesFaces

Mesh B.

required

Returns:

Type Description
PolylinesNumpy

A list of intersection polylines, with each polyline an array of points.

Examples:

>>> from compas.geometry import Box, Sphere, Polyline
>>> from compas_cgal.intersections import intersection_mesh_mesh
>>> box = Box(1)
>>> sphere = Sphere(0.5, point=[1, 1, 1])
>>> A = box.to_vertices_and_faces(triangulated=True)
>>> B = sphere.to_vertices_and_faces(u=32, v=32, triangulated=True)
>>> result = intersection_mesh_mesh(A, B)
>>> polylines = [Polyline(points) for points in result]