|
![](/i/fill.gif) |
In article <XabaOGJ2TFw0Mrf=rUXtavRUQB6F@4ax.com>, Peter Popov
<pet### [at] usa net> wrote:
...
> It *might* just work a prima vista but I doubt it as I typed it
> directly in the newsreader ;) Anyway, you get the idea.
This version seems to work fine, although I haven't heavily tested it
yet. It returns the lowest point instead of positioning the object on a
surface at y=0.
#macro FindLowestPoint(Object, Steps)
#local MinExt = min_extent(Object);
#local MaxExt = max_extent(Object);
#local Size = MaxExt-MinExt;
#local LowestPt = MaxExt;
#local Z=0;
#while(Z<Steps)
#local X=0;
#while(X<Steps)
#local TempPt = trace(Object,
MinExt+(<X,0,Z>*Size/(Steps-1))-y, y);
#if((TempPt.y<LowestPt.y)&((TempPt.x!=0)|(TempPt.y!=0)|(TempPt.z!=0)))
#local LowestPt = TempPt;
#end
#local X=X+1;
#end
#local Z=Z+1;
#end
(LowestPt)
#end
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |