POV-Ray : Newsgroups : povray.newusers : help filling in the gaps : Re: help filling in the gaps Server Time
2 Nov 2024 17:19:34 EDT (-0400)
  Re: help filling in the gaps  
From:
Date: 24 Oct 2003 23:21:03
Message: <3f99ec1f@news.povray.org>
// Hi Thomas,
//
// your pieces seem to be flat, so a prism will do what you need.
// If the pieces are not transparent and are not seen from below,
// a polygon instead of the prism will suffice.
//
// I've provided a small scene below showing the piece you posted
// with a prism for the inside. Additionally I've changed the
// code for the spheres and cylinders which is unneccessarily
// complicated and inaccurate; only single precision seems to
// be used (270.000214 instead of 270), so these calculations
// should be done by POV-Ray's double precision arithmetic: you
// should change the code that generates the spheres and cylinders.
//
//    Sputnik


// Trapezoid with filled-in prism

// -F +D +A0.1 +AM2 +R3

#declare P1 = <0.1, 0.1, 0>;
#declare P2 = <0.1, 0.9, 0>;
#declare P3 = <0.90119, .89002, 0>; // try <1.2, 0.6, 0>
#declare P4 = <0.9, 0.1, 0>;
#declare Trpzd =
  union {
    sphere { P1, 0.1 }
    sphere { P2, 0.1 }
    sphere { P3, 0.1 }
    sphere { P4, 0.1 }
    cylinder { P1, P2, 0.1 }
    cylinder { P2, P3, 0.1 }
    cylinder { P3, P4, 0.1 }
    cylinder { P4, P1, 0.1 }
    prism { -0.1, 0.1, 4,
      <P1.x,P1.y>, <P2.x,P2.y>, <P3.x,P3.y>, <P4.x,P4.y>
      rotate -90*x
      }
    }

object { Trpzd
  pigment { color rgb 1 }
  finish { ambient .3 diffuse .7 }
  }

plane { -z, -0.1
  pigment { checker }
  finish { ambient .3 diffuse .7 }
  }

light_source { <-1, 2, -3>*100, rgb 1 }

camera { location -1.5*z look_at 0
  rotate <50, -20, 0>
  rotate -90*x
  translate <0.5, 0.4, 0>
  }


Post a reply to this message

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