POV-Ray : Newsgroups : povray.general : curved prism object Server Time
30 Jul 2024 00:18:06 EDT (-0400)
  curved prism object (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
From: StephenS
Subject: Re: curved prism object
Date: 18 Aug 2010 18:10:01
Message: <web.4c6c59cde055a0282b3213b50@news.povray.org>
"optima" <jes### [at] yahoocom> wrote:
.....
> 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.
.....
I've posted an example picture of a prism (bezier_spline) in the
povray.binaries.images news group. It shows both straight and curved sections
and the pov code it is based on.
Hope this helps.

Stephen S


Post a reply to this message

From: Alain
Subject: Re: curved prism object
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

From: optima
Subject: Re: curved prism object
Date: 19 Aug 2010 05:00:00
Message: <web.4c6cf215e055a0286556a6ea0@news.povray.org>
Alain and StephenS

thank you very much, your guidance solved a major problem for me, I think I'll
figure out the rest from here, thanks again


Post a reply to this message

From: optima
Subject: Re: curved prism object
Date: 19 Aug 2010 09:55:01
Message: <web.4c6d3760e055a028eeb1283e0@news.povray.org>
Alain and Stephen S

thank you for your previous help but I got stuck one more time, the picture
below explains nicely why I am stuck. Can you tell me what am I doing wrong?

http://www.kitchendesigned.com/public_download/bezier_.jpg

I appreciate your kind efforts very much.


Post a reply to this message

From: optima
Subject: Re: curved prism object
Date: 19 Aug 2010 12:50:00
Message: <web.4c6d6078e055a028eeb1283e0@news.povray.org>
Alain and StephenS , sorry if this is a repost.
I solved the problem partially, if I change the length on a side of cabinet
bezier_spline stops working correctly, it disappears altogether.

The picture below explains what's wrong, I thank you for any help you provide.

http://www.kitchendesigned.com/public_download/bezier_.jpg


Post a reply to this message

From: StephenS
Subject: Re: curved prism object
Date: 19 Aug 2010 17:40:00
Message: <web.4c6da39be055a028966838e80@news.povray.org>
"optima" <jes### [at] yahoocom> wrote:
> Alain and StephenS , sorry if this is a repost.
> I solved the problem partially, if I change the length on a side of cabinet
> bezier_spline stops working correctly, it disappears altogether.
>
> The picture below explains what's wrong, I thank you for any help you provide.
>
> http://www.kitchendesigned.com/public_download/bezier_.jpg

Your last point needs to be the same as your first point (0,90) or povray will
add another line to close the prism. This may be causing you problems.

Picture updated in povray.binaries.images

Stephen S


Post a reply to this message

From: optima
Subject: Re: curved prism object
Date: 19 Aug 2010 18:45:01
Message: <web.4c6db2c5e055a028eeb1283e0@news.povray.org>
StephenS

thank you very much, you are right opening and closing points must be the same
(0,90) in this case. I solved my problem for now, but since the cabinets side
measurements are changeable by the user I hope I can get the curve's (2nd and 3
rd) points correctly calculated. I am trying to figure out the algorithm for
that. If any formulas come to mind I'll be thankful for any idea.

appreciate everything,
optima


Post a reply to this message

From: Alain
Subject: Re: curved prism object
Date: 20 Aug 2010 12:23:33
Message: <4c6eac05$1@news.povray.org>

> StephenS
>
> thank you very much, you are right opening and closing points must be the same
> (0,90) in this case. I solved my problem for now, but since the cabinets side
> measurements are changeable by the user I hope I can get the curve's (2nd and 3
> rd) points correctly calculated. I am trying to figure out the algorithm for
> that. If any formulas come to mind I'll be thankful for any idea.
>
> appreciate everything,
> optima
>
>

When using a bezier spline, the last point of any segment MUST be the 
same as the first point of the next segment. Also, the last point of the 
last segment must be the same as the first point of the first segment.
With that kind of spline, there is no auto-closing as there is with the 
other spline types.


Alain


Post a reply to this message

From: Alain
Subject: Re: curved prism object
Date: 20 Aug 2010 12:30:00
Message: <4c6ead88$1@news.povray.org>

> Alain and Stephen S
>
> thank you for your previous help but I got stuck one more time, the picture
> below explains nicely why I am stuck. Can you tell me what am I doing wrong?
>
> http://www.kitchendesigned.com/public_download/bezier_.jpg
>
> I appreciate your kind efforts very much.
>
>

The last point of segment E is not the same as the first of segment A: 
<0,115> VS. <0,90>

When using bezier spline, there is NO auto-closing of the shape. If the 
spline is open, it disapears completely. That's because you can no 
longer unequivocaly determine if any point is inside the prism or not.


Alain


Post a reply to this message

From: optima
Subject: Re: curved prism object
Date: 21 Aug 2010 04:40:00
Message: <web.4c6f8fd8e055a028eeb1283e0@news.povray.org>
Thank you Alain , I solved the problem of bezier_splines with your and Stephen S
helping.

optima


Post a reply to this message

<<< Previous 8 Messages Goto Initial 10 Messages

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