|
| | scene_particle_gate.R1 |
| |
| | scene_particle_gate.R2 |
| |
| | scene_particle_gate.OFF |
| |
| | scene_particle_gate.b = geom.SceneBuilder() |
| |
| | scene_particle_gate.s1 = b.add_leaf("sphere", [R1], translation=[-OFF, 0.0, 0.0]) |
| |
| | scene_particle_gate.s2 = b.add_leaf("sphere", [R2], translation=[+OFF, 0.0, 0.0]) |
| |
| | scene_particle_gate.db = b.add_union(s1, s2) |
| |
| | scene_particle_gate.props = b.body_properties(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) |
| |
| | scene_particle_gate.home = b.principal_frame(db, lo=[-0.8, -0.5, -0.5], hi=[0.8, 0.5, 0.5], n=40) |
| |
| | scene_particle_gate.ph = b.body_properties(home, lo=[-0.9, -0.6, -0.6], hi=[0.9, 0.6, 0.6], n=40) |
| |
| | scene_particle_gate.com = np.array(props["com"]) |
| |
| | scene_particle_gate.inv_i_unit = tuple(props["mass"] / np.maximum(np.array(ph["principal"]), 1e-12)) |
| |
| | scene_particle_gate.bound = float(OFF + max(R1, R2) + abs(com[0]) + 0.05) |
| |
| int | scene_particle_gate.NB = 96 |
| |
| float | scene_particle_gate.half = bound * 1.05 |
| |
| int | scene_particle_gate.sp = 2 * half / (NB - 1) |
| |
| | scene_particle_gate.gridf |
| |
| | scene_particle_gate.grid3 = gridf.reshape(NB, NB, NB, order="F") |
| |
| | scene_particle_gate.verts |
| |
| | scene_particle_gate.faces |
| |
| | scene_particle_gate._ |
| |
| | scene_particle_gate.level |
| |
| | scene_particle_gate.spacing |
| |
| | scene_particle_gate.step = max(1, len(verts) // 400) |
| |
| | scene_particle_gate.shell = np.ascontiguousarray(verts[::step], dtype=np.float32) |
| |
| | scene_particle_gate.a1 = OFF + com[0] |
| |
| | scene_particle_gate.a2 = OFF - com[0] |
| |
| float | scene_particle_gate.PEN = 0.08 |
| |
| float | scene_particle_gate.DX = a1 + a2 + (R1 + R2) - PEN |
| |
| | scene_particle_gate.touch = a1 + a2 + R1 + R2 |
| |
| | scene_particle_gate.st |
| |
| | scene_particle_gate.sg |
| |
| int | scene_particle_gate.ok1 = abs(st - touch) < 5e-3 and abs(sg - touch) < 3 * sp |
| |
| | scene_particle_gate.Tt |
| |
| | scene_particle_gate.Vt |
| |
| | scene_particle_gate.Qt |
| |
| | scene_particle_gate.Tg |
| |
| | scene_particle_gate.Vg |
| |
| | scene_particle_gate.Qg |
| |
| | scene_particle_gate.dpos = np.abs(Tt - Tg).max(axis=(1, 2)) |
| |
| | scene_particle_gate.dvel = np.abs(Vt - Vg).max() |
| |
| | scene_particle_gate.dquat = np.abs(Qt - Qg).max() |
| |
| int | scene_particle_gate.ok2 = dpos[-1] < 10 * sp |
| |