TGeo/CAD Interface Status Report C inzia Luzzi - C E R N - - PowerPoint PPT Presentation
TGeo/CAD Interface Status Report C inzia Luzzi - C E R N - - PowerPoint PPT Presentation
TGeo/CAD Interface Status Report C inzia Luzzi - C E R N Objective of the work Write the prototype of an interface between the TGeo geometrical modeler from Root (http://root.cern.ch) and the CATIA system (http://www.3ds.com/products/catia)
Objective of the work
Write the prototype of an interface between the TGeo geometrical modeler from Root (http://root.cern.ch) and the CATIA system (http://www.3ds.com/products/catia)
C ATIA (Computer Aided Three-dimensional Interact ctive Application)
- 3D Product Lifecycle
Management software suite:
– supports multiple stages of
product development from:
- Conceptualization
- design (CAD),
- manufacturing (CAM),
- and engineering (CAE).
- Can be customized via:
– Visual Basic and C++
programming languages;
– API called CAA2 or CAA V5;
- Catia V5 features a parametric
solid/surface-based package.
STEP AP203/ AP214 format
- STEP: ISO Standard for the Exchange of Product model data.
- STEP AP203 / AP214 format are part of the STEP areas design:
– Part 203: Configuration controlled 3D designs of mechanical parts
and assemblies.
– Part 214 - Core data for automotive mechanical design processes.
- V5 - STEP AP203/AP214 CATIA Interface:
– Allows to interactively read and write data in STEP AP203 / AP214
data formats.
- Its supports geometry and assembly structures and handles
topology (shells, solids) on export and import.
– For instance, you can read a STEP file, edit its content in
V5 workbenches, and save the results directly as a STEP file.
OCC (O (Open CASCADE) Architecture
- Software development platform:
includes components for 3D surfance and solid modeling, visualization and data exchange;
- Data Exchanges: allows software
based on OCC Technology to exchange data with various CAD software;
– Read and Write 3D data as
STEP format (AP203, AP214 and AP209) , for 3D geometry and topology;
Structu ture of the proto totype
TGeo Plugin Library OpenCascade System CATIA Tgeo/OCC interface Step file creation
The TGeo Plugin Library allows to reproduce a TGeo geometry in the Open Cascade System (OCC); The Step OCC component is used to translate OCC models to STEP file; The STEP file created by the procedure above can be loaded and used in CATIA.
TGeo Plugin Library: GeoCAD
- OCC must be installed;
- A TGeo geometry must be loaded in memory by:
– Root file; – Root macros;
root[0] gSystem->Load("libGeoCad.so"); root[1] .x roottest.C root[2] TRootCatia * myGeom = new TrootCatia (gGeoManager); root[3] myOCCGeometry->CreateGeometry();
TGeo plugin library: GeoCAD
- TObject-based class: allows the connection of a TGeo
geometry to the OCCStepFile object;
- OCCStepFile class: takes a TGeo geometry and builds an
OCC geometry based on it.
- TGeoOCC class: allows TGeo geometry translation by
methods that take the TGeo objects information as input and create the corresponding OCC shapes.
- TGeoOCC method: generates a STEP file from the OCC
geometry created.
TGeo plugin library: GeoCAD
TRootCatia OCCStepFile TGeoOCC
- Reads the all Root geometry tree;
- Finds shapes information and calls
the corresponding OCCRoot methods;
- It is inherited from the TGeoOCC class;
- Allows:
- Translate shapes;
- Write Step File;
- Takes a gGeoManager pointer;
- Creates an OCCStepFile object;
- Calls OCCStepFile methods:
- ReadGeometry;
- WriteStepFile;
Founda dation Data Toolkits
Providing most basic services: Primitive Geometric Types provides: Descriptions of elementary geometric shapes as Points,Vectors, Lines, Circles and conics, planes and elementary surfaces. Positioning of these shapes in space or in a plane by means of an axis or a coordinate system; Definition and application of geometric transformations to these shapes as Translation, Rotation and Symmetries. In particular I used:
The gp packages defines the basic non-persistent geometric entities used for algebraic calculation and basic analytical geometry in 3d space. It also provides basic transformations such as identity, rotation, translation, mirroring, scale transformations, combinations of transformations, etc.
Modeling Data Toolkits
- Supplies data structures to represent 3D geometric models; Has been
useful:
– TKBRep packages: allows to build pure topological data structures .
Topology defines relationships between simple geometric entities. In this way it's possible to model complex shapes as assemblies of simpler entities.
– TopoDS_Shape: most generic class that describes data structures of
- bjects in parametric space. Types of shapes are:
- Vertex: is defined in terms of localization in parametric space;
- Face and shape: are defined in terms of restriction of this space.
- These shapes can be combined into sets.
- You can give a shape an orientation and a location.
- Orientation: tells how the shape being referenced is used in a
boundary;
- Local reference coordinate allows us to reference a shape at a
position different from that of its definition.
Topological Type
- A topological model can be considered as a graph of objects with
adjacency relationships; The OCC topological type are:
– COMPOUND: group of any type of topological object. – COMPSOLID: set of solids connected by their faces. It expands
the notions of WIRE and SHELL to solids.
– SOLID: part of space limited by shells. It is three dimensional. – SHELL: set of faces connected by their edges. Can be open or
closed.
– FACE: part of a surface. Its geometry is constrained (trimmed) by
- contours. It is two dimensional.
– WIRE: set of edges connected by their vertices. – EDGE: topological element corresponding to a restrained curve.
An edge is generally limited by vertices. It has one dimension.
– VERTEX: topological element corresponding to a point. It has zero
dimension.
– SHAPE: generic term covering all of the above.
- Each translated shapes in the GeoCad plugin library is added to a
compound; it will be write on the STEP file;
Modeling Algorithm toolkits
- Providing a range of topological algorithms used in
- modeling. Has been useful:
– TKTopAlgo packages that provides an Application
Programming Interface (BRepBuilderAPI) for Standard topological objects combining topological data structure and boundary representation to allow creating vertices ,edges, faces, solids, sweeping operations, boolean operations and global properties computation;
– For example:
- BrepBuilderAPI_MakeEdge(vertices);
- BrepBuilderAPI_sewing(): assemble contiguous shapes into
- ne shape.
Modeling Algorithm toolkits
- Boolean operations are used to create
new shapes from the combinations of two shapes S1, S2.
– BrepAlgoAPI_Fuse: gets all the
points in S1 or S2.
– BRepAlgoAPI_Common: gets all
the points in S1 and S2.
– BRepAlgoAPI_Cut: gets all the
points in S1 and not in S2.
- Boolean operations has been useful
when there was no OCC Algorithm for reproduce some root shapes;
- TKPrim packages: describes functions
to build Cylinder, Cone, Torus, Wedge
- r parts of them:
– BrepPrimAPI_MakeCylinder, – BrepPrimAPI_MakeCone, – BrepPrimAPI_MakeTorus etc.
DataEx Exchange Toolkits
- Allows software based on Open Cascade to exchange data
with various CAD software;
- Has been useful:
– TKSTEP packages: translates Open CASCADE models
to STEP files.
- STEPControl_Writer class: creates and writes STEP files from
Open CASCADE models.
- STEPControl_StepModelType: is an Enumerations that
defines the STEP entity type. I used:
– STEPControlStd_AsIs translates a shape to its highest
possible STEP representation.
Shapes s Creation
- Shapes created as hierarchy
- f point, edge, wire, face, shell
and solid are:
– Box; – Parallelepiped; – Trapezoid;
- Shapes created directly by
modeling algorithms and boolean operations are:
– Tube; – Cone; – Sphere; – Torus;
CATIA A Root Geometry reproduction
CATIA
ROOT
What I already did
- Created the GeoCad root plugin that is able to translate full
root geometries in the OCC ones:
– TGeoBox;
- TGeoTrd1;
– TGeoPara;
- TGeoTrd2;
– TGeoTrap;
- TGeoGTrap;
– TGeoArb8;
- TGeoTube;
– TGeoTubs;
- TGeoCtube;
– TGeoEltu;
- TGeoCone;
– TGeoCons;
- TGeoSphere;
– TGeoTorus;
- Added the GeoCad module to root and compiled it with the
necessary configuration rules;
- Imported and tested the STEP file in CATIA;
What t will be th the next step?
- Improve the existing translation methods;
- Translate the other shapes:
– TGeoPcon;
- TGeoPgon;
– TGeoHype;
- TGeoXtru;
– TGeoParaboloid;
- TGeoComposite;
- Catia-TGeo conversion:
– It is in principle possible to build in memory any kind of
structure beyond GDML that can be used in the Root system;
– Catia have not hierarchy information, needs human
intervention for the necessary others root information;
– Need to implement a converter to "optimise" the parametric
volumes used to reproduce a CATIA solid;
Rotation Example:
- Trasformation is used for rotation and traslation of TgeoTub,
TgeoCone, TgeoCtub etc
gp_Trsf TT; TT.SetRotation(gp_Ax1(gp_Pnt(0.,0.,0.),gp_Vec(0.,0, 1.)), Ang);
- gp_Trsf: defines a non-persistent transformation in 3D space.
- SetRotation: Changes the transformation into a rotation. gp_Ax1 is
the rotation axis and Ang is the angular value of the rotation in radians.
- gp_Ax1: describes an axis in 3D space by its origin and its unit vector
("main Direction").
- gp_Pnt: defines a non-persistent 3D cartesian point.
- gp_Vector: defines a non-persistent vector in 3D space.
Tube construction
TopoDS_Solid inner = BrepPrimAPI_MakeCylinder(minradius,length,angle); TopoDS_Solid outer = BrepPrimAPI_MakeCylinder(maxradius,length,angle); BRepAlgoAPI_Cut cutResult(outer, inner);
TopoDS_Solid: modeling data class that describes a solid; BrepPrimAPI_MakeCylinder: modeling Algorithm class that makes a cylinder; BrepAlgoAPI_Cut: boolean aperation that gets all the points is the outer surfance but not in the inner surfance.
TGeoTub e CATIATu be
Cone Construction
inner = BrepPrimAPI_MakeCone(R1,R2,H,angle);
- uter = BrepPrimAPI_MakeCone(R1,R2,H,angle);
BRepAlgoAPI_Cut cutResult(outer, inner);
BrepPrimAPI_MakeCone: Make a cone of height H radius R1 in the plane z = 0, R2 in the plane Z = H. Take a section of <angle>
Torus Construction
TopoDS_Shell Min = BRepPrimAPI_MakeTorus(Rtor,Rmin,DPhi); TopoDS_Shell Max = BRepPrimAPI_MakeTorus(Rtor,Rmax,DPhi); BRepAlgoAPI_Cut cutResult(Max, Min);
BrepPrimAPI_MakeTorus: Make a section of a torus of radii R1 R2.