Title: ROOT CATIA
1ROOT CATIA
(progress report)
- P. Biryukov
- (p.biryukov_at_gsi.de)
2Aim
- The aim of the work is to make ROOT geometry
available in CATIA and vice versa
- ROOT-gtCATIA
- export geometry from ROOT using RootToCatia(char
fn) function (automatically) - import geometry to CATIA using macros
(automatically)
CATIA
ROOT
Geometry
3Aim
- The aim of the work is to make ROOT geometry
available in CATIA and vice versa
- CATIA-gt ROOT
- mark geometry in CATIA and specify geometry names
(manually) - export STEP file with geometry (automatically by
CATIA) - create file with geometry description (partly
automatically using macros in CATIA) - convert geometry using CatiaToRoot (char fn)
function (automatically)
ROOT
CATIA
Geometry (STEP)
Types, Hierarchy
4Example CATIA-gtROOT
Create a geometry in CATIA
5Example CATIA-gtROOT
Mark the geometry
6Example CATIA-gtROOT
Export the geometry into a STEP file
... 51CARTESIAN_POINT('world.1',(-100.,-100.,-10
0.)) 55CRTESIAN_POINT('world.2',(-100.,100.,-1
00.)) 56CARTESIAN_POINT('world.3',(100.,100.,-
100.)) 57CARTESIAN_POINT('world.4',(100.,-100.
,-100.)) 58CARTESIAN_POINT('world.5',(-100.,-1
00.,100.)) 59CARTESIAN_POINT('world.6',(-100.,
100.,100.)) 60CARTESIAN_POINT('world.7',(100.,
100.,100.)) 61CARTESIAN_POINT('world.8',(100.,
-100.,100.)) 62CARTESIAN_POINT('trd2.1',(-100.
,-50.,-100.)) 63CARTESIAN_POINT('trd2.2',(-100
.,50.,-100.)) 64CARTESIAN_POINT('trd2.3',(100.
,50.,-100.)) 65CARTESIAN_POINT('trd2.4',(100.,
-50.,-100.)) 66CARTESIAN_POINT('trd2.5',(-10.,
-100.,20.)) 67CARTESIAN_POINT('trd2.6',(-10.,1
00.,20.)) 68CARTESIAN_POINT('trd2.7',(10.,100.
,20.)) 69CARTESIAN_POINT('trd2.8',(10.,-100.,2
0.)) 70CARTESIAN_POINT('tube.1',(0.,100.,60.))
71CARTESIAN_POINT('tube.2',(-10.,100.,60.))
72CARTESIAN_POINT('tube.3',(-40.,100.,60.))
73CARTESIAN_POINT('tube.4',(0.,-100.,60.))
...
7Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
2 TGeoTube tube 0 1 2 3 4 _at_end
2 TGeoTube tube 0 1 2 3 4 _at_end
8Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
Number of a record in the file (0, 1, 2, ...)
2 TGeoTube tube 0 1 2 3 4 _at_end
9Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
Type of the shape (TGeoBBox, TGeoTube, etc)
2 TGeoTube tube 0 1 2 3 4 _at_end
10Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
Name of the shape
2 TGeoTube tube 0 1 2 3 4 _at_end
11Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
Parent's number
2 TGeoTube tube 0 1 2 3 4 _at_end
12Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
Names of points, as they are named in STEP file
(e. g. in STEP file point could have a name
"tube.3" or "myBox.LeftBottom")
2 TGeoTube tube 0 1 2 3 4 _at_end
13Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
End of the record (all strings in the file must
be ended with "_at_end")
2 TGeoTube tube 0 1 2 3 4 _at_end
14Example CATIA-gtROOT
Write geometry description
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
TGeoTrd2 trd2 0 1 2 3 4 5 6 7 8 _at_end2 TGeoTube
tube 0 1 2 3 4 _at_end
2 TGeoTrap 0 1 2 3 4 _at_end
15Example CATIA-gtROOT
Execute "StepToRoot" function
StepToRoot("myDetector")
it loads STEP file (myDetector.stp)
it loads geometry description file
(myDetector.txt)
and it saves ROOT file (myDetector.root)
16Example CATIA-gtROOT
And as a result of the previous steps the
following ROOT geometry was created...
... and saved into myDetector.root file
17Example CATIA-gtROOT
...now it could be changed...
18Example CATIA-gtROOT
Execute "StepToRoot" function
RootToCatia("myDetector")
it loads ROOT file (myDetector.root)
and it saves file with geometry for CATIA
(myDetector.txt)
19Example ROOT-gtCATIA
The program creates myDetector.txt file
0 TGeoBBox world 0 1 2 3 4 5 6 7 8 _at_end1
catiaPoint (0)Point -100 -100 -100 _at_end2
catiaPoint (1)Point -100 100 -100 _at_end3
catiaPoint (2)Point 100 100 -100 _at_end4
catiaPoint (3)Point 100 -100 -100 _at_end5
catiaPoint (4)Point -100 -100 100 _at_end6
catiaPoint (5)Point -100 100 100 _at_end7
catiaPoint (6)Point 100 100 100 _at_end8 catiaPoint
(7)Point 100 -100 100 _at_end9 TGeoTrd2 trd2 0 10
11 12 13 14 15 16 17 _at_end10 catiaPoint (0)Point
-60 -50 -80 _at_end11 catiaPoint (1)Point -60 50
-80 _at_end12 catiaPoint (2)Point 60 50 -80 _at_end13
catiaPoint (3)Point 60 -50 -80 _at_end14 catiaPoint
(4)Point -30 -100 0 _at_end15 catiaPoint (5)Point
-30 100 0 _at_end16 catiaPoint (6)Point 30 100 0
_at_end17 catiaPoint (7)Point 30 -100 0 _at_end18
TGeoTube tube 0 19 20 21 22 _at_end19 catiaPoint
(0)BottomCentre 0 50 60 _at_end20 catiaPoint
(1)RMinPoint1 -20 50 60 _at_end21 catiaPoint
(2)RMax -30 50 60 _at_end22 catiaPoint (3)TopCentre
0 -50 60 _at_end
9 TGeoTrd2 trd2 0 10 11 12 13 14 15 16 17 _at_end10
catiaPoint (0)Point -60 -50 -80 _at_end
20Example ROOT-gtCATIA
Load geometry
21Example Comparing
Compare("myDetectorNew", "myDetectorOld",
"myDetectorCmp")
myDetectorOld.stp myDetectorOld.txt
myDetectorCmp.stp myDetectorCmp.txt
myDetectorNew.stp myDetectorNew.txt
22Progress
TGeoGtra can be converted from ROOT to CATIA, but
not from CATIA to ROOT TGeoTorus can be converted
from CATIA to ROOT and from ROOT to CATIA, but
can not be recreated as a solid in CATIA
(However it could be recreated as points)
23Marking geometry
...and so on
24Web site http//www-hades.gsi.de/biryukov/catia-r
oot/ Problem "What is required exactly?"
The end