COMPAS

raw JSON →
2.15.1 verified Mon Apr 27 auth: no python

COMPAS is an open-source, Python-based framework for computational design and digital fabrication. It provides data structures, algorithms, and utilities for geometry processing, topology optimization, and robotic assembly. Current version 2.15.1 supports Python >=3.9, with a stable release cadence.

pip install compas
error ModuleNotFoundError: No module named 'compas_view2'
cause Missing optional viewer package.
fix
pip install compas_view2
error ImportError: cannot import name 'Box' from 'compas.datastructures'
cause Incorrect import path for Box.
fix
from compas.geometry import Box
error AttributeError: 'Box' object has no attribute 'xy'
cause Outdated attribute access pattern.
fix
Use box.x, box.y, box.z instead of box.xy.
gotcha COMPAS depends on a C++ backend (compas_cgal) for some geometry operations; must be installed separately.
fix pip install compas_cgal
deprecated The compas_rhino package is deprecated and replaced by compas_view2 for Rhino integration.
fix Use compas_view2 instead.
gotcha In version 2.x, many geometry functions moved from compas.topology to compas.geometry. Old imports may still work but raise deprecation warnings.
fix Update imports to compas.geometry.
breaking The Point class attribute names changed: 'x','y','z' are now 'xy','yz','zx' for coordinate arrays.
fix Access coordinates via .x, .y, .z (not .xy).

Creates a 3D box and visualizes it using COMPAS View2.

from compas.geometry import Box
from compas_view2.app import App

box = Box(1, 2, 3)
viewer = App()
viewer.add(box)
viewer.show()