Converting and Importing Other CAD Format Files
Importing a CAD Object
Co-ordinate system origin
Alignment of axes
Assembling a Complete Geometry
Import by Group
If the geometry already exists as CAD geometry files, a considerable time saving can be achieved through the use of PHOENICS-VR's ability to import CAD files directly.
CAD-packages are frequently used to design engineering equipment. Most have the ability to define their output in a variety of formats. The formats supported directly by VR are:
|*.stl||Stereolithography file. This is available in many popular CAD programs as an export format. ASCII and binary forms are supported.|
|*.3ds||Autodesk 3ds Max (3D Studio)|
|*.wrl||Virtual Reality Modelling Language file|
|*.dw||Files generated by DesignWorkshop from Artifice|
|*.ac||Files generated by AC3D from Invis|
|*.iv||Files generated by Open Inventor|
|*.osg||Native OSG (OpenSceneGraph) ascii|
Many further formats are supported indirectly by translation to .3ds using SimLab Composer from SimLabSoft. This software is shipped with PHOENICS and runs silently whenever required. A licence key can be obtained directly from CHAM. The formats requiring Simlab Composer are:
|*.dxf||AutoCAD Drawing Exchange Format file|
|*.dwg||AutoCAD Drawing Database file(3D)|
|*.dwf||AutoCAD Design Web Format file|
|*.sldasm, *.sldprt||SolidWorks assembly and parts files|
|*.asm, *.par, *.psm||SolidEdge assembly and parts files|
|*.igs, *.iges||IGES (Initial Graphics Exchange Specification) file|
|*.iam, *.ipt||Autodesk Inventor assembly and parts files|
|*.sat||3D ACIS Modeler - Standard ACIS Text file|
|*.obj||Wavefront Technologies geometry definition file (OBJ)|
|*.xaml||Extensible Application Markup Language XAML file|
|*.3dxml||3DXML - Dassault Systemes 3DVIA file|
|*.u3d||Universal 3D file|
|*.dae||COLLADA Digital Asset Exchange file|
|*.fbx||Autodesk FBX Technology file|
PHOENICS VR converts the CAD file to the PHOENICS-VR geometry format directly (or indirectly via SimLab) using the Datmaker utility. Once a CAD file is converted to the PHOENICS VR geometry format, its file extension is changed to '.DAT'. In addition, a JPEG thumbnail of the converted geometry is created. This can be used later to import another copy of the same geometry.
The new file is placed in the current working directory by default. Optionally, the new file can instead be placed in a central geometry store, \PHOENICS \D_SATELL \D_OBJECT \FROMCAD.
The local working directory should be used for geometries specific to a single project, or if the user does not have 'write' permission to the central store. The central store should be used for geometries which are to be shared between projects.
Each CAD file should ideally contain the geometry of only one object - as the entire contents of a CAD file are treated as a single VR object, it will not be possible to attach different attributes to different parts of the geometry. If the geometry consists of several objects with different attributes, then one file per object should be created using the CAD system and they can then be converted and imported into PHOENICS-VR individually.
If that is not possible, the import module DatMaker can be used to extract multiple objects from a single CAD or DAT file.
Many CAD and / or DAT files can be imported simultaneously, as explained below. See also the tutorials on importing CAD data.
A few points must be observed prior to generating files which are to be imported into PHOENICS, regardless of what CAD program is used:
At first sight, viewed from above, this geometry looks acceptable:
In fact, it will not work because none of the buildings have bottoms, so they are not closed volumes. This can be seen when viewed from below.
The solver will not detect anything!
Installations of PHOENICS created after May 2013 can utilise the Simlab Composer package from Simulation Lab Software Inc - www.simlab-soft.com.
PHOENICS checks if the Simlab Composer is activated and, if available, then uses this utility to convert any files falling outside of the standard list (shown above.) It does this, without the need for user interaction, first into 3DS format and then to the default .DAT format needed by PHOENICS.
The Simlab Composer is bundled with PHOENICS. All that is needed is an unlocking request to be made to CHAM, which holds a number of Simlab licence strings.
The Simlab Composer can be used in two different ways: 'passive' or 'active'. DatMaker uses Simlab in passive mode for the direct conversion of 3D CAD files into the PHOENICS .DAT geometry format without user interaction.
All the file extensions listed can be converted automatically in this way.
When used in active mode, the user accesses Simlab via the PHOENICS - VR Utilities menu. Simlab can also be used, for example, to create 3D PDF files for emailing results or geometry to customers.
These third-party programs from Okino Computer Graphics provide a very powerful suite of conversion utilities. They will translate almost any CAD format into almost any other. One of the available export options is STL, so these programs can be used to convert any CAD file into something useable by PHOENICS. The programs have limited capability to modify or repair the CAD model.
The AC3D program can import geometries in many 3D file formats including POV-Ray, VRML (1 and 2), RenderMan, 3D Studio 3DS, Lightwave, DXF, Alias triangle, Wavefront OBJ, Direct X, Milkshape, MD2, Quake 3 BSP.
It can perform Boolean operations on multiple objects - for example to join two intersecting objects and leave only the surfaces of the joined part. It can export PHOENICS geometry files, which are directly useable by the VR-Editor.
Locating and Loading the CAD File
CAD geometries are attached to objects just as the CHAM-supplied geometries are. They can be attached to new objects, or to existing objects. The CAD file(s) to be imported can be anywhere on the file system.
There are three ways of importing an existing CAD file:
then 'New', then 'Import CAD Object', then proceed as below; or,
Any of these actions will bring up a dialog box, which allows the type of file to be imported to be selected:
Click on 'CAD file', and a file browser will appear, with which the file to be imported can be selected:
A selection of example CAD files is supplied in the folders:
In this example, PIPES.STL has been selected. The CAD file can be located anywhere on the system.
Once 'Open' on the file selection dialog has been clicked, a confirmation of the input and output file names will be shown:
If happy to proceed, click OK, and the selected file will be translated using the DatMaker module. The options for DatMaker are as follows:
The last two options are mutually exclusive. In either case the names of the output files will be based on the original CAD file name with _1.dat, _2.dat, ... _n.dat added to the end. In addition, a file with a name ending _0.dat will also be created. This file marks the original orign and extent of the single CAD file. It is used as a place holder to ensure the separate files are imported in the correct locations relative to each other.
Note that the more repair processing is selected, the longer the repair may take.
Fitting the CAD Geometry to the Object
Once the translation is complete, the following dialog box will be shown:
This dialog shows how many points and facets were created, and shows the size and origin read from the CAD file. There are then two choices for the size and position:
Whichever option is chosen, the size and location of the object can be changed as desired later.
If the non-default second options are selected by clicking on the No buttons to change them to Yes, the dialog changes to this:
The object will be re-sized to the dimensions found in the CAD file, and placed at the location found in the CAD file. If the re-sized object does not fit inside the solution domain, the solution domain is re-sized to just encompass the new object. Clicking on 'Reset', 'Fit to Window' on the toolbar will rescale the view to show the entire domain.
If the ' Object constrained by domain' tickbox on the General page is cleared before importing the CAD file or 'Object constrained by domain' is set to No on the dialog, the domain will not be resized if the object becomes bigger than the domain.
Co-ordinate System Origin
The data-entry boxes labeled Xorg, Yorg and Zorg are used to locate the origin of the PHOENICS co-ordinate system relative to the CAD system. In the CAD system, it is often possible to locate geometries in the negative quadrants. In PHOENICS-VR only positive co-ordinates are allowed unless the ' Object constrained by domain' tickbox on the General page is cleared. Even then, the solution only takes place in the positive quadrant.
The values specified for Xorg, Yorg and Zorg are used to shift the object into the required position in the PHOENICS co-ordinate system. The relationship used is of the form:
XpVR = XpCAD-Xorg; YpVR = YpCAD-Yorg; ZpVR = ZpCAD-Zorg
Example 1, consider an object located at (-10,-20,0) in the CAD system. In the CFD simulation, this object is to be located at (5,10,0). The required settings for Xorg, Yorg and Zorg are -15, -30 and 0 respectively.
Example 2, consider an object located at (10,20,0) in the CAD system. In the CFD simulation, this object is to be located at (5,10,0). The required settings for Xorg, Yorg and Zorg are 5, 10 and 0 respectively.
If 'Object constrained by domain' is set to No, and 'Take position from geometry file' is set to 'Yes', the object will be positioned exactly as in the CAD file without using the offset values.
If the 'PHOENICS origin in CAD system' is 'At object position' as shown in the image, the input boxes are greyed out. Xorg, Yorg and Zorg are set equal to XpCAD,YpCAD, ZpCAD for the first object to be imported. This ensures that the first object is placed at the PHOENICS origin. Subsequent objects will be placed relative to the first. Thus if the objects referred to in Examples 1 and 2 above were to be imported 'At object position' in that order, object 1 would be placed at (0,0,0), and object 2 at (20,40,0). The relative positions are maintained.
If for any subsequent object XpCAD is less than Xorg (e.g. if object 2 were to be imported before object 1 above), Xorg is reset to XpCAD for the new (and subsequent) object to maintain positive PHOENICS co-ordinates. This will change the relative positions of the objects.
Therefore, it is best to always import the object with the lowest co-ordinates first, as all relative positions will then be maintained.
If the 'PHOENICS origin in CAD system' is 'User', the values Xorg, Yorg and Zorg in the input boxes will be used to locate the object as described above. These values should be set so as to place the object(s) in the required position in PHOENICS co-ordinates. These values thus define the PHOENICS origin in the CAD co-ordinate system.
Returning to the above examples, if both objects are imported with Xorg, Yorg and Zorg set to -15, -30 and 0, object 1 will be at (5,10,0), and object 2 at (25,50,0) again maintaining the relative positions.
The Geometry scaling factor allows the CAD data to be transformed from the CAD units to the units used in PHOENICS-VR. These are normally taken to be meters. Typical scaling factors are:
Note that the units of the CAD origin are always assumed to be meters. If they are not, the correct values must be input otherwise the object may be located incorrectly. When the scale is changed, the Xorg, Yorg and Zorg boxes are updated when 'Apply' is pressed.
Alignment of Axes
It is possible to change the alignment of the CAD and PHOENICS-VR axes. By default, the CAD and PHOENICS-VR axes will be the same. If the CAD geometry was created with, say, the X axis pointing up, but the simulation is to run with Y as up, clicking on the CAD X Y Z align with VR button will cycle the alignments through X Y Z, Y Z X and Z X Y. This will ensure that the dimensions of the object bounding box are set correctly. Further orientation changes within the bounding box can be made by clicking on the Rotate Object Down / Up buttons on the hand-set.
Import by Group
There are again three ways of importing several CAD (or DAT) files at one time. These are:
then 'New', then 'Import CAD Group', then proceed as below; or,
Any of the above options will display the Group CAD/DAT Import dialog.
The names of the CAD files to be imported are selected with a file browser. The list can contain a mixture of supported CAD data types and also DAT files.
If the 'PHOENICS origin in CAD system' is set to 'At object position', then for the first object to be imported, the object co-ordinates are located relative to the CAD origin, and the PHOENICS origin is located at the position of the object. For subsequent objects, the CAD origin will only be changed if the new object is at a location which is more negative than the first object in any of the X, Y or Z co-ordinate directions.
If the 'PHOENICS origin in CAD system' is set to 'User', then the values in the Xorg, Yorg and Zorg input boxes will be used to shift the objects as described above.
As a sequence of CAD objects is to be imported, it is important to set the origin of the CAD system correctly for the first object, so that the relative positioning is maintained.
If the sequence of STL (or DAT) files has been created by Datmaker from a single CAD (or DAT) file, a file named 'outputfile'_0.STL will have been created. This is a single facet which sets the origin and overall size of the imported objects. It should be the first on the list of files to be imported, as that will ensure that the following files are placed in the right positions.
The order of files can be checked by clicking 'List selected files'. The list-view display allows the files to be re-ordered as needed.
It can be easier to set 'Objects constrained by domain' to No before importing. Then all objects will go to the size and position set in the CAD files regardless of the size of the domain. Once they are all imported, they can be made into a Group and moved to a more convenient location and the domain can be made large enough to encompass them all. If required the 'constrained by domain' flag can be reset from the Object Management Dialog.
The Origin, Geometry scaling factor and CAD X Y Z alignment buttons are as described above for a single CAD file.
The type and attributes of the first object are copied to all the remaining objects in the list during the importation process. If the objects share many attributes, it is easier to set these for the first object before importing the list.
An alternative is to import each object in the assembly in turn using the 'Take size from geometry file' and 'Take position from geometry file' options, as described above.
Quite often, there will be a number of CAD files to import. It is important to keep their relative positions as they were in the CAD, but the absolute locations in the CAD system may not be known, and in any case are not important as the objects are to be placed in the PHOENICS domain.
Using the 'Import by group' feature described above, bring all the CAD files into the domain. The 'PHOENICS origin in CAD system' should be left at 'At object position'. If the bottom-leftmost object was first in the list, all the others will be correct. If it wasn't, the objects will not be correctly positioned relative to each other.
In that case, select all the objects just imported, and delete them. Repeat the import procedure. This time, 'PHOENICS origin in CAD system' will have been automatically reset to 'User', and the Xorg, Yorg and Zorg fields will have been filled with the CAD co-ordinates of the bottom-leftmost object. Leave these settings and perform the import.
All the objects will now be correctly placed relative to each other. They can be selected as a group and moved to the desired location in the domain.
Failure to translate ASCII STL files may be due to the lines ending with Line-feed, rather than Carriage-return+Line-feed. This can be corrected by reading the STL file into DOS Edit or WordPad, then saving it. It may be possible to change the output format settings in the CAD system to output a correct file, or to switch to binary format.
Another common error in CAD files is that the normals do not all face outwards. A symptom of this is that the object appears to change shape as the view is rotated, or it appears inside-out. If the setting 'View - Show back of objects' makes the image appear correct, it is a sure sign that some of the normals face in and not out. See the tutorial ' CAD Import: Importing and Repairing STL Files' for an example.
Although STL formally defines a closed volume, this is not guaranteed. Some STL files may contain holes or gaps between facets. These can lead to detection errors in the Earth solver.
Both types of errors can sometimes be fixed in CAD files using DatMaker, started from Settings - Datmaker operations. The tutorial mentioned above exemplifies the use of Datmaker as part of the process of importing a sequence of STL files.