POV-Ray : Newsgroups : povray.newusers : gyroid structure Server Time
22 Dec 2024 21:54:18 EST (-0500)
  gyroid structure (Message 1 to 9 of 9)  
From: Colaroid
Subject: gyroid structure
Date: 14 Feb 2011 10:20:01
Message: <web.4d5947d7e90c1850c0abfa3e0@news.povray.org>
Hi all

I am trying to draw a 'gyroid' structure in POVRAY, but have no idea where to
start.

I have found, from a source on the internet, that the function for the surfaces
is as follows, but I'm not sure how to fit this into a POVRAY code:

v(x,y,z) = sin 2x cos y sin z + sin 2y cos z sin x + sin 2z cos x sin y - 0.15
(cos 2x cos 2y + cos 2y cos 2z + cos 2x)

A gyroid structure looks like this picture:

http://www.nada.kth.se/~asa/bilder/gyroid1.png

Many thanks


Post a reply to this message

From: Roman Reiner
Subject: Re: gyroid structure
Date: 14 Feb 2011 12:45:01
Message: <web.4d59690bf57b1ec211836c20@news.povray.org>
"Colaroid" <nomail@nomail> wrote:
> Hi all
>
> I am trying to draw a 'gyroid' structure in POVRAY, but have no idea where to
> start.
>
> I have found, from a source on the internet, that the function for the surfaces
> is as follows, but I'm not sure how to fit this into a POVRAY code:
>
> v(x,y,z) = sin 2x cos y sin z + sin 2y cos z sin x + sin 2z cos x sin y - 0.15
> (cos 2x cos 2y + cos 2y cos 2z + cos 2x)
>
> A gyroid structure looks like this picture:
>
> http://www.nada.kth.se/~asa/bilder/gyroid1.png
>
> Many thanks

i think isosurface is what you need


Post a reply to this message

From: Colaroid
Subject: Re: gyroid structure
Date: 17 Feb 2011 15:10:00
Message: <web.4d5d7f85f57b1ec9e5356e50@news.povray.org>
> i think isosurface is what you need

Thanks! I'm not sure how to convert my formula into my isosurface. I keep
getting a parse error.

Any ideas?


Post a reply to this message

From: stbenge
Subject: Re: gyroid structure
Date: 17 Feb 2011 16:03:36
Message: <4d5d8d28@news.povray.org>
On 2/17/2011 12:05 PM, Colaroid wrote:
>
>> i think isosurface is what you need
>
> Thanks! I'm not sure how to convert my formula into my isosurface. I keep
> getting a parse error.
>
> Any ideas?

I'm pretty that when you see "sin 2x" you need to type sin(2*x), and for 
"sin 2x cos y sin z" you need to type sin(2*x)*cos(y)*sin(z).

After trying to take the whole equation literally, the result I
received did not closely resemble the image you linked to. It was
similar, but the structures were not thin and the transitions were
quite lumpy.

Sam


Post a reply to this message

From: stbenge
Subject: Re: gyroid structure
Date: 17 Feb 2011 16:36:47
Message: <4d5d94ef@news.povray.org>
On 2/17/2011 1:03 PM, stbenge wrote:
> On 2/17/2011 12:05 PM, Colaroid wrote:
>>
>>> i think isosurface is what you need
>>
>> Thanks! I'm not sure how to convert my formula into my isosurface. I keep
>> getting a parse error.
>>
>> Any ideas?
>
> I'm pretty that when you see "sin 2x" you need to type sin(2*x), and for
> "sin 2x cos y sin z" you need to type sin(2*x)*cos(y)*sin(z).
>
> After trying to take the whole equation literally, the result I
> received did not closely resemble the image you linked to. It was
> similar, but the structures were not thin and the transitions were
> quite lumpy.

OK, I may have found an answer.

Do a Google search for "v(x,y,z) = sin 2x cos y sin z" and you will get 
a single result linking to a PDF ("EmissaryFall99"). Open the PDF 
document and search for "v(x,y,z) = sin 2x cos y sin z" and it will take 
you directly to an image of a "core-shelled double gyroid." The equation 
is exactly the same as the one you posted. The inner surface of the 
object shown is the same one I got when I used the equation directly in 
an isosurface (you may need to adjust the threshold).

Perhaps the image you linked to was a core-shelled double gyroid mesh 
/after/ it had been "relaxed" for a few iterations using Surface Evolver?

Sam


Post a reply to this message

From: stbenge
Subject: Re: gyroid structure
Date: 17 Feb 2011 17:56:29
Message: <4d5da79d@news.povray.org>
On 2/17/2011 1:36 PM, stbenge wrote:
> Do a Google search for "v(x,y,z) = sin 2x cos y sin z" and you will get
> a single result linking to a PDF ("EmissaryFall99"). Open the PDF
> document and search for "v(x,y,z) = sin 2x cos y sin z" and it will take
> you directly to an image of a "core-shelled double gyroid." The equation
> is exactly the same as the one you posted. The inner surface of the
> object shown is the same one I got when I used the equation directly in
> an isosurface (you may need to adjust the threshold).

Since it looks like you may be in for some trouble ahead, here's some 
code to get you started. I used the "core-shelled double gyroid" formula 
found in the aforementioned PDF:

// CSD_Gyroid.pov

#version 3.7;

global_settings{assumed_gamma 1.0}

camera{
  orthographic
  location <12,7,-10>
  look_at 0
  scale .165
}

light_source{<.5,1,-.5>*1e8, 1}

background{rgb 1}

#declare CSD_Gyroid =
function{
   sin(2*x)*cos(y)*sin(z)
  +sin(2*y)*cos(z)*sin(x)
  +sin(2*z)*cos(x)*sin(y)
  -0.15*(
    cos(2*x)*cos(2*y)
   +cos(2*y)*cos(2*z)
   +cos(2*x)
  )
}

isosurface{
  function{
   // calling the function and scaling it
   CSD_Gyroid(
    x*2*pi,
    y*2*pi,
    z*2*pi
   )
  }
  open

  // I guessed the threshold
  threshold 0.75
  accuracy 0.001
  max_gradient 13.944
  contained_by{
   box{
    <-0.5,-1.0,-0.5>,
    <0.5,1.0,0.5>
   }
  }
  scale <-1,1,1>
  rotate y*270
  interior_texture{
   pigment{rgb <.2,.3,.5>}
   finish{phong 1}
  }
  texture{
   pigment{rgb 1}
   finish{ambient .5}
  }
}

#include"shapes.inc"

object{
  Wire_Box_Union(
   <-.5,-1,-.5>,
   <.5,1,.5>,
   .01
  )
  pigment{rgb <.1,.2,.5>}
}

// ~CSD_Gyroid.pov

To achieve something like in the image you linked to may require minimal 
surface calculations to be performed on the gyroid function, which could 
slow down the rendering speed significantly. I wouldn't even know where 
to begin :(

Sam


Post a reply to this message

From: Colaroid
Subject: Re: gyroid structure
Date: 21 Feb 2011 11:35:01
Message: <web.4d629412f57b1ecc0abfa3e0@news.povray.org>
Wow!!!!!

Thank you for the massive effort you have put in for this one, I am very
grateful!

This structure is perfect. I just want to take the top half of the image so that
I have a cube containing this structure. Is that easily done?

Sorry to have taken up so much of your time, thanks again, Sam!

Colaroid


Post a reply to this message

From: Colaroid
Subject: Re: gyroid structure
Date: 21 Feb 2011 11:45:00
Message: <web.4d6295b2f57b1ecc0abfa3e0@news.povray.org>
"Colaroid" <nomail@nomail> wrote:
> Wow!!!!!
>
> Thank you for the massive effort you have put in for this one, I am very
> grateful!
>
> This structure is perfect. I just want to take the top half of the image so that
> I have a cube containing this structure. Is that easily done?
>
> Sorry to have taken up so much of your time, thanks again, Sam!
>
> Colaroid

Sorry for the last stupid question- I've solved this easy problem myself!!!

Thanks again


Post a reply to this message

From: stbenge
Subject: Re: gyroid structure
Date: 21 Feb 2011 14:28:18
Message: <4d62bcd2$1@news.povray.org>
On 2/21/2011 8:34 AM, Colaroid wrote:
> Wow!!!!!
>
> Thank you for the massive effort you have put in for this one, I am very
> grateful!
>
> This structure is perfect. I just want to take the top half of the image so that
> I have a cube containing this structure. Is that easily done?
>
> Sorry to have taken up so much of your time, thanks again, Sam!
>
> Colaroid

No problem, it was a fun diversion :)

Sam


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.