POV-Ray : Newsgroups : povray.general : Help! Can anyone figure this math? : Re: Help! Can anyone figure this math? Server Time
13 Aug 2024 19:29:22 EDT (-0400)
  Re: Help! Can anyone figure this math?  
From: Peter Popov
Date: 31 Aug 1998 17:28:12
Message: <35eb075c.0@news.povray.org>
It may be too late now, but I have a question: can't you use spheres to join
cones? Here's a clip from an include I am writing:

// Last, Current, Next are vectors
// RLast,  RCurrent, RNext are floats

union
{ cone { Last, RLast, Current, RCurrent }
   cone { Current, RCurrent, Next, RNext }

intersection
{
    sphere { Current, RCurrent }
    union
    {
        intersection
        {
            plane { Next-Current, 0 translate Current }
            plane { Current-Last, 0 translate Current inverse }
        }
        intersection
        {
            plane { Next-Current, 0 translate Current inverse}
            plane { Last-Current, 0 translate Current inverse}
        }
    }
    bounded_by { sphere { Current, RCurrent*1.00001 } }
}

}

The rather complex CSG is used to ensure that only the part of the sphere
joining the two cones is used, and the rest is clipped.

Hope this helps.

Peter

P.S. I am not very good in intersecting planes, so this code isn't very
clear. If you find a better way to do the above please post it here. 10x


Post a reply to this message

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