POV-Ray : Newsgroups : povray.advanced-users : Math question for CSG : Re: Math question for CSG Server Time
29 Jul 2024 18:22:52 EDT (-0400)
  Re: Math question for CSG  
From: Ib Rasmussen
Date: 12 May 2001 04:16:16
Message: <3AFCF13E.8F5D61F1@ibras.dk>
CreeD wrote:
> 
> Hi,
>  I see that POV has a basic triangle built in shape, but I'm looking to do
> some CSG involving a large triangular shape.  What I'm eventually looking
> for is a prism on the xz plane with 6 points.  It's shaped like an
> equilateral triangle with the 3 points clipped off.  In other words, viewed
> from above it's a hexagon with 3 long sides and 3 short ones.  The short
> sides should equal exactly 1/3rd of the long ones.  Can someone give me the
> gist of how to come up with some exact coordinates for such a shape (or,
> ideally, post the code?)

Here is one solution:
 
intersection {
   box { <-1.5, 0, -1.5>, <1.5, 1, 1.5> }
   plane {-z, 0 translate <0, 0, -1> }
   plane {-z, 0 translate <0, 0, -1> rotate <0, 120, 0> }
   plane {-z, 0 translate <0, 0, -1> rotate <0, 240, 0> }
   plane {-z, 0 translate <0, 0, -1.4> rotate <0, 60, 0> }
   plane {-z, 0 translate <0, 0, -1.4> rotate <0, 180, 0> }
   plane {-z, 0 translate <0, 0, -1.4> rotate <0, 300, 0> }
}   
   
/Ib
-------------------------------
Gallery: http://www.ibras.dk


Post a reply to this message

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