1
$\begingroup$

I'm trying to figure out how to change the period over time (z-direction) in my 3D plot, which is a gyroid, in a way similar to a color thickness function, but I would like to do it continuosly on the function.

ContourPlot3D[
  Cos[x] Sin[y] + Cos[y] Sin[z] + Cos[z] Sin[x], 
  {x, -0, 16}, {y, -0, 16}, {z, -0, 16}, 
  Contours -> {0}, 
  PlotPoints -> 6, 
  ViewPoint -> {1, 1, 1}]

The above is the code I use. I would like to add a function so I can change the gyroid repetition frequence over time.

Hope you can help me!

$\endgroup$
1
  • 1
    $\begingroup$ Consider what happens when you replace $z$ with $c z$, $c > 0$... $\endgroup$ – J. M.'s torpor Feb 25 '16 at 9:42
2
$\begingroup$

If I understand correctly, you wish to make the frequency increase with increasing z. Try something like this,

With[{ω = (1 + .2 z)},
 ContourPlot3D[
  Cos[ω x] Sin[ω y] + Cos[ω y] Sin[ω z] + 
   Cos[ω z] Sin[ω x], {x, -0, 16}, {y, -0, 16}, {z, -0, 
   16}, Contours -> {0}, PlotPoints -> 6, ViewPoint -> {1, 1, 1}]]

enter image description here

Or, using a smaller initial frequency,

With[{ω = (.1 + .2 z)},
 ContourPlot3D[
  Cos[ω x] Sin[ω y] + Cos[ω y] Sin[ω z] + 
   Cos[ω z] Sin[ω x], {x, -0, 16}, {y, -0, 16}, {z, -0, 
   16}, Contours -> {0}, PlotPoints -> 6, ViewPoint -> {1, 1, 1}]]

enter image description here

$\endgroup$
3
  • $\begingroup$ thank you very much ! I´m new to mathematica so i dont now the functions and stuff that good yet. i´m trying to transfer my matlab knowledge to mathematica but it takes time :) $\endgroup$ – pblomstrom Feb 25 '16 at 10:57
  • $\begingroup$ @pblomstrom, I wasn't clear if this was what you were looking for when I read your question. Did this cover it? If not, we can try to nail down the problem, if it did answer, you can mark the question as answered, as shown in the tour $\endgroup$ – Jason B. Mar 2 '16 at 12:59
  • $\begingroup$ it did , thank you ! $\endgroup$ – pblomstrom Mar 2 '16 at 13:01

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.