for n in xrange(1,9): p1 = oct.childCenter(n) myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.yellow)) print "id=%i" % (n), print p1.str() """ xar = camvtk.Arrow(color=red, rotXYZ=(0, 0, 0)) myscreen.addActor(xar) yar = camvtk.Arrow(color=green, rotXYZ=(0, 0, 90)) myscreen.addActor(yar) zar = camvtk.Arrow(color=blue, rotXYZ=(0, -90, 0)) myscreen.addActor(zar) oc2 = cam.OCTest() oc2.set_max_depth(5) svol = cam.SphereOCTVolume() svol.radius = 3.1415 svol.center = cam.Point(-1, 2, -1) oc2.setVol(svol) oc2.build_octree() oc3 = cam.OCTest() svol3 = cam.SphereOCTVolume() svol3.radius = 2 svol3.center = cam.Point(-1, 2, 1)
for n in range(1,9): p1 = oct.childCenter(n) myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=camvtk.yellow)) print("id=%i" % (n),) print(p1.str()) """ xar = camvtk.Arrow(color=red, rotXYZ=(0,0,0)) myscreen.addActor(xar) yar = camvtk.Arrow(color=green, rotXYZ=(0,0,90)) myscreen.addActor(yar) zar = camvtk.Arrow(color=blue, rotXYZ=(0,-90,0)) myscreen.addActor(zar) oc2 = cam.OCTest() oc2.build_octree() nlist = oc2.get_all_nodes() print("got ", len(nlist), " nodes") for node in nlist: print(node.str()) if node.type == cam.OCType.WHITE: sph_color = camvtk.white if node.type == cam.OCType.BLACK: sph_color = camvtk.red p1 = node.nodePoint(0) myscreen.addActor( camvtk.Sphere(center=(p1.x, p1.y, p1.z), radius=0.1, color=sph_color))