FoundationAssembliesCreating Assemblies

Creating Assemblies

An assembly is a collection of components that are connected together. Such a component can be a part, or a subassembly.

In this example, we are creating combining three parts into an assembly. The TreePart, TreeStandPart and the StarPart. These parts can individually be made using Etsrusions and Lathe operations. The assembly is created by combining these parts together.

To add a part to an assembly you can use the add_component method. Before doing so you might want to translate or rotate the part. In this example, we are translating the TreeStandPart and translating then rotating the StarPart to be at the top of the tree.

For components that connect to each other, prefer anchors and joints over raw transforms: they express the relationship (RigidJoint, RevoluteJoint, …) instead of coordinates, and domain libraries build one-liners like connect_with_screw(...) on top of them.

In this other example, we define two classes: Cube and Pyramid. The Cube class creates cubes with random colors using similar code as in previous examples. The Pyramid class creates pyramids by recursively building each level of the pyramid using the Cube class. In this case, we display a pyramid with 2 layers and display it.