top of page
Search
  • Writer's pictureSatyam Patel

Do I really need to defeature my CAD? (YESSSSSS)

Updated: Jun 16, 2022



Do I really need to defeature my CAD?

Just in case you missed it. YES!!!!


Why do I need to defeature it?

Stock CAD that you get from your OEM or CAD Drafter will most likely contain way too much detail. When we run simulations we want them to run fast. The faster we can run a simulation the faster we can get results and make decisions.


In Emulate3D we can run simulations faster than real time. The max speed of the model depends on a few different factors including, the CAD, catalog components used and any custom C# or Quicklogic in your model. Out of these things the easiest thing to change is the CAD.


"If your model is running slower than real time the 2 main culprits are badly written logic or too much/complex CAD"

How can you tell if your model needs defeaturing?

A quick way to find out is to import all your CAD then run the model without adding any additional logic. Then try navigate around the model and run it at max speed.

If you can barely navigate around the model, due to lag, that will be caused by the CAD, as that is the only thing in the model!


As you add more functionality to the model expect the performance to deteriorate. If your model is already slow it's only going to get slower.


How much detail needs to be removed?

This depends on the purpose of your simulation/emulation. The more detail that can be removed the faster your model will run. One of the main benefits of Emulate3D are the graphics. The visualisation, of the physics simulation, clearly conveys the way the system/machine works in a way that wouldn't be possible using a 2D or even 3D static image.


Start of by defining what the purpose of the simulation is. Then define what parts are essential to the simulation running, these bits have to be kept, but maybe they can be simplified? Everything else you should be willing to sacrifice to gain better performance.


Common items that should be removed include screws, washers, nut and bolts. Any threaded part should be deleted and could then be replaced with a non threaded version. I've done this before and removed over 20,000 faces from the model by replacing 1 threaded bar with a plain cylinder.


Transparent objects are very intensive to render, you should try remove these from the model to improve performance. For example, delete any glass parts in cabinets and just leave it as a hole.


How to identify parts to be deleted/replaced?

If your model is still running slowly you might need to delete some larger/complex parts from the model. One way to identify complex parts is to use the Mesh Profiler.


The Mesh Profiler displays the mesh details of whatever is in the graphics view when you click Profile. You can use it on your whole model or zoom into a sub-section and then click profile.


In the image below you can see the mesh details from the whole model. We can see that the MagneMotion Straight track sections have 50,256 faces per track section and that their are 13 References of the same mesh, so it exists 13 times in the model.

We can sort the table according to the headings to identify what bits need to be deleted. For example, sorting by faces or vertices will find the most complex parts. In the past, I've found HMI boxes and their stands to be complex parts with lots of nooks and crannies inside of them. Delete these and replace them with box and box tube visuals. Use Cylinder visuals for buttons. Motor and PLC CAD will normally position themselves top of this list and should be deleted, especially if they are hidden in a cabinet.


Using the Immediate Window

Sorting by DrawCalls or References will find the most common parts in the model. Normally screw, washers, nuts and bolts. These parts will most likely share a name as they are all created using the same sub-assembly/part in the CAD package, once you identify this name you can easily delete all of them using the Immediate Window.


Press Ctrl + I to open the Immediate Window then copy and paste one of the two below commands and replace ISO with the screw/washer name. Then hit enter.

In one VR model, I've worked with I located hundreds of washers, each of which was made of 30 surfaces. I deleted them using the immediate window and the FPS in VR went from 3 FPS to 25 FPS!

//Add parts with name ISO to a Layer
{var c = 0; for (var v in doc.Scene.Descendants) { if (v.Name.Contains("ISO")) {v.Layer = "Small Stuff"; c = c + 1;}}c;}

//Delete parts with name ISO
{var c = 0; for (var v in doc.Scene.Descendants) { if v.Name.Contains("ISO")) {v.Delete(); c = c + 1;}}c;}

 

Wafer Box Case Study

One overlooked but key area to optimise is the load or whatever material you are handling in the model. There are often hundreds if not thousands of loads in a model so defeaturing or replacing the load with a simpler version can have a dramatic impact.


Looking at this Wafer box CAD created by Ran Erez. The CAD looks fantastic but to a simulation engineer it looks overly complicated. All the chamfers, rounded edges and little protruding parts add 0 simulation value, but they will heavily impact simulation performance.


Now lets look at it in the Mesh Profiler:


The part has 5200 faces which is insane considering it it a fairly simple box shape with some contouring. This part is used over 2000 times in it's associated model so reducing the complexity of this one piece of CAD will make a very big difference.


Below you can see my own version of the CAD which I created in Emulate3D using Box, Container and Wedge Visual. The result looks convincing, although side by side, a difference is visible, as it contains all the main elements needed for the overall shape.


My version has 132 faces. That's a 97.5% reduction in faces for this piece of CAD and a removal of over 10 million faces from the model just by spending 20 minutes remaking this one piece of CAD!




91 views0 comments

Recent Posts

See All
bottom of page