Ask Your Question
1

The boundary of an implicit_plot3d are jittery.

asked 2014-10-02 01:53:42 +0100

alexg gravatar image

updated 2014-10-02 03:59:41 +0100

calc314 gravatar image

I am making a contour plot in a restricted region using the following commands:

var('x,y,z')

implicit_plot3d((x^2+y^2-.4)*(x^2+z^2-.4)*(z^2+y^2-.4)*(x^2+(y-z)^2/2-.4)*(z^2+(x-y)^2/2-.4)*(y^2+(x-z)^2/2-.4)*(x^2+(y+z)^2/2-.4)*(z^2+(x+y)^2/2-.4)*(y^2+(x+z)^2/2-.4)==1, (x, -3, 3), (y, -3,3), (z, -3,3), color='green', plot_points=100, region=lambda x,y,z: x^2+y^2+z^2<10)

The surface is restricted to a ball, using the region command. This is because I need to illustrate a surface with its boundary meeting the corresponding sphere.

My problem is that some of the boundary cylinders have their border very jittery. They look like a saw. I need them to be smooth, as some others actually are.

I tried using Adaptative=true, without any success. The same problem also applies when I use tachyon to render rather than jmol.

Any suggestions would be welcome.

Thank you

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2020-06-28 18:04:34 +0100

FrédéricC gravatar image

you can now use the add_condition method as follows

sage: x,y,z=var('x,y,z')
sage: P = implicit_plot3d((x^2+y^2-.4)*(x^2+z^2-.4)*(z^2+y^2-.4)*(x^2+(y-z)^2/2-.4
....: )*(z^2+(x-y)^2/2-.4)*(y^2+(x-z)^2/2-.4)*(x^2+(y+z)^2/2-.4)*(z^2+(x+y)^2/2-
....: .4)*(y^2+(x+z)^2/2-.4)==1, (x, -3, 3), (y, -3,3), (z, -3,3), color='green'
....: , plot_points=100)
sage: def condition(x,y,z):
....:     return x^2+y^2+z^2<10
sage: Q = P.add_condition(condition)
sage: Q
edit flag offensive delete link more
2

answered 2014-10-03 12:04:12 +0100

Volker Braun gravatar image

Neat plot! To some extent it is unavoidable, if you have a tube at an odd angle in 3-d then the plot sample points will not line up in the direction of the tube. So no matter how you join the vertices into triangles, it'll always be jagged. If you need visual perfection then you probably have to use tachyon and crank up plot_points to have triangles that are only a few pixels wide.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-10-02 01:53:42 +0100

Seen: 559 times

Last updated: Jun 28 '20