This simple example makes an RMF file with several rigid copies of the same thing
6 file_name = RMF._get_temporary_file_path(
"reference_frame.rmfz")
7 print(
"file is", file_name)
9 fh.add_frame(
"first frame", RMF.FRAME)
11 rh = fh.get_root_node()
13 reference_frame_factory = RMF.ReferenceFrameFactory(fh)
14 ball_factory = RMF.BallFactory(fh)
15 particle_factory = RMF.ParticleFactory(fh)
16 color_factory = RMF.ColoredFactory(fh)
17 bond_factory = RMF.BondFactory(fh)
19 origin = rh.add_child(
"origin", RMF.REPRESENTATION)
20 pd = particle_factory.get(origin)
26 c = rh.add_child(str(i), RMF.REPRESENTATION)
27 pd = particle_factory.get(c)
35 frame = rh.add_child(
"frame", RMF.REPRESENTATION)
36 rbo = reference_frame_factory.get(frame)
39 pd = particle_factory.get(frame)
45 ch = frame.add_child(
"site", RMF.GEOMETRY)
49 ball_factory.get(ch).set_coordinates(v)
50 ball_factory.get(ch).set_radius(1)
51 bch = frame.add_child(
"bond", RMF.BOND)
52 bond_factory.get(bch).set_bonded_0(ch.get_id().get_index())
53 bond_factory.get(bch).set_bonded_1(frame.get_id().get_index())