3
$\begingroup$

I have the code for the spherical gyroid as shown below. My problem is when I attempt 3D printing, I can not obtain the object because the thickness is too small. How do I increase the thickness of the gyroid in the code? Or if there is another way to make the plot, I will be happy to learn about it.

r = 2 Pi;
ContourPlot3D[Sin[x] Cos[y] + Sin[y] Cos[z] + Sin[z] Cos[x] == 0,
  {x, -r, r}, {y, -r, r}, {z, -r, r},
  RegionFunction -> ({x, y, z} \[Function] x^2 + y^2 + z^2 <= r^2),
  Mesh -> None]
$\endgroup$

1 Answer 1

4
$\begingroup$

Reply the comment: export stl format

r = 2 Pi; solid = 
 ContourPlot3D[
  Sin[x] Cos[y] + Sin[y] Cos[z] + Sin[z] Cos[x] == 0, {x, -r, 
   r}, {y, -r, r}, {z, -r, r}, 
  RegionFunction -> Function[{x, y, z}, x^2 + y^2 + z^2 <= r^2], 
  Mesh -> None, PlotTheme -> "ThickSurface", 
  Method -> {"Extrusion" -> .2}, RegionBoundaryStyle -> None];
Export["test.stl", solid]

enter image description here

$\endgroup$
9
  • $\begingroup$ Thank you sir for the answer. Is there a way i can edit the code on the thickness to have several thicknesses of my choice $\endgroup$ Nov 17, 2020 at 11:21
  • 2
    $\begingroup$ @SelamoBasile – Set thickness by adding Extrusion as a Method option. For example, Method -> {"Extrusion" -> .2} makes a thinner wall. $\endgroup$
    – creidhne
    Nov 17, 2020 at 22:12
  • $\begingroup$ @creidhne Wonderful! $\endgroup$
    – cvgmt
    Nov 18, 2020 at 0:17
  • $\begingroup$ Good morning Sir, I managed to write the complete code. my problem now is how do i export the code as STL file or save the code in stl formate. r = 2 Pi; ContourPlot3D[ Sin[x] Cos[y] + Sin[y] Cos[z] + Sin[z] Cos[x] == 0, {x, -r, r}, {y, -r, r}, {z, -r, r}, RegionFunction -> ({x, y, z} [Function] x^2 + y^2 + z^2 <= r^2), Mesh -> None, PlotTheme -> "ThickSurface", Method -> {"Extrusion" -> .2}] this is the code i have written $\endgroup$ Nov 24, 2020 at 8:12
  • $\begingroup$ thank you so much Sir, I am doing my research on this and I will be grateful if you write me the complete code. I am supposed to do 3D printing to obtain a physical object. I will be so grateful if you assist me with a complete code showing how I can save it as an STL file $\endgroup$ Nov 24, 2020 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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