I have this code that I want to compute to create at Gyroid,

Table[Cos[4 z] Sin[4 x] + Cos[4 x] Sin[4 y] + Cos[4 y] Sin[4 z], 
    {x, 0, 35}, 
    {y, 0, 35}, 
    {z, 0, 60}], 
Contours -> 0, 
PerformanceGoal -> "Quality"]

However, the PerformanceGoal is set to Quality but I don't get an adequate quality. I would like to increase it. Any suggestions?


What you need is to increase the MaxPlotPoints,

Here is the default option,

dta = Table[
   Cos[4*z] Sin[4*x] + Cos[4*x] Sin[4*y] + Cos[4*y] Sin[4*z], {x, 0, 
    35}, {y, 0, 35}, {z, 0, 60}];
ListContourPlot3D[dta, Contours -> 0]

enter image description here

And here it is setting MaxPlotPoints to a high value,

ListContourPlot3D[dta, Contours -> 0, MaxPlotPoints -> 100]

enter image description here

Setting this value too high will seriously slow down your system though, so be warned.


There are two points to consider here, first the number of points in your data, and secondly the number of points that the plotting function uses.

In your example, you only take points at whole numbers: at x = 1, 2, 3, 4 etc. Your resolution will be limited by this. You can increase this resolution as shown below. Next you can increase the MaxPlotPoints as well.

Finally, I think you should generate the Table beforehand so that you don't have to regenerate it every time you want to change your plot.

With[{ω = (1 + .2 z)},
 dta = Table[
    Cos[ω x] Sin[ω y] + 
     Cos[ω y] Sin[ω z] + 
     Cos[ω z] Sin[ω x], {x, -0, 16, .25}, {y, -0, 
     16, .25}, {z, -0, 16, .25}];

ListContourPlot3D[dta, Contours -> {0}, MaxPlotPoints -> 100, 
 Extrusion -> .2, Mesh -> None, Boxed -> False, Axes -> False]

enter image description here

Another neat thing to try is to change the shape of the resulting plot, using RegionFunction

ListContourPlot3D[dta, Contours -> {0}, MaxPlotPoints -> 100, 
 Extrusion -> .2, Mesh -> None, Boxed -> False, Axes -> False, 
 DataRange -> {{-8, 8}, {-8, 8}, {-8, 8}}, 
 RegionFunction -> Function[{x, y, z}, x^2 + y^2 + z^2 <= 36]

enter image description here

  • $\begingroup$ is there any other way to do it? I´m doing it to create file that be exported in STL format. is there a smart way to export this? $\endgroup$ – pblomstrom Mar 2 '16 at 12:44
  • $\begingroup$ Does it have to be a list plot, or can you plot the function? Is this the exact plot you want to make, or are you trying for a more complicated plot? $\endgroup$ – Jason B. Mar 2 '16 at 12:48
  • $\begingroup$ i can plot the function directly if that speeds up as long as i have resolution and the possiblity to add Extrusion part to thicken the walls for 3d printing $\endgroup$ – pblomstrom Mar 2 '16 at 12:53
  • $\begingroup$ Actually i dont need to do the plotting can i simply export the function to a stl format? $\endgroup$ – pblomstrom Mar 2 '16 at 13:36
  • $\begingroup$ @pblomstrom - you either need to create a 3D region or a Graphics3D object in order to create an STL file (see here). I just created an STL file from the tennis-ball looking object above, and I opened it in MeshLab and it looks just as would be expected, and it did not take very long, especially compared to how long it would take to print it I think. $\endgroup$ – Jason B. Mar 2 '16 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.