POV-Ray : Newsgroups : povray.general : detemine diameter of bezier_spline lathe object? Server Time
1 Nov 2024 13:21:17 EDT (-0400)
  detemine diameter of bezier_spline lathe object? (Message 1 to 3 of 3)  
From: joe
Subject: detemine diameter of bezier_spline lathe object?
Date: 3 Sep 2012 22:10:00
Message: <web.5045628dd95a61f5ad797add0@news.povray.org>
I created a bezier_spline lathe object and I need the diameter of it at some
random point.  A point at which I have not used to define the object.  Is there
a method I can use to get this?


Post a reply to this message

From: Alain
Subject: Re: detemine diameter of bezier_spline lathe object?
Date: 4 Sep 2012 00:35:49
Message: <50458525@news.povray.org>

> I created a bezier_spline lathe object and I need the diameter of it at some
> random point.  A point at which I have not used to define the object.  Is there
> a method I can use to get this?
>
>
>
You can use the trace function. The lathe object is created around the Y 
axis.
Create it in a #declare statement and DON'T translate it in any way.
Call the trace from some point situated outside it's bounding box, along 
an axis with the direction vector pointing toward the Y axis:
#declare Normal=<0,0,0>;
#declare Loc= trace(Your_Lathe, <50,Elevation,0>, -x, Normal);

Elevation is used to travel up/down the lathe.
Normal is used to check if you effectively encopunter the object. If 
it's lenght is zero, it means that you missed your object.
Loc will contain the radius in it's X component and you can isolate it 
like this:
#declare Radius=Loc.x;

You can also trace from <0,Elevation,0> to start from the Y axis to find 
an inward facing location.

This should work in most cases. If you have a rather complexe shape, you 
may need to shoot your tracint ray at an angle up od down to find a 
point that would otherwise be masked by some surface.



Alain


Post a reply to this message

From: joe
Subject: Re: detemine diameter of bezier_spline lathe object?
Date: 4 Sep 2012 20:50:01
Message: <web.5046a0c82e2836bdad797add0@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> You can use the trace function. The lathe object is created around the Y
> axis.
> Create it in a #declare statement and DON'T translate it in any way.
> Call the trace from some point situated outside it's bounding box, along
> an axis with the direction vector pointing toward the Y axis:
> #declare Normal=<0,0,0>;
> #declare Loc= trace(Your_Lathe, <50,Elevation,0>, -x, Normal);
>
> Elevation is used to travel up/down the lathe.
> Normal is used to check if you effectively encopunter the object. If
> it's lenght is zero, it means that you missed your object.
> Loc will contain the radius in it's X component and you can isolate it
> like this:
> #declare Radius=Loc.x;
>
> You can also trace from <0,Elevation,0> to start from the Y axis to find
> an inward facing location.
>
> This should work in most cases. If you have a rather complexe shape, you
> may need to shoot your tracint ray at an angle up od down to find a
> point that would otherwise be masked by some surface.
>
> Alain

Thank you very much!!


Post a reply to this message

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