Skip to content

compas_wood.convert ¤

Direct converters from C++ raw dicts/lists to compas geometry types.

All functions take the raw Python objects returned by the nanobind C++ bindings and produce compas types — no session_py intermediate.

Functions:¤

frame_from_cpp ¤

frame_from_cpp(d: dict) -> Frame

Convert C++ plane dict {origin, x_axis, y_axis} to :class:compas.geometry.Frame.

mesh_from_cpp ¤

mesh_from_cpp(data: dict) -> Mesh

Convert C++ {vertices, faces[, face_tris]} dict to :class:compas.datastructures.Mesh.

When face_tris is present (CDT triangulation from the joinery solver), those triangles are used directly so the result matches the C++ triangulation. Faces without CDT entries are fan-triangulated as a fallback.

polyline_from_cpp ¤

polyline_from_cpp(pts) -> Polyline

Convert C++ point list (list of [x,y,z]) to :class:compas.geometry.Polyline.