# Shapes

Shapes are 2D objects made of one or more curved or straight lines. The Threekit platform allows for Text and Vector assets to be converted to **Shapes**. Threekit also provides some basic primitive shapes to use from.

The **Shapes** can be converted to 3D meshes with the available shape object operations, like **Mesh From Shape** or **Extruded Shape**. **Shapes** can also be combined or subtracted with other **Shapes** with **Boolean Shape**. The **Boolean Shape** operation unlocks numerous possibilities with **Shapes**.

Overall, it is best to think of **Shapes** as powerful building blocks. They can allow complex vector assets or font files to be converted into a 3D mesh relatively simply.

#### Shape Operations

### Mesh From Shape

The **Mesh From Shape** converts a shape object to a mesh object. The command creates a surface that caps a closed curve. This does not add thickness to the shape. It allows the shape to be treated like a mesh asset and use operators and functions available to meshes.

<table data-header-hidden><thead><tr><th width="146"></th><th></th></tr></thead><tbody><tr><td><strong>Shape</strong></td><td>Link to a shape object within your model asset scene to convert to a mesh object.</td></tr></tbody></table>

### Extruded Shape

The **Extruded Shape** converts a shape object to a mesh object. The command creates a surface that caps a closed curve. This differs from the **Mesh From Shape** because it adds thickness to the shape. It allows the shape to be treated like a mesh and use operators and functions available to meshes.

<table data-header-hidden><thead><tr><th width="152"></th><th></th></tr></thead><tbody><tr><td><strong>Shape</strong></td><td>Link to a shape object within your model asset scene to convert to a mesh object.</td></tr><tr><td><strong>Back Faces</strong></td><td>When enabled it adds a polygon face to the extruded back of the shape.</td></tr><tr><td><strong>Segments</strong></td><td><p>Specifies how many edges or segments are added to the extruded length. This can be important if planning to deform the mesh with other operators. Numeric Range:</p><ul><li>1 = Defaulted value.</li><li>100 = Max value. Adds 100 edges to the extruded length.</li></ul></td></tr><tr><td><strong>Length</strong></td><td><p>Controls the length of the extrusion.</p><p>Numeric Range:</p><ul><li>1 = Defaulted value.</li><li>The higher the value the longer the extrusion length.</li><li>Negative values flips the direction of the extrusion.</li></ul></td></tr><tr><td><strong>Bevel</strong></td><td>When enabled a flat or rounded edge is added to the extrusion.</td></tr><tr><td>Offset</td><td><p>This value determines how far the bevel expands outward. The units are in meters, so it is recommended to use smaller values.</p><p>Numeric Range:</p><ul><li>1 = Defaulted value.</li><li>The higher the value the larger the bevel extends outward.</li></ul></td></tr><tr><td>Style</td><td>This setting controls the shape profile of the bevel and where it is applied in the extrusion. It is important to note that you need segments on the extrusion for the bevel style to properly apply.</td></tr><tr><td>Round</td><td>The front extrusion is beveled. The profile is arced and looks softer.</td></tr><tr><td>Rounded Both</td><td>The front and back of the extrusion are beveled. The profile is arced and softer looking.</td></tr><tr><td>Extended</td><td>The front extrusion is beveled. The profile is linear and sharper looking.</td></tr><tr><td>Corner Radius</td><td><p>This value controls how far back the extrusion goes along the mesh. The units are in meters, so it is recommended to use smaller values.</p><p>Numeric Range:</p><ul><li>.5 = Defaulted value.</li><li>The higher the value the larger the bevel extends backward along the mesh.</li></ul></td></tr></tbody></table>

### Boolean Shape

The **Boolean Shape** combines two shapes in your model asset to factor into a boolean operation. The boolean operation can best be thought of an equation that adds or subtracts the shapes from each other. The result is a new unique shape.

<table data-header-hidden><thead><tr><th width="151"></th><th></th></tr></thead><tbody><tr><td><strong>Shape A</strong></td><td>Determines which shape will be defined as <strong>Shape A</strong> for the <strong>Operation</strong> setting.</td></tr><tr><td><strong>Shape B</strong></td><td>Determines which shape will be defined as <strong>Shape B</strong> for the <strong>Operation</strong> setting.</td></tr><tr><td><strong>Operation</strong></td><td>This setting defines which logical operation is applied for the <strong>Boolean Shape</strong>.</td></tr><tr><td>A intersection B</td><td>The resulting <strong>Boolean Shape</strong> contains only the volume that was common in both shapes. Where <strong>Shape A</strong> + <strong>Shape B</strong> overlap.</td></tr><tr><td>A union B</td><td>The resulting <strong>Boolean Shape</strong> adds both shapes together. Any intersecting or overlapping portions are removed from the new shape. <strong>Shape A</strong> + <strong>Shape B</strong> (removes intersection and overlapping portions)</td></tr><tr><td>A subtract B</td><td><p>The resulting <strong>Boolean Shape</strong> subtracts <strong>Shape A</strong> from <strong>Shape B</strong>.</p><p><strong>Shape A</strong> - <strong>Shape B</strong></p></td></tr><tr><td>A exclusive or B</td><td><p>The resulting <strong>Boolean Shape</strong> adds both shapes together. It maintains the intersecting or overlapping portions.</p><p><strong>Shape A</strong> + <strong>Shape B</strong> (keeps intersecting and overlapping portions)</p></td></tr><tr><td><strong>Use World Space</strong></td><td><p>When enabled the <strong>Boolean Shape</strong> will use the World Space coordinates of <strong>Shape A</strong> and <strong>Shape B</strong> when calculating the <strong>Operation</strong>.</p><p>When disabled the <strong>Boolean Shape</strong> will ignore the World Space coordinates. Instead it will act as if <strong>Shape A</strong> and <strong>Shape B</strong> are placed at 0 in the World Space XYZ axis when calculating the <strong>Operation.</strong></p></td></tr></tbody></table>

#### Shape Primitives

### Polygon

The **Polygon** shape has a center point and radius. The segments add how many sides go around the polygon. The lower number results in shapes like diamond or hexagons. The higher numbers a smoother circle.

<table data-header-hidden><thead><tr><th width="147"></th><th></th></tr></thead><tbody><tr><td><strong>Radius</strong></td><td>Determines radius of <strong>Polygon</strong> shape.</td></tr><tr><td><strong>Segments</strong></td><td>Sets the number of sides on a <strong>Polygon</strong> shape. The higher the number the more circular it looks.</td></tr><tr><td><strong>Angle</strong></td><td>Controls the rotation of the <strong>Polygon</strong> shape.</td></tr></tbody></table>

### Rectangle

The **Rectangle** shape is a square or rectangle shape.

<table data-header-hidden><thead><tr><th width="146"></th><th></th></tr></thead><tbody><tr><td><strong>Width</strong></td><td>Determines width of a <strong>Rectangle</strong> shape.</td></tr><tr><td><strong>Height</strong></td><td>Determines height of a <strong>Rectangle</strong> shape.</td></tr></tbody></table>

### Ring

The **Ring** shape object can also be thought of as a torus shape. It is much like the **Polygon** shape object but with a hole in the center.

<table data-header-hidden><thead><tr><th width="172"></th><th></th></tr></thead><tbody><tr><td><strong>Inner Radius</strong></td><td>Determines the radius of the inner portion of the <strong>Ring</strong> shape.</td></tr><tr><td><strong>Outer Radius</strong></td><td>Determines the radius of the outer portion of the <strong>Ring</strong> shape.</td></tr><tr><td><strong>Segments</strong></td><td>Sets the number of sides on a <strong>Ring</strong> shape. The higher the number the more circular it looks.</td></tr><tr><td><strong>Angle</strong></td><td>Controls the rotation of the <strong>Ring</strong> shape.</td></tr></tbody></table>

### Text Shape

**Text Shape** uses fonts from your asset library and then combines them with any shape object operations. The Threekit platform reads .TTF font files.

<table data-header-hidden><thead><tr><th width="207"></th><th></th></tr></thead><tbody><tr><td><strong>Text</strong></td><td>User-typeable text input field.</td></tr><tr><td><strong>Curve Segments</strong></td><td><p>Determines the amount of segments on the <strong>Text Shape</strong>. Controls how rounded curved areas of the shape appear.<br>Numeric Range:</p><ul><li>4 = Defaulted value.</li><li>The higher the value the larger the more segments are added and smoother the shape looks.</li></ul></td></tr><tr><td><strong>Font Asset</strong></td><td>Link to a custom font asset. Upload a .TTF or .OTF file to your asset library and it will appear as an option for <strong>Font Asset</strong>.</td></tr><tr><td><strong>Font Size</strong></td><td>Selects the font body size.</td></tr><tr><td><strong>Spacing</strong></td><td>Determines the space between characters in text.</td></tr><tr><td><strong>Kerning</strong></td><td><p>Extra font styling preset that must be included in the imported font file.</p><p>Kerning pairs letters that have somewhat matching shapes together and brings them closer together. This makes the font appear with proper spacing. It is recommended to leave <strong>Kerning</strong> enabled by leaving the box checked. We recommend this because if it is included in the font file this is usually the way the font designer intended it to be used.</p></td></tr><tr><td><strong>Ligature</strong></td><td><p>Extra font styling preset that must be included in the imported font file.</p><p>Some combinations of letters will have specific single characters for them, instead of two separate characters. It is recommended to leave <strong>Ligature</strong> enabled by leaving the box checked. We recommend this because if it is included in the font file this is usually the way the font designer intended it to be used.</p></td></tr></tbody></table>

### Vector Shape

**Vector Shape** uses vector assets from your asset library and combines them with any shape object operations. This can be extremely powerful as vector assets can allow for some complex designs.

<table data-header-hidden><thead><tr><th width="212"></th><th></th></tr></thead><tbody><tr><td><strong>Vector Asset</strong></td><td>Link to a custom vector asset. Upload a .SVG file to your asset library and it will appear as an option for <strong>Vector Asset</strong>.</td></tr><tr><td><strong>Curve Segments</strong></td><td><p>Determines the amount of segments on the <strong>Vector Shape</strong>. Controls how rounded curved areas of the shape look. Numeric Range:</p><ul><li>4 = Defaulted value.</li><li>The higher the value the larger the more segments are added and smoother the shape looks.</li></ul></td></tr></tbody></table>

&#x20;

## Shape Limitations

The following are some things to keep in mind when working with Shapes.

#### Boolean

Given two shapes, it's possible to apply boolean operations on them, like union, intersection, difference (*removing the second shape from the first one*), and XOR (*difference of `union` and `intersection`*).\
Shapes can be moved in 3D space, but that doesn't affect the boolean operations.\
They only consider the relative positions in local space.\
To create different effects, it's possible to apply a transform operator on one of the shapes.

Using the **world transform** option might not exactly work as expected because only operations not affecting the `Z`-axis can properly work. If the `Z`-axis is changed in any way, the boolean operations would apply to the projected shape on the `XY`-plane.

#### Fonts/Text

Fonts can be very complicated or incomplete for some characters.\
In those cases, the behavior is undefined.

Some font files might describe holes in shapes that are not compatible with our shape system.

We use `opentype.js`, which doesn't always work properly for non-Latin fonts, like Noto. It's best to check if the font works [here](https://opentype.js.org/) first, so that we can tell if the bug is ours or theirs.

#### SVG

Only SVG images defined with paths can be converted to shapes. The only graphics element that will be converted to shape is `<path>`. This means other elements including (but not limited to) `circle`, `line`, `polygon`, and `rect` will be ignored. Each path element should contain either only lines or only closed shapes. If a path element contains both, the lines will be discarded. SVG styles are not considered for making shapes, thus, things like stroke thickness or joints won't be used for generating the shape. Definitions (`defs`) are not supported either. Color information is discarded.

#### Importing Shapes

Shapes cannot be imported from any file format. CAD formats support wires, but even if they look like shapes, they're not restricted to two dimensions.

#### Exporting Shapes

A shape cannot be exported or rendered directly in V-Ray; it must be converted to a PolyMesh first.
