POV-Ray : Newsgroups : povray.general : Semi Scaled cone : Re: Semi Scaled cone Server Time
2 Aug 2024 08:16:14 EDT (-0400)
  Re: Semi Scaled cone  
From: Mike Williams
Date: 13 Dec 2004 08:30:14
Message: <JXo6pDAclZvBFw3p@econym.demon.co.uk>
Wasn't it Barehunter who wrote:
>Hello. As I do pictures I keep having this same problem. I need to make a
>cone that has a scale applied to only one end. I'll give an example. I want
>to make a Forearm. One end is at the elbow and the other at the wrist. Now
>the elbow end can have a normal diameter, but the wrist end will need to be
>a little flattened. I use window version. Any advice?

You can make something a bit like that from a cubic.

Let's consider the general case where you want to have elliptical ends
given by the 2d equations

        A2x2  +  B2y2  -  1  =  0
        C2x2  +  D2y2  -  1  =  0

then that can be achieved by
 cubic {<0,0,C*C-A*A,A*A,0,0,0,0,0,0,0,D*D-B*B,B*B,0,0,0,0,0,0,-1>}
that expands to
       (C2-A2)zx2 +A2x2 +(D2-B2)zy2 + B2y2 -1 = 0
so when z=0 you get
                   A2x2             + B2y2 -1 = 0
and when z=1 the A2x2s and B2y2s cancel out leaving
        C2x2            +D2y2              -1 = 0

You then need to chop off the bits outside the range, and may want to
translate and stretch it, something like this. The "sturm" may be
required for some values of A,B,C,D.

intersection {
  box {<-2,-2,0><2,2,1>}
  cubic {
    <0,0,C*C-A*A,A*A,0,0,0,0,0,0,0,D*D-B*B,B*B,0,0,0,0,0,0,-1> 
    sturm
  }
  pigment {rgb 1}
  translate -0.5*z
  scale <1,1,10>
}

To have a circle at one end, set A and B to the same value.

This doesn't quite do exactly what you want because the sides aren't
perfectly straight like they would be in a true cone.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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