POV-Ray : Newsgroups : povray.advanced-users : How to do a fill in : Re: How to do a fill in Server Time
29 Jul 2024 20:13:05 EDT (-0400)
  Re: How to do a fill in  
From: Geoff Wedig
Date: 18 Jan 2001 08:09:35
Message: <3a66eb0f$1@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:

> On 17 Jan 2001 13:41:09 -0500, Geoff Wedig wrote:
>>No planar form will work, since the height component will get added later.     

> Please explain what you mean by "the height component will get added later."
> Are the vertices going to have different heights?  If so, there are lots
> of different solutions for the same problem, but none of the easy ones will
> look good.

Ok, let me see if I can explain.  I have a general surface that is never
perpendicular to the z plane  (ie, there are no caves or cliffs).  I
take a set of 2D coordinants <x,y> that I want to raise the surface from  In this
case, raising is defined as moving outwards according to the normal at the
surface at the points <x,y,z(x,y)> where z(x,y) is the height of the surface
at <x,y>.  The set of <X,y> elements have been chosen so that there is not a
great deal of curvature between pairs of x,y elements.  In general, the z
surface is well behaved in this fashion.

Now, I want to create a companion surface above the general surface, with
points <x', y', z'> = <x,y,z(x,y)> + d * N(<x,y,z(x,y)>) where d is some
distance and N(p) is the normal of the surface at point p.

I've tried a variety of methods to do this, and if there is another one, I'd
be interested, but the mesh tesselation approach seems the most promising. 
In this case, I have the outer ring of points and must make a surface based
on it.  What Might be required is a more detailed tesselation, so that
surface details are not lost.

However, even assuming that the surface is totally flat, it is not obvious
how to fill the hole with an accurate mesh without resorting to polygon or
some other primitive that won't work in the 3D case.

What I am now considering is doing a circular reduction.  Ie, for each point,
there is an inside and an outside.  There is also a direction of the inside,
defined by the angle at the point.  So, given some small distance, we can
calculate two points that are offset from the main point that are guaranteed
to be inside the surface.  We can place two triangles between the two
original points and there inside points.  Do this all the way around the
object.  Repeat for the reduced object.  When the line segments from point
to inside point cross, average the insides and do a single triangle instead.

The above should work for anything, assuming the distance is small enough. 
But it would generate a large mesh, which may be unnecessary if the 3D
object is close to flat.  One possibility is determining where the inside
direction lines cross, and checking the normal at that point.  If it doesn't
vary much from the normals at the two original points, create a single
triangle and short circuit this whole mess.  But this is getting very
complex for something that should be mostly simple.

So, anyone got any bright ideas?

Geoff


Post a reply to this message

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