|
![](/i/fill.gif) |
Wasn't it Chris Huff who wrote:
>In article <39981ff8@news.povray.org>, "Zeger Knaepen"
><zeg### [at] yahoo com> wrote:
>
>> What about an isosurface representing a mobius-ring?
>
>Make one. :-)
>The only way you can do it with an isosurface would either give the
>strip thickness, so it would have an internal side and an external side,
>or leave a discontinuity where the normal flips.
>
>It should be possible with the parametric shape, in which case I think
>there will still be a discontinuity at the point the beginning and end
>meet. That, or it will always show the "outside" texture. I don't know
>how the parametric calculates normals.
>
There's a parametric Moebius strip in my isosurface tutorial (about half
way down page <http://www.econym.demon.co.uk/isotut/parametric.htm>)
Adding an interior_texture clause to this object causes a discontinuity
of texture on the right hand side. It's exactly as if you had taken a
piece of paper that was coloured differently on each side, twisted it,
and stuck it together.
#declare R=1.3;
#declare Fx = function {cos(u)+v*cos(u/2)*cos(u)}
#declare Fy = function {sin(u)+v*cos(u/2)*sin(u)}
#declare Fz = function {v*sin(u/2)}
#declare U1 = 0;
#declare U2 = 2*pi;
#declare V1 = -0.3;
#declare V2 = 0.3;
parametric {
function Fx(u,v,0), Fy(u,v,0), Fz(u,v,0)
<U1,V1>,<U2,V2>
<-R,-R,-R>,<R,R,R>
accuracy 0.001
precompute 18, [x,y,z]
texture {pigment {rgb <1,1,0>}}
interior_texture {pigment {rgb <0,1,1>}}
finish {phong 0.5 phong_size 10}
no_shadow
}
What's actually happening is that MegaPov doesn't actually know that the
ends of the strip actually meet. It treats it as an ordinary two sided
surface.
If you change the range of the "u" parameter to, say, U1=0 U2=2*pi-0.1
then you can see that you've got a twisted piece of paper that comes 0.1
radians short of making a ring, and the colour change is at the gap.
The colour change can be made to occur anywhere on the ring by adjusting
the range of the "u" parameter. E.g. if you add 1 to both U1 and U2 then
the colour change is shifted 1 radian anticlockwise round the ring.
If you change the range of the "u" parameter so that it runs twice round
the ring, then the two textures both run round the ring twice and
interfere with each other.
If you change "u" and "v" to
#declare U1 = 0;
#declare U2 = 4*pi;
#declare V1 = 0;
#declare V2 = 0.3;
and you get the texture discontinuity in the "v" direction instead of
the "u" direction.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |