|
![](/i/fill.gif) |
Wasn't it Oleguer Vilella who wrote:
>Hi all,
>
>First I'm going to put a small part of code:
>======================================
>merge{
>sphere { <0, 0, 0>, 1
>translate -0.5*x
>scale <1.2, 0, 0>
>}
>sphere { <0, 0, 0>, 0.5
>translate 0.7*x
>scale <1.4, 0, 0>
>}
>======================================
>After that I've the transformations, the colors and I've clipped_by with a
>plane { z, 0} and it's empty using hollow.
>
>Now I want to put a thread following the inside part of the two spheres. The
>only way is creating a spline and using it like a function?
Have you considered using torus sections?
If you create a torus so that R1+R2 is equal to the radius of the
sphere, apply any required rotations, translate and scale exactly like
the spherical part that it's following, then difference the other sphere
and plane. Like this
global_settings {assumed_gamma 1.0}
camera {location <5,0,4> look_at <0.3,0,0> angle 25}
background {rgb 1}
light_source {<-30, -30, 30> color rgb 1}
light_source {<0, 0, 30> color rgb 1}
// Main shape
merge{
sphere { <0, 0, 0>, 1
translate -0.5*x
scale <1.2, 1, 1>
}
sphere { <0, 0, 0>, 0.5
translate 0.7*x
scale <1.4, 1, 1>
}
clipped_by {plane { z, 0}}
pigment {rgb x}
}
// Threads in the large part
#declare N=0;
#declare S=seed(123);
difference {
union {
#while (N<20)
torus {0.98,0.02
rotate <rand(S),rand(S),rand(S)>*360
}
#declare N=N+1;
#end
translate -0.5*x
scale <1.2, 1, 1>
}
sphere { <0, 0, 0>, 0.5
translate 0.7*x
scale <1.4, 1, 1>
}
plane {z,0 inverse}
pigment {rgb 1}
}
// Threads in the small part
#declare N=0;
difference {
union {
#while (N<10)
torus {0.48,0.02
rotate <rand(S),rand(S),rand(S)>*360
}
#declare N=N+1;
#end
translate 0.7*x
scale <1.4, 1, 1>
}
sphere { <0, 0, 0>, 1
translate -0.5*x
scale <1.2, 1, 1>
}
plane {z,0 inverse}
pigment {rgb 1}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |