Encyclopaedia Index

WORKSHOP - CAD Import: Splitting a CAD file into individual objects

Overview

When a CAD file is imported into PHOENICS, it forms a single object, even if the file contains several distinct bodies. In many cases this is perfectly acceptable, but sometimes it causes problems. If one part is made of a different material than the others, or if a boundary condition such as a heat source is to be applied to one part, this would not be possible.

The solution is to split the single object back into the individual parts. If this can be done in the CAD program, this is the best option. If this is not possible, for whatever reason, the FacetFix utility program can be used.

In this tutorial we will import a single STL file containing three separate objects. We will then use FacetFix to split the resulting geometry DAT file up into the three constituent parts, repairing errors at the same time.

In this way FacetFix can be used to split (and/or repair) CAD geometries in formats that FacetFix cannot handle directly

The full geometry of the case is shown in Figure 1 below.

 

Figure 1. The geometry of the CAD import example

The CFD solution is not of interest for this tutorial.

A complete step-by-step guide, showing how to set the case from the default mode of operation, is provided below.

Accessing PHOENICS-VR.

From the system level:

To enter the PHOENICS-VR environment, click on the PHOENICS icon on the desktop, or click on Start, programs, PHOENICS, PHOENICS.

From the commander level:

To enter the PHOENICS-VR environment, click on the 'Run vre' icon in the left column.

 

In PHOENICS-VR environment,

 

Start with an 'empty' case - click on 'File' then on 'Start New Case', then on 'Core'', then click on 'OK'; to confirm the resetting.

 

To enter VR Editor:

 

This is the default mode of operation.

Within VR Editor.

Import the STL file

Click on on the VR-Editor panel (or the O icon on the tool bar) to bring up the Object Management Dialog; and then on 'Object', 'New', 'New object'.

Click on the 'Shape' tab, then on 'CAD file'.

In the file browser, browse to \phoenics\d_polis\d_wkshp\cadimprt, and select the file building.stl. Click 'Open'.

On the Import STL Data dialog that opens, click OK to accept the setting that the converted geometry file is to be placed in the current working directory. (If this were a common geometry that was to be used in many projects, it would be better to place it in the central store so that it was easily accessible). The following dialog should appear:

Change the 'No' next to 'Take size from CAD file' to 'Yes', then click 'OK'. The converted geometry file will now be read in. The size of the new object will be set to 5.5m * 2.3m * 4.8m, at 0.0, 0.0, 0.0.

Click OK to close the Object specification dialog.

On the toolbar, click the down arrow next to and select 'Fit to window'. The screen should look like this:

There are obvious holes in the blocks, which need to be repaired. At the same time, we want to make each block a separate object.

Splitting the object and Repairing the error

The utility program FacetFix can be used to repair many common errors in geometry files and to split into closed volumes. To start FacetFix, click 'Run', 'Utilities', 'FacetFix'. The FacetFix GUI should appear:

image001.gif (7187 bytes)

Click 'Browse for input', change file type from STL to DAT, select building.dat and click 'Open'. Enter split-build in the 'Output file' box, and tick 'Multiple files'. Click 'Run FacetFix'. After a short while the FacetFix dialog will close, indicating that the repair is finished.

To open the corrected and split geometry files, click on on 'Object', 'New', 'New object' in the Object Management Dialog.  Go to the 'Shape' page. Click 'Import by group'.  Note that this button only appears for a new object. It does not appear for pre-existing objects.

On the group CAD import dialog, click 'Browse for CAD files'. In the file browser, select split-build_3.stl, split-build_2.stl,split-build_1.stl and split-build_0.stl.

Split-build_0.stl is a place-holder, in that it has its origin set to the bottom-leftmost corner of all the imported object, and its size covers all the objects. It is important that this file, split-build_0.stl, should be first in the list of files to import. Due to a 'quirk' in Windows, it has to be the last file selected!

Click 'Open' to close the file browser. You can check the import order by clicking 'List selected files'. Split-build_0.stl should be at the top of the list. 'OK' to close the Object Specification dialog.

The screen should now look like:

Four new objects have appeared, one for each of the imported STL files. B2 could now be deleted, as it is not a 'real' shape, just a position and size indicator. B1 can also be deleted as it is no longer needed.

Checking for Detection Problems

Having imported the geometry, it is worth checking to see if it will be detected properly by the Earth solver. Do do this, we need to set a mesh and perform 2 or 3 sweeps (iterations).

Click on the Mesh toggle on the hand-set or toolbar. The default grid should look like this:

Click  on the Mesh toggle to turn off the mesh display.

Click on on the hand-set or M on the toolbar to bring up the main Menu. Go to the Numerics page. Change the 'Total number of iterations' to 2, then Top Menu, OK to close the Main Menu.

Click 'Run' 'Solver' to make the Earth run.

Once the Solver run has finished, enter the VR-Viewer to examine the solution (Click 'Run' - 'Post processor' ,'GUI ').

In the Viewer, switch the plotting plane to Z (click Z on the handset or toolbar), and select the property-marker variable PRPS by clicking the icon on the hand-set or toolbar, then selecting PRPS from the list of variables. Switch the contours on by ticking 'Show contours' on the Viewer Options dialog, or by clicking on the hand-set or toolbar. The PRPS contours should be blue in the airspace, and red inside the buildings.

To see inside the objects, go to wireframe mode by clicking on the hand-set or toolbar.

Moving the probe up to around 0.9m, we can see that the objects are detected quite well.

By moving the probe up and down in Z, and also scanning through the X and Y planes you can get a feel for how well the shapes have been picked up.

You can increase the number of cells used and re-check the detection.

Saving the results.

In the PHOENICS-VR environment, click on 'Save as a case', make a new folder called 'CAD', select the new folder, and save as 'SPLIT'.