POV-Ray : Newsgroups : povray.general : Conic Sweep questiom : Re: Conic Sweep questiom Server Time
11 Aug 2024 11:20:33 EDT (-0400)
  Re: Conic Sweep questiom  
From: David Wilkinson
Date: 2 Aug 1999 17:01:51
Message: <37a6028b.23909897@news.povray.org>
On Sun, 01 Aug 1999 14:56:59 -0500, Steve <ste### [at] puzzlecraftcom> wrote:

>I am making a flat top pyramid, 4 sided.
>
>What I need to know -
>
>1. How can I precisely position the thing?
>
>2. How can I precisely define the height - or, how does the starting
>point number work?
>
>#declare Base6 = prism
>{
>    linear_spline
>    conic_sweep
>    0.83, // What's the precise height? Where is this surface located?
>Should be 38 units high.
>    1,
>    5,
>    <32, 32 >,
>    <-32, 32 >,
>    <-32, -32 >,
>    <32, -32 >,
>    <32, 32 >
>    sturm
>    rotate <180, 0, 0>
>    translate <0, 0.119, 0>// it's actually located at -142y. How'd it
>get there with a +0.119 tanslation?
>    scale <1, 204, 1>// starting pyramid is 204 units high by 32 units
>square base.
>}
>
>THANKS for any help ya'll can offer!
>
>steve
>
Steve,
You need to scale, rotate, translate in that order.
This little macro does the trick for any dimensions and leaves the frustrated pyramid
sitting on <0,0,0>.
David

// --------------------pyramid macro--------------
#macro Pyramid_4_Side(Apex,Height,Side)
 prism
{
    conic_sweep
    1,
    1-Height/Apex,
    5,
    <Side, Side >,
    <-Side, Side >,
    <-Side, -Side >,
    <Side, -Side >,
    <Side, Side >
    scale <1,Apex,1> 
    rotate <180, 0, 0>
    translate <0, Apex, 0>
}
#end

object { Pyramid_4_Side(204,38,32)
         pigment { Red }
}
//-----------------end of program
------------
dav### [at] cwcomnet
http://www.hamiltonite.mcmail.com
------------


Post a reply to this message

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