|
 |
Wasn't it Alain who wrote:
>sahraoui nous apporta ses lumieres en ce 29-03-2007 08:25:
>> Hi
>
>> I was wondering if there is a simple way
>> to draw a helix on a sinus. Instead of having a straigh helix
>> we should have a helix that would follow a sine function. It seems
>> hard but may be I am not optimising the code. so far it is not working
>
>> regards
>
>Using an iso_surface with the helix function, you just need to add the sin wave
>with the correct amplitude and wave length. Using a sin and a cosin, you can
The problem is that if you just replace x with (x+A*sin(B*y)) in the
parameters of f_helix1, it also distorts the cross section and looks
rather ugly.
You can get away with it if the minor radius is very small, like this:
#include "functions.inc"
camera { location <0, 4, -10> look_at <0, 0, 0> angle 35}
light_source {<-100,200,-100> colour rgb 1}
isosurface {
function { f_helix1((x+sin(y*2)*0.4),y,z,1,50,0.02,0.6,1,1,0) }
max_gradient 1.5
contained_by{sphere {0,2}}
pigment {rgb 1}
}
but it just looks wrong if the minor radius is larger
#include "functions.inc"
camera { location <0, 1, -10> look_at <0, 0, 0> angle 35}
light_source {<-100,200,-100> colour rgb 1}
isosurface {
function { f_helix1((x+sin(y*2)*0.4),y,z,1,15,0.1,0.6,1,1,0) }
max_gradient 1.5
contained_by{sphere {0,2}}
pigment {rgb 1}
}
What you'd have to do to make it look right is to obtain the actual
equation of the helix and apply the variable substitution to the x
factors that affect the path of the helix but not to those that affect
the cross section.
I couldn't find the equation for a helix surface anywhere. Searches just
get bogged down with huge numbers of sites that have the equations for a
helicoid surface or a helical curve. I suppose one could read the POV
source code of f_helix1, but I suspect it might be rather messy because
of all the extra parameter options that you're probably not interested
in.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
 |