POV-Ray : Newsgroups : povray.general : ANNOUNCE: IsoWood Include 0.1 : Re: ANNOUNCE: IsoWood Include 0.1 Server Time
9 Aug 2024 03:26:06 EDT (-0400)
  Re: ANNOUNCE: IsoWood Include 0.1  
From: Ron Parker
Date: 22 Aug 2000 12:55:14
Message: <slrn8q5crp.1bm.ron.parker@fwi.com>
On Tue, 22 Aug 2000 10:33:21 -0500, Chris Huff wrote:
>Sorry, I read "...proximity pattern would probably be quite slow. I just 
>thought it would be nice if you could define the shape with a linear
>spline." as defining the shape of the *function* with a linear spline. I 
>understand what you mean now, but I don't see an easy way to do it...and 
>prisms will probably be one of the objects which have to use the old 
>proximity calculation.

Even linear spline prisms?  Whyever for?  There's a simple procedure to
determine the distance of a point from an arbitrary polygon[1].  The 
proximity is then the minimum over all the edges and the two caps of the 
prism.

Beware, though: the proximity function may be continuous, but it is not
continuously differentiable, and that might matter to the isosurface 
solver.

[1] determine the closest point on the plane in which the polygon lies.
If it's inside the polygon, the distance is the distance to that point.
Otherwise, it's the minimum of the distances to the line segments[2]
that bound the polygon.

[2] determine the closest point on the line in which the segment lies.
If it's inside the segment, the distance is the distance to that point.
Otherwise, it's the smaller of the distances to the endpoints of the
line segments.[3]

[3] Though for efficiency's sake, you should only compute it for one 
of the endpoints.  The other endpoint is either the endpoint of another
line segment for which you must check endpoints, or it's the closest 
point on that other line segment, or that other line segment contains 
a closer point.[4]

[4] The same argument applies to the line segments themselves (they're 
shared between polygons) and in the case of a prism, it's easy to decide
which you should check for a given face.[5]  For a mesh, you will have to 
mark the ones you've already checked (don't forget to mark the boundaries
of polygons that contained their respective nearest points.)

[5] But watch the orientations.  Nothing sucks worse than checking the 
same endpoint twice while ignoring the other endpoint altogether.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

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