Closed Clarkszw closed 1 year ago
Thanks, Can you add a screenshot of the results, using primitives and not using primitives. Multiple Cylinders should be present with different scale and orientation.
Thanks!
Thanks, Can you add a screenshot of the results, using primitives and not using primitives. Multiple Cylinders should be present with different scale and orientation.
Thanks!
Here is the screenshot with primitive:
This is without primitive:
code for the generation:
from fury import window, actor
import numpy as np
scene = window.Scene()
showm = window.ShowManager(scene,size=(1024, 720), reset_camera=False)
showm.initialize()
centers = np.random.rand(11,3) * 3
directions = np.random.rand(11,3) - 0.5
heights = np.random.rand(11)
colors = np.random.rand(11,3)
cylinders = actor.cylinder(centers, directions, colors,
radius=0.3 ,heights=heights, capped=True,
# repeat_primitive=False)
scene.add(cylinders)
showm.start()
window.record(scene, out_path='viz_cylinders.png',size =(1024,720))
I saw that in your screenshot the two methods generated perpendicular cylinders(which should identical except colours). But mine deviations of directions are random..
I will try to check how two methods using “directions”..
In both cylinder actor, are you making sure to use the same direction (random or not) , the same direction should be used.
If it work correctly, they should blend and be identical, with weird color.
in your case, they should all be the same so there is clearly some wrong in the script you run.
I have fix the prim_cylinder()
,now it create the primitive cylinder along x axis as no primitive
.
Both methods generates the same shape of cylinders at the same positions.
If we shift a bit the centers of two methods, one can see they are parallel.
Here is code for the test:
from fury import window, actor
import numpy as np
scene = window.Scene()
showm = window.ShowManager(scene, size=(1024, 720), reset_camera=False)
showm.initialize()
centers = np.random.rand(11, 3) * 3
directions = np.random.rand(11, 3) - 0.5
heights = np.random.rand(11)
colors_1 = np.random.rand(11, 3)
colors_2 = np.random.rand(11, 3)
cylinders_1 = actor.cylinder(centers, directions, colors_1,
radius=0.3, heights=heights, capped=True,
repeat_primitive=False)
centers_2 = centers.copy()
# centers_2 = centers + 0.1
cylinders_2 = actor.cylinder(centers_2, directions, colors_2,
radius=0.3, heights=heights, capped=True,
repeat_primitive=True)
scene.add(cylinders_1, cylinders_2)
showm.start()
Nice, thanks @Clarkszw! no time today or this weekend, so I will look more in details this Monday or Tuesday
Fix the issue: Cylinder actor needs to use repeat_primitives by default #531 It has passed the test originally written for cylinder.
pytest -svv fury/tests/test_actors.py::test_advanced_geometry_actor fury/tests/test_actors.py::test_actors_primitives_count
Should I write another test for new
repeat_primitive
parameter incylinder()
?