ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 28 Jun 2020 18:04:34 +0200The boundary of an implicit_plot3d are jittery.https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/ 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
Thu, 02 Oct 2014 01:53:42 +0200https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/Answer by Volker Braun for <p>I am making a contour plot in a restricted region using the following commands:</p>
<pre><code>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)
</code></pre>
<p>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.</p>
<p>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.</p>
<p>I tried using Adaptative=true, without any success. The same problem also applies when I use tachyon to render rather than jmol.</p>
<p>Any suggestions would be welcome.</p>
<p>Thank you</p>
https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/?answer=24382#post-id-24382Neat 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.Fri, 03 Oct 2014 12:04:12 +0200https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/?answer=24382#post-id-24382Answer by FrédéricC for <p>I am making a contour plot in a restricted region using the following commands:</p>
<pre><code>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)
</code></pre>
<p>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.</p>
<p>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.</p>
<p>I tried using Adaptative=true, without any success. The same problem also applies when I use tachyon to render rather than jmol.</p>
<p>Any suggestions would be welcome.</p>
<p>Thank you</p>
https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/?answer=52248#post-id-52248you 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
Sun, 28 Jun 2020 18:04:34 +0200https://ask.sagemath.org/question/24370/the-boundary-of-an-implicit_plot3d-are-jittery/?answer=52248#post-id-52248