2D Primitives

CraftML's built-in 2D primitives are:

Useful Techniques

Even though 2D primitives will not be exported for 3D printing, they are useful for a number of purposes.

Spatial Markers

One useful technique is to use a 2D shape as a reference maker to perform special layout that's hard to achieved using only the builtin layout operations, such as align, flow, and center. 2D shapes do participate in layout operations , but they do not get exported for 3D printing.

In the example below, we create a cylinder and place a couple circles to mark two distinct areas on the front side of this cylinder. Next, we create a small blue cube and a small green sphere. We use $ in a script tag to select the circle whose id is marker1, and then add the cube to the selection to align this cube to that circle. Similarly, we align the sphere with the other circle whose id is marker2.