RMF
geometry.py

Show creation of geometry in an RMF

1 ## \example geometry.py
2 # Show creation of geometry in an RMF
3 
4 from __future__ import print_function
5 import RMF
6 
7 tfn = RMF._get_temporary_file_path("aliases.rmf")
8 print("File is", tfn)
9 
10 f = RMF.create_rmf_file(tfn)
11 f.add_frame("root", RMF.FRAME)
12 
13 r = f.get_root_node()
14 
15 bf = RMF.BallFactory(f)
16 cf = RMF.CylinderFactory(f)
17 sf = RMF.SegmentFactory(f)
18 
19 b = bf.get(r.add_child("ball", RMF.GEOMETRY))
20 b.set_radius(1)
21 b.set_coordinates(RMF.Vector3(0, 0, 0))
22 
23 c = cf.get(r.add_child("cylinder", RMF.GEOMETRY))
24 c.set_radius(.5)
25 c.set_coordinates_list([RMF.Vector3(0, 0, 0), RMF.Vector3(5, 5, 5)])