decreasing the number of polygons in 3d objects

2 views
Skip to first unread message

Jason Grout

unread,
Mar 22, 2008, 11:56:13 AM3/22/08
to sage-...@googlegroups.com

I have a 3d plot with lots of arrow3d objects. When I have about 1000
arrows, the plot is very, very slow to display (it's a 3d vector field,
so 1000 arrows is sort of on the low end of objects). I assume that the
problem is the number of polygons in an arrow ( = cone+cylinder). I
don't need the high-definition versions of these objects; blocky
approximations that are perfectly okay. After poking around in the code
a bit, it seemed that the "ds" parameter of the RenderParams structure
was what needed to be changed, but I couldn't figure out how to change
it. Is there any way to say that I want the rendered cones and
cylinders to be rendered with, say, 4 sides instead of the current much
higher side count?


This problem and function came up when I showed Sage to a meteorology
student. He said that just the previous week, he had been searching for
and downloading software to do vector field plots to double-check his
homework answers. He was really excited to download and try out Sage.
He was impressed with how easy it was to create 2d vector field plots.
I whipped up a short plot_vector_field3d function, which is where the
above problem was manifest. I've posted this function up at:

http://trac.sagemath.org/sage_trac/ticket/2646

Thanks,

Jason

Robert Bradshaw

unread,
Mar 22, 2008, 2:00:00 PM3/22/08
to sage-...@googlegroups.com

The line3d command will produce much faster arrows:

line3d([(0,0,0), (1,2,3)], thickness=2, arrow_head=True)

The ds parameter is supposed to relate the size of the overall scene
to the number of pixels in the final render. I agree there needs to
be a better way to set it.

- Robert

Reply all
Reply to author
Forward
0 new messages