Skip to content

compas_wood¤

compas_wood banner

compas_wood is the COMPAS interface to the wood_nano timber joinery kernel: it generates plate shells, detects the joints between neighbouring plates, and returns the joint-carved outlines and cut volumes ready for fabrication.

The stack has three layers:

  1. wood - the C++ library that does all the work: plate elements, joinery detection, joint volume generation, lofting.
  2. wood_nano - nanobind bindings of wood, published as a compiled wheel.
  3. compas_wood (this package) - a pure-Python layer that converts between COMPAS types (Polyline, Mesh) and the kernel's raw containers. No computation happens here.

Quick example¤

from compas_wood import translation_shell_elements, joinery_solver_elements

# Sweep a cross-section along a profile into a shell of plate elements
# (no arguments = the built-in arch).
shell_mesh, elements = translation_shell_elements()

# Detect joinery between the plates and get back merged, joint-carved outlines.
plates, joints = joinery_solver_elements(
    bottom_polylines=[e.bottom for e in elements],
    top_polylines=[e.top for e in elements],
)

# Write the result as a scene for session_viewer, and print its URL.
from compas_wood.session_scene import SessionScene, publish, viewer_url
from compas_wood.viewer import add_joinery

scene = SessionScene("quickstart")
add_joinery(scene, plates, joints, draw_meshes=True)
publish(scene, "quickstart")
print(viewer_url("quickstart"))

Where to go next¤

Rhino / Grasshopper¤

A Rhino plugin also named compas_wood ships from the wood_nano repository via the Yak package manager. It does not depend on this Python package.