POV-Ray : Newsgroups : povray.general : Elliptical Torus? : Re: Elliptical Torus? Server Time
2 Aug 2024 08:17:49 EDT (-0400)
  Re: Elliptical Torus?  
From: David Cameron
Date: 11 Feb 2005 14:05:26
Message: <420d01f6@news.povray.org>
> Wasn't it David Cameron who wrote:
> >Damn, I spoke too soon. :(
> >I did a simple CSG test with elliptical_torus before I posted my original
> >reply, and it seems to work OK.
> >I have since done further CSG tests which fail.
>
> You can only, reliably, perform difference and intersection operations on
> objects that have a defined 'inside'. A mesh only has an inside if you use
> the "inside_vector" when creating it, which param.inc doesn't do. The mesh
> also has to be closed, which is the case for this shape.
>
> I recommend reading the section in the documentation regarding solid mesh
> and inside_vector.
>
> To add an inside_vector to a mesh created by param.inc you actually have
to
> edit "makemesh.inc" and add a line something like
>          inside_vector <0, 0, 1>
> just before the final "}"
>
> For consistency, in case you want to pass param.inc a filename, change the
> line just before the #fclose to
>          #write(MeshFile, "\n  }\n  inside_vector <0, 0, 1>\n}")
>
>
>
>
> Alternatively, for these particular operations, you might be able to do
> something with these:
>
> #macro inside_half_elliptical_torus( x_major_radius, z_major_radius,
> minor_radius)
>   #declare Fx = function(u,v){cos(u)*(x_major_radius+minor_radius*cos(v))}
>   #declare Fz = function(u,v){sin(u)*(z_major_radius+minor_radius*cos(v))}
>   #declare Fy = function(u,v){minor_radius*sin(v)}
>
>   #include "param.inc"
>
>   object{
>     Parametric(
>        Fx, Fy, Fz,
>        <0,pi/2>,<2*pi,3*pi/2>,  // range changed
>        100,20,""
>     )
>   }
> #end
>
>
> #macro outside_half_elliptical_torus( x_major_radius, z_major_radius,
> minor_radius)
>   #declare Fx = function(u,v){cos(u)*(x_major_radius+minor_radius*cos(v))}
>   #declare Fz = function(u,v){sin(u)*(z_major_radius+minor_radius*cos(v))}
>   #declare Fy = function(u,v){minor_radius*sin(v)}
>
>   #include "param.inc"
>
>   object{
>     Parametric(
>        Fx, Fy, Fz,
>        <0,-pi/2>,<2*pi,pi/2>,   // range changed
>        100,20,""
>     )
>   }
> #end
>

Thanks again for all your help Mike,
I noticed the comments in the help file concerning CSG, inside_vector and
meshes.Unfortunately I have not worked with meshes or inside_vector before,
so at the moment I have no idea what to specify for the inside_vector. I
will have to do more reading and research to enlighten myself :)
I will report back if I find a solution.

I searched Google archives (newsgroups and net) regarding elliptical torii,
but found very little. I am surprised more people haven't come across a need
for this.

Anyway, I really appreciate your help Mike.

Cheers,
Dave


Post a reply to this message

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