# CAD files

## Overview

Vectary supports **`STEP`**/**`STP`** , **`IGES`**/**`IGS`** formats, which are mainly used in the CAD workflow. Once such a file is imported, its structure is converted into one or multiple **`NURBS`** objects.

A **`NURBS`** is a special object that contains **`NURBS`** geometry. Since Vectary is a mesh software, the imported **`NURBS`** geometry is automatically converted into mesh geometry. However, this transformation is procedural, which means that the quality can be changed at any time (similar to segment parameters for primitive objects).

## What are the benefits of the CAD importer?

* Using additional software to convert CAD files into Vectary is unnecessary. Simply drag and drop your created or downloaded file.
* The quality of any part of the object can be adjusted, helping achieve a balance between polygon count and model detail. The benefit of keeping the **`NURBS`** object is that there is no need to create a new model, just to change settings.
* Better suited for companies using CAD file workflow.
* **`STEP`**/**`STP`** , **`IGES`**/**`IGS`** are files that allow you to export only the data you need, not the entire project.

## Import

Importing can take some time (a few minutes in some circumstances).

{% embed url="<https://screen.studio/share/A38Spo3h>" %}

* When importing a file, the parameters of all objects are adjusted relative to the size of the largest object in the file.

  *Import example:*

  1. Small screw - high quality of detail.
  2. A whole CNC machine with many small parts - the quality of small parts will be low to avoid many polygons.
* We recommend the size of the **`STEP`**/**`IGES`** file up to 50MB. Files exceeding this size may be processed for too long. If the file exceeds the mentioned size, it is best practice to export in standard OBJ format, import to Vectary, and use the Simplify plugin to decrease the polygon density.
* Vectary only supports geometry that can be directly converted to polygons, meaning we do not support **curves** or **points**. We only support surfaces and polyfaces.

{% hint style="info" %}
Vectary offers the ability to import CAD files, which can be a valuable feature. However, it is important to note that there are some limitations.

In most cases, we recommend importing files as mesh geometry (such as **`OBJ`**, **`FBX`**, **`GLTF`**, **`GLB`**, or **`STL`**). This is because **`STEP`** and **IGES** are old formats and there may be differences in the way each software interprets these formats, namely different object structure, geometry, and materials.
{% endhint %}

## File structure

Notice that NURBS objects have the following icons in the left panel:

<div align="left"><figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FYCRudVYqIfQJt0zDPXf9%2Fimage.png?alt=media&#x26;token=e041feb8-3d0a-4f2b-82f1-4af3ea308e71" alt=""><figcaption></figcaption></figure></div>

Imported NURBS geometry can contain multiple parts. in that case, it is imported as multiple NURBS objects under the group (the name of the group is the name of the file).

<div align="left"><figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FyXtvugJgLDAb7iamRHz7%2Fimage.png?alt=media&#x26;token=f7d57aad-bf58-48ae-a801-4ce8e04c2cd1" alt="" width="372"><figcaption></figcaption></figure></div>

In some cases, there is the button Break apart which will change the current object to multiple parts:

{% embed url="<https://screen.studio/share/B6sWbmLy>" %}

## Meshing management

The settings allowing for changes in the density and quality of the mesh are located on the right panel.

<div align="left"><figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FYjItcPufxoVtFC4sncFz%2Fimage.png?alt=media&#x26;token=a8082600-0051-456e-9b75-eba07bfb9b32" alt=""><figcaption><p>Default settings</p></figcaption></figure></div>

{% hint style="info" %}
These parameters can be adjusted either for an individual object or for all selected objects
{% endhint %}

{% hint style="info" %}
It is not necessary to modify all of the values at once; instead, try to change each one a little at a time
{% endhint %}

Default values may result in distorted geometry. However, you can define the level of detail for each part of the object yourself. It is important to note that increasing the level of detail leads to an increase in the number of polygons, which results in a larger file size and can potentially affect the performance of the project.

<figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FZY0DMU1BHgK0QqAF0pf4%2Fimage.png?alt=media&#x26;token=06b32e24-faaf-4aac-8827-4a84b82e6c5f" alt=""><figcaption><p>Geometry distortion example</p></figcaption></figure>

<figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FZpnvgQOhsSeLZm6aIeSv%2Fimage.png?alt=media&#x26;token=f13e2b3b-6427-4155-b878-fef17cc341fc" alt=""><figcaption><p>After changing the quality settings</p></figcaption></figure>

**Linear deflection** - defines the maximum distance between the original NURBS geometry and final mesh geometry (strong impact on the polygon count).

**Angular deflection** - defines the maximum angle between 2 polygons (minimal impact on the polygon count).

**Min edge size** - defines the minimum length of the edge (average impact on the polygon count).

<figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2FnP2Y9keRQJkdd2653SIu%2Fimage.png?alt=media&#x26;token=36d47ad4-2f5b-4684-81e7-c06ddf11762f" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The lower the number, the more precise the result is, but number of polygons also increases
{% endhint %}

After changing the parameters in the upper right corner of the scene you can see the status of the recalculation:

<figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2Fa1xwwaTZtGjp2y9ni7rg%2Fimage.png?alt=media&#x26;token=57c3efe7-0e82-4278-a8d3-25f62079a421" alt=""><figcaption></figcaption></figure>

## Converting to geometry

The imported CAD file becomes a NURBS object, which in turn is a procedural object whose quality parameters can be changed at any time.

If it is necessary to edit the mesh, the object must be converted to a geometric one. At the same time you lose the ability to adjust the quality (works similarly to primitives).

<figure><img src="https://2973737105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAXNLyKVZ2tvtyDr8sVES%2Fuploads%2Fu6Di12sq4mdSazYLqDvu%2F34treg.gif?alt=media&#x26;token=9c4505d8-4548-42a2-bacc-e173b25a3cb0" alt=""><figcaption><p>Note the different icons for a NURBS object and a geometric one</p></figcaption></figure>

Each change in quality settings is based on the original file, so you can safely experiment with the settings.

## Tutorials

{% embed url="<https://youtu.be/t_0uFBkQCdI?si=W4-ySJpjHEaj3HJL>" %}

{% embed url="<https://youtu.be/Ef1-ZCzcjRc?si=gCI3aKZCtUNjs0hq>" %}

The whole playlist "From CAD to Vectary" (9 tutorials):

<https://youtube.com/playlist?list=PLIDfmreWrOG-7qpCKmRoImBaw3jFo3JnN&si=bDP5LdQ-5D2JzMw5>
