 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Is there a way to clip a torus along its internal circle, where you would
still have a ring, but it would be an arc of x degrees?
Thanks!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 6 Jun 2001 17:50:20 -0400, "parasonic" <par### [at] home com>
wrote:
>Is there a way to clip a torus along its internal circle, where you would
>still have a ring, but it would be an arc of x degrees?
Like this? The arc lies in the x-z plane, starts at +x and goes
counterclockwise.
#macro Arc (Major, Minor, Degrees)
intersection
{
torus { Major, Minor }
plane { -z, 0 }
plane { -z, 0 rotate -Degrees*y }
}
#end
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Peter Popov wrote:
>
> On Wed, 6 Jun 2001 17:50:20 -0400, "parasonic" <par### [at] home com>
> wrote:
>
> >Is there a way to clip a torus along its internal circle, where you would
> >still have a ring, but it would be an arc of x degrees?
>
> Like this? The arc lies in the x-z plane, starts at +x and goes
> counterclockwise.
>
> #macro Arc (Major, Minor, Degrees)
> intersection
> {
> torus { Major, Minor }
> plane { -z, 0 }
> plane { -z, 0 rotate -Degrees*y }
> }
> #end
>
>
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vip bg
> TAG e-mail : pet### [at] tag povray org
I made a slightly more thorough version a while ago.
// Angles are in degrees. Torus is described counter_clockwise around
the z axis (for positive angles) starting at Major_radius * x
// Angles with an absolute value greater than 360 returns a complete
torus.
#macro Torus_segment (Major_radius,Minor_radius,Angle)
#if (abs(Angle)>=360)
torus {Major_radius,Minor_radius rotate 90*x}
#else
#if ((abs(Angle)/Angle)>0)
#if (Angle <= 180)
intersection{
torus {Major_radius,Minor_radius rotate 90*x}
plane {-y,0}
plane {y,0 rotate Angle*z}
}
#else
intersection {
merge {
plane {-y,0}
plane {y,0 rotate Angle*z}
}
torus {Major_radius,Minor_radius rotate 90*x}
}
#end
#else
#if (Angle >= -180)
intersection{
torus {Major_radius,Minor_radius rotate 90*x}
plane {y,0}
plane {-y,0 rotate Angle*z}
}
#else
intersection {
merge {
plane {y,0}
plane {-y,0 rotate Angle*z}
}
torus {Major_radius,Minor_radius rotate 90*x}
}
#end
#end
#end
#end
--
Dan Johnson
http://www.geocities.com/zapob
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I think it can be made more easily and efficiently:
#macro TorusSegment(MajRad, MinRad, Angle)
#local Ang = abs(Angle);
#if(Ang >= 360) torus { MajRad, MinRad }
#else
intersection
{ torus { MajRad, MinRad }
#if(Ang>180) union { #end
plane { -x,0 }
plane { x,0 rotate -y*Ang }
#if(Ang>180) } #end
#local Dim = MajRad+MinRad;
bounded_by { box { -<Dim,MinRad,Dim>, <Dim,MinRad,Dim> } }
#if(Angle<0) scale <-1,1,1> #end
}
#end
#end
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Fri, 08 Jun 2001 00:18:59 -0700, Dan Johnson <zap### [at] hotmail com>
wrote:
>I made a slightly more thorough version a while ago.
<snip>
Not bad. Did you actually test mine in POV, 'coz I didn't have the
time to :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> I think it can be made more easily and efficiently:
For some boost you could get rid of the planes, even though they are more
_elegant_... Try this in place of the planes inside the macro:
#local H = 2*MinRad;
#local L = H +MajRad;
box { <0, H, L>, <L, -H, -L> }
box { <0, H, L>, <-L, -H, -L> rotate -y*Ang }
- Nikodemus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nikodemus Siivola <tsi### [at] cc hut fi> wrote:
: For some boost you could get rid of the planes, even though they are more
: _elegant_...
I think bounded planes are faster than boxes (supposing the bounding box
of the plane is approximately equal in size as the box).
Perhaps I should test this.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> wrote:
> I think bounded planes are faster than boxes (supposing the bounding
box
> of the plane is approximately equal in size as the box).
Ooops, sorry. Do I feel silly... I didn't notice the bounding! Well, I you
do test, please tell.
- Nikodemus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Nikodemus Siivola" <tsi### [at] cc hut fi> wrote:
>Well, I you do test, please tell.
Was supposed to be: ...if you do test...
Ant nov I kant' ewen vrite. :(
- Nikodemus
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |