POV-Ray : Newsgroups : povray.newusers : Circular Helix Server Time
30 Jul 2024 06:18:30 EDT (-0400)
  Circular Helix (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Renderdog
Subject: Re: Circular Helix
Date: 27 Oct 2004 16:10:00
Message: <web.418000114c4748cb250c7b0b0@news.povray.org>
"Oleguer Vilella" <ole### [at] infonegociocom> wrote:
> I'm not sure if you want it. Tray with this code:
>
> ======================================
> #declare RopeHoop = function { f_helical_torus(x,y,z, 5, 7, 2, 1.0, 1, 0.5,
> 0.25, 1, 1.0, 0) }
>
> isosurface {
> function { RopeHoop(x,y,z) }
> max_gradient 7
> contained_by { sphere { .4, 50*2 } }
> translate x*10
> scale 1
> rotate 0*x
> texture {
> pigment { color rgbf <1, 0, 0, 0> }
> finish  { ambient 1 diffuse 1 }
> } }
> ======================================

Yes, the contained_by a sphere makes more sense with this
object, I'd used the box to chop off parts for my window frame.


Post a reply to this message

From: Renderdog
Subject: Re: Circular Helix
Date: 27 Oct 2004 16:20:01
Message: <web.418002674c4748cb250c7b0b0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> I actually had no idea that the helical torus could be used to create a
> circular helix. When I was developing that tutorial I experimented with
> lots of different values but never happened to stumble on a set that
> worked that way.

It took a lot of trial and error. Of course, I now have no memory
of what all the variables do, but I do have this commented code,
(for the first variable in each line). Not sure if they mean anything.

f_helical_torus(x,y,z, 100, 60, 2,
1.0, 1,      //  scale's the windings outward 0 = tube?
0.5,          //  negative minor radius
0.25, 1, 1.0, 0)   //  Inverse scales windings along circumference
          }

Mike, I'd like to thank you for your incredible isosurface tutorial,
http://www.econym.demon.co.uk/isotut/index.htm

It's an amazing resource I've used many times. I live in fear for
the day it disappears!

Thanks,
Mark


Post a reply to this message

From:
Subject: Re: Circular Helix
Date: 27 Oct 2004 16:21:01
Message: <4180032d$1@news.povray.org>
contained_by { box { <-7.6, -2.6, -7.6>, <7.6, 2.6, 7.6> } }
is enough; larger containers will unneccessarily increase the render time.

   Sputnik


Post a reply to this message

From: Renderdog
Subject: Re: Circular Helix
Date: 27 Oct 2004 19:20:00
Message: <web.41802c0b4c4748cbfa11e690@news.povray.org>
"David Robinson" <tdf### [at] ezrscom> wrote:
> However, I think the Torus aspect is not quite what I had in mind, now that
> I can see it in its entirety. I have attached an image to show an example if
> it helps. It shows two intertwined helixes.
>
> Hopefully this is achievable?

Possibly. Let us know what you find.


Post a reply to this message

From: Renderdog
Subject: Re: Circular Helix
Date: 27 Oct 2004 19:50:00
Message: <web.418033384c4748cbfa11e690@news.povray.org>
"Renderdog" <slo### [at] hiwaaynet> wrote:
> Possibly. Let us know what you find.

After playing with the parameters a bit, I doubt the
helical_torus will give you exactly what you're looking for.
I don't know for sure, though; there are a lot of combinations.

You will probably be better off using two sphere_sweeps,
though they can be a little temperamental. The math for
the paths shouldn't be too difficult.


Post a reply to this message

From: Mike Williams
Subject: Re: Circular Helix
Date: 27 Oct 2004 22:22:33
Message: <jD80eBAMfFgBFwLy@econym.demon.co.uk>
Here's an alternative way of getting a circular helix that's a bit
easier to manage than f_helical_torus. What you do is first create an
ordinary f_helix1, then translate it off to one side and transform it
into cylindrical polar co-ordinates. This gives you access to the
f_helix1 control parameters which are better understood than the
f_helical_torus parameters. 

I did the translation (x => x-R3) as a separate step from the 
co-ordinate change (x => f_r(x,z,y) , y => f_th(x,z,y)) to keep things
simple.

The use of (x,z,y) rather than (x,y,z) is due to the fact that f_th is
defined as atan2(x,z), whereas I wanted atan2(x,y).

#version 3.6;
global_settings {assumed_gamma 1.0}
#include "functions.inc"

camera {location  <0,0, -20> look_at 0 angle 20}
light_source { <-100,200,-300> colour rgb 1 }
background { rgb 0 }

#declare R1=0.1;     // helix minor radius
#declare R2=0.3;     // helix major radius
#declare R3=2.0;     // torus major radius
#declare Strands=2;  // DNA = double strand

#declare Turns=8.5;  // number of helix turns in the loop
                     // Turns*Strands should be an integer
                     // to avoid a discontinuity 

#declare DNA=function { f_helix1 (x-R3, y, z, Strands,
                        Turns, R1, R2, 1, 1, 0) }

isosurface {
   function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
        max_gradient 1.3
        contained_by {sphere {0, 3} }
        pigment {rgb 1}
}



For real DNA, the two strands aren't 180 degrees out of phase like this.
I'm not sure what the exact phase difference is, but here's a version
with the strands 120 degrees out of phase. If you know what the phase
difference should be, you can plug that number in where I've written
"120".

I've also changed the "shape parameter" from 1.0 to 0.6 in this version
to compensate for the fact that the change of co-ordinates had caused
the cross section to become elliptical instead of circular. This will
probably need to be adjusted whenever you change things like R3 and
Turns.

#version 3.6;
global_settings {assumed_gamma 1.0}
#include "functions.inc"

camera {location  <0,0, -20> look_at 0 angle 20}
light_source { <-100,200,-300> colour rgb 1 }
background { rgb 0 }

#declare R1=0.15;    // helix minor radius
#declare R2=0.3;     // helix major radius
#declare R3=2.0;     // torus major radius
#declare Strands=1;  // DNA = double strand

#declare Turns=8;    // number of helix turns in the loop
                     // Turns*Strands should be an integer
                     // to avoid a discontinuity 

#declare DNA=function { f_helix1 (x-R3, y, z, Strands,
                        Turns, R1, R2, 0.6, 1, 0) }

#declare Strand=
isosurface {
   function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
        max_gradient 1.3
        contained_by {sphere {0, 3} }
        pigment {rgb 1}
}

object{Strand}
object{Strand rotate z*120/Turns}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Renderdog
Subject: Re: Circular Helix
Date: 28 Oct 2004 00:25:00
Message: <web.4180737b4c4748cbd4971d0a0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
>    function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}

Magic!


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Circular Helix
Date: 28 Oct 2004 11:44:24
Message: <418113d8$1@news.povray.org>
Hello Mike,

Can you explain again how did you do this translation?
====================================
isosurface {
   function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
====================================
What's f_r and what's f_th?

Thanks,
Oleguer


news:jD8### [at] econymdemoncouk...
>
> Here's an alternative way of getting a circular helix that's a bit
> easier to manage than f_helical_torus. What you do is first create an
> ordinary f_helix1, then translate it off to one side and transform it
> into cylindrical polar co-ordinates. This gives you access to the
> f_helix1 control parameters which are better understood than the
> f_helical_torus parameters.
>
> I did the translation (x => x-R3) as a separate step from the
> co-ordinate change (x => f_r(x,z,y) , y => f_th(x,z,y)) to keep things
> simple.
>
> The use of (x,z,y) rather than (x,y,z) is due to the fact that f_th is
> defined as atan2(x,z), whereas I wanted atan2(x,y).
>
> #version 3.6;
> global_settings {assumed_gamma 1.0}
> #include "functions.inc"
>
> camera {location  <0,0, -20> look_at 0 angle 20}
> light_source { <-100,200,-300> colour rgb 1 }
> background { rgb 0 }
>
> #declare R1=0.1;     // helix minor radius
> #declare R2=0.3;     // helix major radius
> #declare R3=2.0;     // torus major radius
> #declare Strands=2;  // DNA = double strand
>
> #declare Turns=8.5;  // number of helix turns in the loop
>                      // Turns*Strands should be an integer
>                      // to avoid a discontinuity
>
> #declare DNA=function { f_helix1 (x-R3, y, z, Strands,
>                         Turns, R1, R2, 1, 1, 0) }
>
> isosurface {
>    function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
>         max_gradient 1.3
>         contained_by {sphere {0, 3} }
>         pigment {rgb 1}
> }
>
>
>
> For real DNA, the two strands aren't 180 degrees out of phase like this.
> I'm not sure what the exact phase difference is, but here's a version
> with the strands 120 degrees out of phase. If you know what the phase
> difference should be, you can plug that number in where I've written
> "120".
>
> I've also changed the "shape parameter" from 1.0 to 0.6 in this version
> to compensate for the fact that the change of co-ordinates had caused
> the cross section to become elliptical instead of circular. This will
> probably need to be adjusted whenever you change things like R3 and
> Turns.
>
> #version 3.6;
> global_settings {assumed_gamma 1.0}
> #include "functions.inc"
>
> camera {location  <0,0, -20> look_at 0 angle 20}
> light_source { <-100,200,-300> colour rgb 1 }
> background { rgb 0 }
>
> #declare R1=0.15;    // helix minor radius
> #declare R2=0.3;     // helix major radius
> #declare R3=2.0;     // torus major radius
> #declare Strands=1;  // DNA = double strand
>
> #declare Turns=8;    // number of helix turns in the loop
>                      // Turns*Strands should be an integer
>                      // to avoid a discontinuity
>
> #declare DNA=function { f_helix1 (x-R3, y, z, Strands,
>                         Turns, R1, R2, 0.6, 1, 0) }
>
> #declare Strand=
> isosurface {
>    function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
>         max_gradient 1.3
>         contained_by {sphere {0, 3} }
>         pigment {rgb 1}
> }
>
> object{Strand}
> object{Strand rotate z*120/Turns}
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Circular Helix
Date: 28 Oct 2004 15:08:29
Message: <NDqQ$LAVOUgBFw+H@econym.demon.co.uk>
Wasn't it Oleguer Vilella who wrote:
>Hello Mike,
>
>Can you explain again how did you do this translation?
>====================================
>isosurface {
>   function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
>====================================
>What's f_r and what's f_th?
>

If you're not familiar with polar coordinates, I don't think I can teach
the concept in a newsgroup posting.

If you are familiar with polar coordinates, then f_r(), f_th() and
f_ph() are standard functions (in functions.inc) which give you the
polar coordinates R, Theta and Phi. On a globe, they would be altitude,
longitude and latitude.

By transforming a function from Cartesian (ordinary xyz) coordinates to
polar coordinates we can bend the space that contains the function so
that the grid lines of the space are wrapped round into circles.

There are spherical polar coordinates (R Theta Phi) and cylindrical
polar coordinates (R Theta z) and it's the second of these that I used
for this scene.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Circular Helix
Date: 28 Oct 2004 16:20:27
Message: <4181548b$1@news.povray.org>
Ah ok, it's a function from "functions.inc". All understood now.

Many thanks,
Oleguer



news:NDqQ$LAVOUgBFw+H### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
> >Hello Mike,
> >
> >Can you explain again how did you do this translation?
> >====================================
> >isosurface {
> >   function{DNA(f_r(x,z,y) ,f_th(x,z,y),z)}
> >====================================
> >What's f_r and what's f_th?
> >
>
> If you're not familiar with polar coordinates, I don't think I can teach
> the concept in a newsgroup posting.
>
> If you are familiar with polar coordinates, then f_r(), f_th() and
> f_ph() are standard functions (in functions.inc) which give you the
> polar coordinates R, Theta and Phi. On a globe, they would be altitude,
> longitude and latitude.
>
> By transforming a function from Cartesian (ordinary xyz) coordinates to
> polar coordinates we can bend the space that contains the function so
> that the grid lines of the space are wrapped round into circles.
>
> There are spherical polar coordinates (R Theta Phi) and cylindrical
> polar coordinates (R Theta z) and it's the second of these that I used
> for this scene.
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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