POV-Ray : Newsgroups : povray.general : Suggestion for new object : Re: Suggestion for new object Server Time
13 Aug 2024 19:27:25 EDT (-0400)
  Re: Suggestion for new object  
From: Dan Connelly
Date: 6 Jul 1998 22:28:34
Message: <35A179AE.62A93251@flash.net>
PoD wrote:
> 
> Dan Connelly wrote:
> >
> > This is pretty trivial with #macro, union, and polygon.
> >
> > for example (not debugged)
> >
> > #macro metabox(P0, P1, P2, P3, P4, P5, P6, P7)
> >   union {
> >     polygon {5, P0, P1, P2, P3, P0}
> >     polygon {5, P4, P5, P6, P7, P4}
> >     polygon {5, P0, P1, P5, P4, P0}
> >     polygon {5, P1, P2, P6, P5, P1}
> >     polygon {5, P2, P3, P7, P6, P3}
> >     polygon {5, P3, P0, P4, P7, P3}
> >   }
> > #end
> 
> But that can't be CSGd.

You are absolutely correct : soon after firing off my reply in
my usual reckless fashion, I realized I was proposing a shell
and not a solid object... like Bezier patch objects.

Unfortunately, the solid object is harder to define.  First of
all, if the faces are planar, the vertices overspecify the problem,
as there is no guarantee that a plane can be defined which
intersects a given set of four points in 3-d space.

I believe the way to specify the object would need to be via
other parameters.  An example would be 6 normal vectors 
from the origin to the planes... 6 points instead of 8.

Alternatively, the object can be specified in terms of 6
of the 8 vertices, such that each face has exactly 3 points
specified (each point shared by 3 planes).

The implementation becomes the intersection of 6 planes, with some
care taken to avoid "sign errors" in the CSG (if the normal
specification is used)... if the object
is constrained to include the origin, this is easy, otherwise
there is some bookkeeping to be done.


Dan


-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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