POV-Ray : Newsgroups : povray.general : Trouble with a torus Server Time
6 Aug 2024 19:28:04 EDT (-0400)
  Trouble with a torus (Message 1 to 10 of 10)  
From: Shay
Subject: Trouble with a torus
Date: 14 Feb 2002 17:59:27
Message: <3c6c414f$1@news.povray.org>
There is a simple, obdvious problem with this code, but I just can't see it.
Why do a get a lip where the torus rests on the clipped sphere?
Please save my sanity!!!

background {rgb 1}
camera {location <1,2,-2> look_at 0}
light_source {<-600, 400, -400> color rgb 1}

intersection {
 sphere {0, 1}
 plane {y*1, .5}
 pigment {rgb 1}}

torus {cos(asin(.5))-.05, .05 sturm translate y*.5 pigment {rgb 1}}

Thank you,
 -Shay


Post a reply to this message

From: Warp
Subject: Re: Trouble with a torus
Date: 14 Feb 2002 18:33:50
Message: <3c6c495d@news.povray.org>
Shay <sah### [at] simcopartscom> wrote:
: There is a simple, obdvious problem with this code, but I just can't see it.
: Why do a get a lip where the torus rests on the clipped sphere?

  Because you are putting the outer edge of the torus on the surface of
the sphere. They are not tangent.
  It means that the angle of the sphere surface normal at the intersection line
is 30 degrees but the angle of the torus surface normal is 0 degrees. Thus you
get a sharp edge there.
  Making the torus and the sphere tangent at y=0.5 requires a bit trickier
math.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Rune
Subject: Re: Trouble with a torus
Date: 14 Feb 2002 19:32:25
Message: <3c6c5719@news.povray.org>
"Shay" wrote:
> Please save my sanity!!!

background {rgb 1}
camera {location <1,2,-2> look_at 0}
light_source {<-600, 400, -400> color rgb 1}

#declare TorusMinor = .05;
#declare SphereRad  = 1.0;
#declare Height     = .5;

#declare Angle = asin(Height/SphereRad);
#declare TorusMajor  = (SphereRad-TorusMinor)*cos(Angle);
#declare TorusHeight = (SphereRad-TorusMinor)*sin(Angle);

intersection {
 sphere {0, SphereRad}
 plane {y*1, Height}
 pigment {rgb 1}}

torus {TorusMajor, TorusMinor sturm translate y*TorusHeight pigment {rgb 1}}

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 20)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Shay
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 07:27:40
Message: <3c6cfebc$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3c6c495d@news.povray.org...
>
>   Because you are putting the outer edge of the torus on the surface of
> the sphere. They are not tangent.


True, but my edges didn't even line up.
This is why I like to bouild curves with meshes, becuase you can get perfect
transitions. It's just that SO many points are required to get a sphere that
can stand up to close inspection.

Thank you,
 -Shay


Post a reply to this message

From: Shay
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 07:33:40
Message: <3c6d0024$1@news.povray.org>
"Rune" <run### [at] mobilixnetdk> wrote in message
news:3c6c5719@news.povray.org...

Which would look like this back in my original code:
 torus {cos(asin(.5))*.95, .05 sturm translate y*(.5*.95) pigment {rgb 1}}

Thank you. Answers are always SO obdvious when someone else gives them to
you.
Sometimes (at least for me) it takes a fresh brain to find a mistake. This
is especially true when I try to mess with PoV at work.

 -Shay


Post a reply to this message

From: Mark Hanford
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 08:57:03
Message: <3c6d13af@news.povray.org>
One eye on Pov, and one making sure the boss isn't coming?   :)

btw, has anyone been caught out with Pov installed on loads of PC's at work
which were left rendering overnight?


Mark Hanford
http://www.mrhanford.com/povray


"Shay" <shi### [at] houstonrrcom> wrote in message
news:3c6d0024$1@news.povray.org...
>
> "Rune" <run### [at] mobilixnetdk> wrote in message
> news:3c6c5719@news.povray.org...
>
> Which would look like this back in my original code:
>  torus {cos(asin(.5))*.95, .05 sturm translate y*(.5*.95) pigment {rgb 1}}
>
> Thank you. Answers are always SO obdvious when someone else gives them to
> you.
> Sometimes (at least for me) it takes a fresh brain to find a mistake. This
> is especially true when I try to mess with PoV at work.
>
>  -Shay
>
>
>
>


Post a reply to this message

From: Warp
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 10:32:40
Message: <3c6d2a18@news.povray.org>
Shay <shi### [at] houstonrrcom> wrote:
: True, but my edges didn't even line up.

  I think they did. It just doesn't look like it because the change in
slope is so sharp (the slope changes abruptly from 30 degrees to 0 degrees,
creating a sharp change in lighting).

: This is why I like to bouild curves with meshes, becuase you can get perfect
: transitions. It's just that SO many points are required to get a sphere that
: can stand up to close inspection.

  Meshes also have the advantage that you can modify individual vertex points,
approximate nonlinear transformations, etc.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Shay
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 12:05:24
Message: <3c6d3fd4$1@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote in message news:3c6d2a18@news.povray.org...
>   Meshes also have the advantage that you can modify individual vertex
points,

This is especially easy with #mesh2. Calculating normals is also MUCH
easier.

> approximate nonlinear transformations, etc.

extrude objects, twist primitives, perform assymetrical scaling, sweep
anything along a spline, blob together anything, make an isosurface type
shape that will render quickly (the second time), make an octagon or any
other shaped lathe object, bevel all corners easily, render glass objects
much faster than merge, convert to other formats, explode an object (haven't
tried this yet w/ mesh2), make cloth, wrap a photo perfectly around an
object and then smash the object, etc., etc., etc.


Post a reply to this message

From: Warp
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 12:17:26
Message: <3c6d42a6@news.povray.org>
Shay <sah### [at] simcopartscom> wrote:
:> approximate nonlinear transformations, etc.

: extrude objects, twist primitives, perform assymetrical scaling, sweep
: anything along a spline, blob together anything, make an isosurface type
: shape that will render quickly (the second time), make an octagon or any
: other shaped lathe object, bevel all corners easily, render glass objects
: much faster than merge, convert to other formats, explode an object (haven't
: tried this yet w/ mesh2), make cloth, wrap a photo perfectly around an
: object and then smash the object, etc., etc., etc.

  It's important to emphasize the word "approximation" in most of those
things.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Shay
Subject: Re: Trouble with a torus
Date: 15 Feb 2002 12:35:52
Message: <3c6d46f8@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote in message news:3c6d42a6@news.povray.org...
>   It's important to emphasize the word "approximation" in most of those
> things.

Yeah, that's what I like so much about Povray. Simple things can be done
simply because Povray has so many tools. It would take at least 2.5K
vertices to make even a decent approximation of  "sphere {0,1}." However,
when complexity is needed, the tools are there for us.

 -Shay


Post a reply to this message

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