.. _cad_import: =============================== CAD Importer =============================== We provide a STEP (Standard for the Exchange of Product Data) and Initial Graphics Exchange Specification (IGES) file importer for loading objects that were designed in a CAD software. To enable the CAD file importer if not already enabled, go to `Window -> Extensions` and check ``omni.kit.importer.cad``. .. image:: /content/images/ext_cad-importer_enable-extension.png :align: center :width: 49% :alt: Enable_Extension You can get reference sample STEP files on https://www.cax-if.org/cax/cax_stepLib.php Importing STEP and IGES files -------------------------------------------- Once the CAD Importer is enabled, STEP and IGES will be added to the list of supported file formats on the `File -> Import` dialog. For quickest way to import a model, navigate to a folder with STEP/IGES files, select the desired file and click on Open. The imported asset will insert to the existing stage on screen with a default resolution. .. image:: /content/images/ext_cad-importer_file-types.png :align: center :width: 35% :alt: File_Types You can either chose to import a model into an existing stage where you might already have assets such as geometry, cameras, lights etc. or into a new temporary stage to evaluate the meshes before saving a copy in USD. There are three different methods to import STEP/IGES files using the CAD Importer Extension. Method 1: File -> Import ####################################################### You can use the File -> Import option to convert a STEP/IGES file to USD. Selecting this option will bring out a File Picker Dialog, which allows you to adjust the Level of Detail in your model before importing it into a stage. At this level if you check 'Open in New Stage', the CAD File will be imported into a temporary stage and an editor dialog will show up. .. image:: /content/images/ext_cad-importer_file-picker.png :align: center :width: 70% :alt: File_Picker Method 2: Content Browser ####################################################### You can use the Content Browser to convert a STEP/IGES file to USD. There are two entry points for this. Import Button ^^^^^^^^^^^^^^^^^^^^^^ You can use the Content Browser to navigate to a folder with STEP/IGES files. Once you select the folder, click the 'Import' button with the green plus icon. This will bring up a dialog and ask you to pick a STEP/IGES and adjust LOD Properties. Follow the same steps as the File -> Import option .. image:: /content/images/ext_cad-importer_content-browser01.png :width: 49% :height: 200 .. image:: /content/images/ext_cad-importer_file-picker.png :width: 49% :height: 200 Right Click ^^^^^^^^^^^^^^^^^ You can use the Content Browser to navigate to a STEP/IGES file and right clicking on it. This will bring out a Context Menu and there are two options to import a CAD file: 'Convert to USD' and 'Open CAD File as USD in New Stage'. * **Convert to USD**: Brings out an options dialog and prompts the user to adjust LOD Properties. * **Open CAD File as USD in New Stage**: Closes current stage and opens the CAD File in a temporary stage. .. image:: /content/images/ext_cad-importer_content-browser02.png :width: 49% :height: 200 .. image:: /content/images/ext_cad-importer_import-options.png :width: 30% :height: 200 Import Options -------------------------------------------- .. image:: /content/images/ext_cad-importer_import-options.png :align: center :width: 49% :alt: Import Options LOD Properties ####################################################### To improve the import quality of the asset, change the LOD properties on the CAD Importer tab. Linear Deflection ^^^^^^^^^^^^^^^^^^^^ The linear deflection is a parameter that limits the maximum deviation a tessellation can have from the original surface, it is measured in the triangle normal direction at its center. .. figure:: /content/images/ext_cad-importer_linear_deflection.png :align: center :width: 40% :alt: Limits the distance between a surface and its tessellation Angular Deflection ^^^^^^^^^^^^^^^^^^^^ The angular deflection limits the angle measured between subsequent tangents to the surface on the direction of measurement. The angle cannot be greater than the value provided. .. figure:: /content/images/ext_cad-importer_angular_deflection.png :align: center :width: 40% :alt: Limits the angle between subsequent segments in the polyline Min Poly Area ^^^^^^^^^^^^^^^^^ The minimum area each triangle on the tessellation can be. This parameter takes precedence over the other configurations and can be used to limit the tessellation convergence. Use Relative Offset ^^^^^^^^^^^^^^^^^^^^ Scales the Linear deflection by the segment length. Open in New Stage ^^^^^^^^^^^^^^^^^^^^ Checking this box will close the current scene after prompting the user to save the existing stage and open the CAD file in a temporary stage. Edit / Reimport Meshes (Temporary Stage) ####################################################### In this section the user can inspect the properties of each imported mesh, as well as rename the imports. Selecting an item on the list or on stage will select all instances of that item on screen, and double clicking on an item will open that item isolated from the assembly. The control buttons perform the following actions: * **Show Full Part**: Saves changes made to current open asset and reopens the full assembly. * **Find Similar Meshes**: Uses the Metadata (volume, inertia tensor) from the meshes to select all similar meshes on assembly. .. note:: The meshes selected may not actually be identical, and not all similar meshes may end up being selected. * **Remove Selected Duplicates**: Uses the first selected asset as base and replaces all other selected assets with it. * **Visibility**: Shows/Hide selected assets. * **RightClick > Edit Mesh Names**: Enters / Exits name editing mode, allowing to change the mesh names. .. figure:: /content/images/ext_cad-importer_lod-widget.png :align: center :width: 70% :alt: Example of the imported assembly. * **LOD widget**: Re-tessellates Selected meshes using the the LOD Properties configured within each widget. .. note:: LOD Widget can be accessed by clicking the up arrow next to the mesh. .. figure:: /content/images/ext_cad-importer_panels.png :align: center :width: 70% :alt: Example of the imported assembly. Finish Import ####################################################### To finish an import click on the **Finish Import** button, and select the folder where the asset will be saved. All assemblies are stored on the base folder, materials on one usd in the folder `materials`, and Each solid becomes an individual usd on the folder `meshes`. If you desire to keep the whole assembly on a single file, check **Save Flattened** before import, and it will generate a single usd file with the main assembly name on the selected folder. .. figure:: /content/images/ext_cad-importer_folder.png :align: center :width: 70% :alt: Folder of imported assets.