POV-Ray : Newsgroups : povray.general : curved prism object : Re: curved prism object Server Time
29 Jul 2024 20:27:31 EDT (-0400)
  Re: curved prism object  
From: Alain
Date: 18 Aug 2010 21:57:12
Message: <4c6c8f78$1@news.povray.org>

> Alain, I like your sample it seems like the answer I'm looking for but I am
> still short of fully grasping spline_beziers.
>
> Can you show your prism sample on this jpg picture
>
> http://www.kitchendesigned.com/public_download/bezier_sample.jpg
>
> I need to see which parameters correspond to which sides of cabinet, I need to
> see them visually on the  bezier_sample.jpg, then I can fully understand it.
> If you could just replace prism arguments with S1_x, ... etc.  And show on the
> picture which side is which, I would be grateful. jes### [at] yahoocom
> My project is really stuck on this bezier issue.

  #declare S1_x = 0;
  #declare S1_y = 0;
//Bottom left on the image

  #declare S2_x = 0;
  #declare S2_y = 4;
//Top left

  #declare S3_x = 4;
  #declare S3_y = 4;
//Top right

  #declare S4_x = 4;
  #declare S4_y = 3;
//Start of curved part on the right

  #declare S5_x = 1;
  #declare S5_y = 0;
//End of curved part on the bottom

  prism{bezier_spline 0,0.1, 20
  <S1_x,S1_y>,<0,1>,<0,3>,<S2_x,S2_y>, // straight
  <S2_x,S2_y><1,4><3,4><S3_x,S3_y>  // straight
  <S3_x,S3_y><4,3.5><4,3.5><S4_x,S4_y>  // straight
  <S4_x,S4_y>,<3.0,0.95>,<0.9,3.5>,<S5_x,S5_y>, // curve
  <S5_x,S5_y>,<0,0>,<1,0>,<S1_x,S1_y>   // straight
  pigment{rgb 1}
  }

The last point = the first to close the prism.
The last point of each group of 4 is also the first point of the next group.
The total number of points is always a multiple of 4.
In the sample, the prism's thickness is 0.1 unit, good for a shelve.
It's acceptable, for the straight parts, to have something like this:
<S1_x,S1_y>,<S2_x,S2_y>,<S1_x,S1_y>,<S2_x,S2_y>



Alain


Post a reply to this message

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