Description

When working with CAD-files in your Prespective project having a proper workflow is strongly advised. In this article we share some tips and best practices to help you setup and organize your CAD-files. Before you import your CAD-files we recommend determining the goal of your project early on. This will help you with decisions regarding optimizing and managing your CAD-files.


Introduction

We strongly recommend using Pixyz to import all your CAD-files into Unity. Pixyz is a third-party plugin supported by Unity3D. You can download Pixyz from the Unity Asset Store, or via their website. When discussing import-settings in this article, we are using Pixyz.

Before you start importing any Cad files make sure you know which file types are most usable. To help you out choosing a proper file we recommend you to take a look in this document Choosing a proper 3D-file

Performance of a project on your system is essential for running Prespective simulations. We will show you how to keep your project manageable and accessible for these simulations.

Because a computer does not have infinite computing power, it is important to know which quality level fits your project and system the best.

When importing CAD-files the first step is to define the quality level of the 3d model. You can choose between a high, medium or low quality for your CAD-files. A lower quality will generate a model that has the same measurements, but less triangles and detail as a higher quality model. This is most obvious in circular and spherical shapes.

Low Quality : Generates less detailed models. Using a low quality model may be necessary to enhance performance for large CAD-files, or those with a lot of details.

Medium Quality : A good model that works well in combination with Prespective. This setting can be used on a single detailed machine. We recommend this preset for most cases. This preset does not reduce the details too much and is performance friendly.

High Quality : A highly detailed model is generated. This preset is mainly used for simple objects and high quality visualization.


Step 1 : Import and verify your CAD files with Pixyz

For more documentation on Pixyz’s import settings, please visit their documentation page.

When importing your CAD files, choose a “Mesh Quality“ level that matches the goal of your project. As shown in the introduction above. In most cases the default import preset gives a good result as shown below.

Generate UVs on import

Verify the Cad model

Remember to save your scene after importing! If you close Unity3D before saving your scene, you may have to redo the importing process.


Step 2 : Optimize and redo topology and hierarchy

In this step we will clean up the imported model for better performance and visibility of the simulated objects.

Hide irrelevant objects

Using the https://unit040.atlassian.net/wiki/spaces/PUD/pages/280986090 feature of Prespective you can easily select smaller parts of the model that are irrelevant for the simulation and hide them.

For instance, you can easily select all nuts and bolts.

By hiding all the unnecessary meshes you gain performance for using it as a simulation. Hidden parts are not lost, and can easily be retrieved when you need them.

When selected:

  • Single mesh it is highlighted Orange

  • Parent object that contains one or more mesh renderers are highlighted Blue

  • Empty objects/parents only show their pivot

Clean up hierarchy

Cleaning up your hierarchy helps you manage your project and find objects more easily.

Optimize hierarchy

The first thing you should do is organize all objects that need to be rigged with Prespective.

Before deleting any Parent objects make sure that the pivot point of an object or its parents that you want to rig later is positioned and rotated correctly. These objects can help you rig the model with Prespective later and should not be deleted. Make sure to set your “Tool Handle” on the top left of your screen to “Pivot and Local” to check that. If there are there any pivot points that are not aligned to an object or having a bad rotation. This we handle on later in this document.

If a model or parent has a faulty scale but you still want to use it because it has the correct position or rotation you can use the https://unit040.atlassian.net/wiki/spaces/TEST/pages/3735619/Mesh+Rescaler to set the scale to identity so its values are 1,1,1.

Group objects

If a parent object contains many sub components you can use the https://unit040.atlassian.net/wiki/spaces/PUD/pages/280953128 to collect all the mesh renderers within the parent.

Take a look at the Prespective https://unit040.atlassian.net/wiki/spaces/PUD/pages/280854889 and see what tools we have that can help you organize your hierarchy and model!


Export as Collada

  • Hidden objects will be removed when exporting as Collada files.

  • Before Exporting as Collada make sure you unwrapped the model with pixyz. This is helpful when you want to use materials to make your scene look better.

  • When doing this after you exported as Collada you have to export it again due to Pixyz made new mesh files in your scene.

When you are finished cleaning up the model, You can export it as a Collada (.dae) file. Before you export make sure you have checked that everything that you need is not hidden in the scene. Once exported, this model will be the base of your Prespective project.

  1. Select in your hierarchy the optimized and organized model.

  2. In the Prespective menu go to Utilities->Export Collada File.

  3. Choose an output path for your Collada file.

  4. Keep a copy of this scene as a form of backup for your model at this version will still have all the hidden objects.

  5. Within your scene hierarchy you can now delete the model you have exported as Collada.

Step 3 : Prepare the model and create kinematics

Import as Collada

Go back to the Prespective menu to Utilities->Import Collada File, select your recently created Collada file and store it on importing in a recognizable map name.

Your Assets folder now should contain this structure in order to easily find back your imported model to work with.

Static meshes

Align objects

It sometimes happens that objects need to be (re)aligned. The reason can be because you loaded two seperated assemblies a top and a bottom. This can be easyly fixed by using the https://unit040.atlassian.net/wiki/spaces/PUD/pages/281051436/V2020.1.56.3+Alignment+Tool

Pivot movement

Pivots are the main points for objects and parents. This is where the objects rotates around and defines its main position and rotation from. In order to check wheter the pivot is good or not make sure your “Tool Handle“ is set to Pivot and Local as shown in the image below.

Center and Global options in the “Tool Handle“ are false measure points to work with since they are a relative calculation. The center of the mesh in the global position of the world.

To create the most precize measurement and movement with kinematics for instance The pivots need to be in the right position. If they are not you can change them by using the https://unit040.atlassian.net/wiki/spaces/PUD/pages/280953276/V2020.1.56.3+Pivot+Tool.

It is most likely to not edit pivots on objects that contain a meshrenderer. In order to edit its better to give them an empty parent object where you can edit the pivot from. The reason for this is that you always keep your hierarchy modable when you need to change an object that your pivots wil not get destroyed.