TGeo/CAD Interface Status Report - CERN Indico

16
TGeo/CAD Interface Status Report Cinzia Luzzi

Transcript of TGeo/CAD Interface Status Report - CERN Indico

TGeo/CAD Interface

Status Report

Cinzia Luzzi

Objective of the work

Write the prototype of an interface between the TGeo

geometrical modeler from Root (http://root.cern.ch)

and the CATIA CAD system

C A TIA

(Computer Aided Three-dimensional Interactive

Application)

● 3D Product Lifecycle

management software suite:

– supports multiple stages of

product development from:

● Conceptualization;

● design (CAD);

● manufacturing (CAM);

● engineering (CAE).

● Can be customized via:

– Visual Basic and C++

programming languages;

– API called CAA2 or CAA V5;

● CatiaV5 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.

OpenCascade (OCC) Architecture

● Software development platform:

– includes components for 3D

surface 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;

Structure of the prototype

● The TGeo Plug-in Library allow

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

OpenCascade System

CATIA

Tgeo/OCC interface

Step file creation

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 *myOCCGeom = 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.

OpenCascadeToolkits

● Foundation Data Toolkits: 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.

● Modeling Data Toolkits: Supplies data structures to represent 3D geometric

models:

– allows to build pure topological data structures that defines relationships

between simple geometric entities. In this way it's possible to model

complex shapes as assemblies of simpler entities.

– Allow to describe data structures of objects in parametric space.

OpenCascade Toolkits ● Topological OpenCascade Type:

– COMPOUND: group of any type of topological object.

– COMPSOLID: set of solids connected by their faces.

– SOLID: part of space limited by shells. It is three dimensional.

– SHELL: set of faces connected by their edges.

– FACE: part of a surface. It is two dimensional.

– WIRE: set of edges connected by their vertices.

– EDGE: topological element corresponding to a restrained curve. It has one

dimension.

– VERTEX: topological element corresponding to a point. It has zero dimension.

● Each translated shapes in the GeoCad plug-in 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:

– Application Programming Interface for Standard topological objects combining

topological data structure and boundary representation to allow creating vertices,

edges, faces, solids and doing sweeping operations, boolean operations and global

properties computation;

OpenCascade useful 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 and to translate

TGeoComposite shapes;

OpenCascade useful Toolkits

● DataExchangeToolkits: allows software based on Open Cascade to exchange

data with various CAD software:

– STEPControl_Writer class: creates and writes STEP files from Open CASCADE models.

– Step File Example:

ISO-10303-21;

HEADER;

FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');

FILE_NAME('Open CASCADE Shape Model','2010-03-08T13:43:52',('Author'),('Open

CASCADE'),'Open CASCADE STEP processor 6.3','Open CASCADE 6.3','Unknown');

FILE_SCHEMA(('AUTOMOTIVE_DESIGN_CC2 { 1 2 10303 214 -1 1 5 4 }'));

ENDSEC;

DATA;

#1 = APPLICATION_PROTOCOL_DEFINITION('committee draft','automotive_design',1997,#2);

#2 = APPLICATION_CONTEXT('core data for automotive mechanical design processes');

#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);

#4 = PRODUCT_DEFINITION_SHAPE('','',#5);

#5 = PRODUCT_DEFINITION('design','',#6,#9);

#6 = PRODUCT_DEFINITION_FORMATION('','',#7);

………

Shapes Creation

● Shapes create as hierarchy of

point, edge, wire, face, shell

and solid are:

– Box;

– Parallelepiped;

– Trapezoid;

● Shape create directly by

modeling algorithms and

Boolean operations are:

– Tube;

– Cone;

– Sphere;

– Torus;

CATIA Root Geometry reproduction

RootGeom geomBrahms

What I already did

● Created the GeoCad root plug-in that is able to translate almost

all root shapes in the OCC ones, read and translate all root tree;

● Added the GeoCad module to root and compile it with the

necessary configuration rules;

● Created OCC geometry and translated it in a STEP file format;

● Imported and tested the STEP file in CATIA;

What will be the next step?

● Perform the existing translation methods;

● Improve the plug-in execution time;– Boolean opencascade operation sometimes are slow;

– Full big geometry translation can be slow, yet!

● Translate the other last shapes:

– TgeoHype;

– TgeoParaboloid;

– TgeoXtru;

● 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 hierarchical information, needs human intervention for the necessary extra root information;

– Needs to implement a converter to "optimize" the parametric volumes used to reproduce a CATIA solid;