def compas_trimesh_to_occ_shell(mesh: Mesh) -> TopoDS_Shell: """Convert a COMPAS triangle mesh to an OCC shell. Parameters ---------- mesh : :class:`~compas.datastructures.Mesh` A COMPAS mesh data structure with triangle faces. Returns ------- TopoDS_Shell Raises ------ AssertionError If the mesh is not a triangle mesh. """ assert mesh.is_trimesh(), "The input mesh is not a triangle mesh." shell = TopoDS_Shell() builder = BRep_Builder() builder.MakeShell(shell) for face in mesh.faces(): points = mesh.face_coordinates(face) builder.Add(shell, triangle_to_face(points)) return shell