POV-Ray : Newsgroups : povray.general : Can anyone explain this Server Time
6 Nov 2024 18:25:59 EST (-0500)
  Can anyone explain this (Message 1 to 3 of 3)  
From: Mick Hazelgrove
Subject: Can anyone explain this
Date: 23 Nov 1998 16:24:39
Message: <3659d297.0@news.povray.org>
Can anyone explain why there is a gap between the triangles?

Mick



camera{location  <0.0, 0.5, -20.0>
look_at   <0.0, 0.0,  0.0>
}

light_source{<-30, 30, -30>,color rgb<1,1,1>}

// ----------------------------------------
#declare Roof = union{

#declare Rad = 1.5;
#declare D = Rad*2
#declare Circ = pi*D;
#declare Base = Circ/8;
#declare Height = -1;
#declare Peak = <0,0,0>;
#declare Pt1 = <-Base/2,Height,Rad>;
#declare Pt2 = <Base/2,Height,Rad>;
#declare Count = 0;
#declare Angle = 0;

#while(Count<8)

        object{triangle{Pt1,Peak,Pt2
                rotate y*Angle
                }}

     #declare Count = Count +1;
     #declare Angle = Angle + 360/8;

#end
}

object {Roof pigment{White}}


Post a reply to this message

From: Nathan Kopp
Subject: Re: Can anyone explain this
Date: 23 Nov 1998 19:07:07
Message: <3659F7A9.74DCB072@Kopp.com>
Mick Hazelgrove wrote:
> 
> Can anyone explain why there is a gap between the triangles?
> 
> Mick
> 

Change the code to compute the base from
  #declare Base = Circ/8;
to
  #declare Base = 2*Rad*tan(pi/8);

I got this formula from
http://www.geom.umn.edu/docs/reference/CRC-formulas/book.html
(in section 5.3 "Regular Polygons")

-Nathan Kopp


Post a reply to this message

From: Dan Connelly
Subject: Re: Can anyone explain this
Date: 23 Nov 1998 20:43:43
Message: <365A0F52.654D847F@flash.net>
There's really no need for formulas... let POV do the work:


#local dTheta = 45;
#local Pt1 = vrotate(<0, Height, Rad>, dTheta/2 * y);
#local Pt2 = <-1, 1, 1> * Pt1;

#local Roof =
  union {
    #local T = 0;
    #while (T < 360)
      triangle {
        Pt1,
        0,
        Pt2
        rotate T * y
      }
      #declare T = T + dTheta;
    #end
  }



>> #declare Pt1 = <-Base/2,Height,Rad>;
>> #declare Pt2 = <Base/2,Height,Rad>;
>   #declare Base = Circ/8;
>   #declare Base = 2*Rad*tan(pi/8);
-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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