Tgeocad: an Interface Between ROOT and CAD Systems ROOT Users Tgeocad: an Interface Between ROOT and Workshop Cinzia Luzzi CAD Systems Introduction
Total Page:16
File Type:pdf, Size:1020Kb
TGeoCAD: an interface between ROOT and CAD systems ROOT Users TGeoCAD: an interface between ROOT and Workshop Cinzia Luzzi CAD systems Introduction Components STEP (ISO 10303) ROOT Users Workshop OpenCascade TGeoCAD Cinzia Luzzi conversion concepts University of Ferrara - CERN Structure of the TGeoCAD Interface 11 March 2013 TGeoCAD classes Requirements 1 / 19 TGeoCAD TGeoCAD: an interface between Why? ROOT and CAD systems Often, a very high precision in the description of the detector geometry is ROOT Users essential to achieve excellent results of the experiment. Therefore, the Workshop necessity to make easier the collaboration between physicists and engineers Cinzia Luzzi led to the implementation of an interface between the ROOT simulation Introduction software and the CAD systems. The TGeoCAD interface enables the use of ROOT files in several Components STEP (ISO CAD systems. 10303) OpenCascade TGeoCAD conversion concepts Structure of the TGeoCAD Interface TGeoCAD classes Requirements 2 / 19 TGeoCAD: Components TGeoCAD: an interface between ROOT and CAD systems • ROOT ROOT Users • Open CASCADE Technology Workshop Cinzia Luzzi (OCCT): • Open source software Introduction development platform. Components STEP (ISO • C++ components for 3D 10303) OpenCascade surface and solid modeling, TGeoCAD visualization, data exchange conversion concepts and rapid application development. Structure of the TGeoCAD • STEP Standard and CAD Interface TGeoCAD systems. classes Requirements 3 / 19 STEP format (ISO 10303) TGeoCAD: an interface • ISO Standard for the Exchange of Product model data. between ROOT and • Represents 3D objects in Computer-aided design (CAD) CAD systems and related information. ROOT Users • The Application Protocols (AP) are the top parts of the Workshop Cinzia Luzzi STEP Standard: • Grouped into three main areas:design, manufacturing and Introduction life cycle support. Components STEP (ISO • OCCT creates files according to STEP AP203 / AP214 10303) OpenCascade parts: TGeoCAD • Part 203:configuration controlled 3D designs of mechanical conversion concepts parts and assemblies. • Structure of Part 214:core data for automotive mechanical design the processes. It is the default format used by OCCT. TGeoCAD Interface • EXPRESS data modeling language used to describe data TGeoCAD classes models. Requirements • Step-File (Part 21): encoding mechanism on how to represent data according to their EXPRESS schema. 4 / 19 OpenCascade Foundation Data Toolkit TGeoCAD: an interface between ROOT and • Math utilities (Primitive CAD systems Geometric Types) provides: ROOT Users Workshop • Description of elementary Cinzia Luzzi geometric shapes as points, vectors, lines, circles and Introduction conics, planes and elementary Components STEP (ISO surfaces; 10303) OpenCascade • Means for positioning TGeoCAD geometry in space or on a conversion concepts plane using an axis or a Structure of coordinate system; the • Definition of geometric TGeoCAD Interface transformations as translation, TGeoCAD classes rotation and symmetries; Requirements 5 / 19 OpenCascade Modeling Data Toolkit TGeoCAD: an interface • Data structures to represent 2D and 3D geometric and between ROOT and topological models. CAD systems • The topological library allows to build pure topological ROOT Users Workshop data structures and to defines relationships between simple Cinzia Luzzi geometric entities. Introduction • The abstract topological data structure describes the Components shape which can be divided into the following component STEP (ISO topologies: 10303) OpenCascade • VERTEX: zero dimensional element (point). TGeoCAD • EDGE: element created from a curve and vertices (1D). conversion concepts • WIRE: set of edges connected by their vertices. • FACE: part of a surface bounded by a number of closed wires. Structure of the It is two dimensional. TGeoCAD • Interface SHELL: set of faces connected by some of the edges of their TGeoCAD wire boundaries. classes Requirements • SOLID: part of 3D space limited by closed shells. • COMPSOLID: set of solids connected by their faces. • COMPOUND: group of any type of topological object. 6 / 19 OpenCascade Modeling Algorithm toolkit TGeoCAD: an interface between ROOT and CAD systems • Geometric and topological ROOT Users algorithms used in modeling: Workshop Cinzia Luzzi • allow to create vertices, edges, faces, solids; Introduction • allow to build primitive objects Components STEP (ISO (boxes, wedges and rotational 10303) OpenCascade objects); TGeoCAD • provides sweeping operations conversion concepts (Prism - linear sweep, Structure of Revolution - rotational sweep the and Pipe - general sweep) and TGeoCAD Interface boolean operations; TGeoCAD classes Requirements 7 / 19 Open Cascade Application Framework (OCAF) TGeoCAD: an interface • Based on an application/document architecture; between ROOT and • Provides an infrastructure to attach any data to any CAD systems ROOT Users topological element; Workshop • Cinzia Luzzi Document: container class for an application data; • Data structure are reference-key(labels) driven; Introduction • Data are implemented as attributes (shape, general, Components relationship etc) attached to reference-keys label; STEP (ISO 10303) • Set of labels organized in a tree structure. Each label has a OpenCascade TGeoCAD tag expressed as an integer value. conversion • A label is identified by a string build by concatenation of concepts tags from the root of the tree, for example [0:1:2]. Structure of the TGeoCAD Interface TGeoCAD classes Requirements 8 / 19 Data Exchange and Extended Data Exchange (XDE) module TGeoCAD: an interface • The basis of XDE (XCAF) is a framework based on OCAF. between ROOT and • Shapes are OCAF object and their locations are separated CAD systems entities. ROOT Users Workshop Cinzia Luzzi • XDE allows to work with assemblies and their attributes. An assembly consists of several components (shape, Introduction subshape), each of these components refers to a specified Components STEP (ISO shape with different locations. 10303) OpenCascade • A label can be attached to a main part or to a sub-part. TGeoCAD conversion To a simple shape or can be a located reference to another concepts one. Structure of the • STEPCAFControl Package (Data Exchange module) TGeoCAD Interface provides tools to write STEP file from XDE format; TGeoCAD classes Requirements • Allows software based on Open Cascade to exchange data with various CAD software; 9 / 19 TGeoCAD geomety conversion TGeoCAD: an interface • Shapes created step by step starting from points (edge, between ROOT and wire, face, shell and solid) such as: CAD systems • Box; ROOT Users • Workshop Parallelepiped; Cinzia Luzzi • Trapezoid; Introduction • Shapes created using OCCT capabilities for solid Components primitives creation and boolean operations such as: STEP (ISO 10303) • Tube; OpenCascade • Cone; TGeoCAD conversion • Sphere; concepts • Shapes created by using modeling algorithm (extrusions, Structure of the revolutions, lofts) applied to basic geometries such as: TGeoCAD Interface • Hyperboloid; TGeoCAD classes • TGeoCompositeShape created using OCCT boolean Requirements operations between two or more shapes; 10 / 19 TGeoCAD geomety conversion TGeoCAD: an interface TGeoTrd1 between ROOT and CAD systems Creates edges from points, wire from edges, faces (planar surfaces) ROOT Users Workshop from wires, shells from faces and Cinzia Luzzi solid from shells; Introduction Components TGeoCone STEP (ISO 10303) OpenCascade Starting from radius, creates inner TGeoCAD and outer cones; conversion concepts Substract the inner cone from the outer cone. Structure of the TGeoCAD Interface TGeoCompositeShape TGeoCAD classes Requirements Boolean operations between a box, a tube and a pgon. 11 / 19 TGeoCAD classes TGeoCAD: an interface between ROOT and TGeoToStep CAD systems Takes a gGeoManager pointer and ROOT Users Workshop gives back a STEP file; Cinzia Luzzi Introduction TGeoToOCC Components For each ROOT shape creates the STEP (ISO 10303) corresponding OCCT shape. OpenCascade TGeoCAD conversion concepts TOCCToStep Structure of Reproduces the ROOT tree the TGeoCAD (mother-children relationship) on Interface the XDE document and writes it TGeoCAD classes Requirements to the STEP file; 12 / 19 TGeoToOCC class TGeoCAD: an interface between Converts ROOT shapes to OCCT shapes. ROOT and CAD systems Each ROOT shape is translated in the correspondent OCC ROOT Users shape using the following methods: Workshop Cinzia Luzzi Introduction ROOT TGeoToOCC ROOT TGeoToOCC TGeoBBox OCC Box TGeoTrd2 OCC Trd Components STEP (ISO TGeoSphere OCC Sphere TGeoTubeSeg OCC Tube 10303) OpenCascade TGeoArb8 OCC Arb8 TGeoCtub OCC Cuttub TGeoCAD TGeoConeSeg OCC Cones TGeoTube OCC TubeSeg conversion TGeoCone OCC Cones TGeoPcon OCC Pcon concepts TGeoPara OCC ParaTrap TGeoTorus OCC Torus Structure of the TGeoGtra OCC ParaTrap TGeoPgon OCC Pgon TGeoCAD TGeoTrd1 OCC Trd TGeoEltu OCC Eltu Interface TGeoCAD TGeoHype OCC Hype TGeoXtru OCC Xtru classes Requirements TGeoComposite.. OCC Composite 13 / 19 TOCCToStep class TGeoCAD: an interface TOCCToStep::OCCShapeCreation between ROOT and Starting from the top of the ROOT geometry tree translates each CAD systems ROOT shape in the OCCT version. ROOT Users Workshop Cinzia Luzzi • For each shape a new label is Introduction written in the XDE document. The correspondance shape-label Components STEP (ISO is stored in a map of volumes 10303) OpenCascade and labels; TGeoCAD • If the shape-label conversion concepts correspondance is present in