RMF
geometry.py

Show creation of geometry in an RMF

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