POV-Ray : Newsgroups : povray.advanced-users : can anyone suggest a better solution for my problem? : Re: I guess there is no general solution..... Server Time
30 Jul 2024 08:25:42 EDT (-0400)
  Re: I guess there is no general solution.....  
From: Tor Olav Kristensen
Date: 7 Jul 2000 15:44:20
Message: <39663281.1A4417FC@online.no>
Oded wrote:
> 
> It actually can be easily solved, but still is problamatic, i'll detail:
> i was talking about a 12 facet polyhedra ( may an octahedron???)
> any way i have 12 symetric planes for which i need to find an object which
> consists of all the points that lay inside any 11 of the 12 planes, so
> orginally th problem was solved by:
> union {
> intersect(a1.....a11)
> intersect(a1.......a10,a12)
> etc.....
> intersect(a2.............a12)
> }
> but i simplyfied it to :
> union {
>     intersect ( 5 specific planes); #1
>     intersect ( 5 other specific planes); #2
>     etc...
>     intersect ( 5 other specific planes); #11
>     intersect ( 5 other specific planes);#12
> }
> it still is ugly, since i only have 12 planes, redifining each one 5 times
> is heavy on the parser and the renderer, the point is pov-ray does not
> include complex-csg objects, problems more complex than mine are not
> solvable in such a simple way, 9 out of 12 planes would be very big (9 over
> 12 = 220 objects).

How about putting the 12 planes into an array of planes ?
Then they would not to be redefined.


> Coding such a csg object is not much diiferent than an intersection or a
> union.
> about the macro, it just makes the code look better, the parser still does
> the same work...
> any way, thank you for your reply..
> feel free to reply furthur more

You could make a recursive macro to generate all 
the possible combinations of intersections of the
objects in the array.

An input parameter to this macro could be the number 
of objects to be left out in each intersection.

E.g.: If you wanted to generate all combinations of 
intersections of 9 out of 12 objects (e.g. planes), 
then you could give the number 3 as a parameter to 
the macro.

This would of course not be an easy macro to make,
but I have given it a little thought and I think
it is possible to make it.


> Tor Olav Kristensen <tto### [at] onlineno> wrote in message
> news:39593007.12993FFB@online.no...
> >
> > ...
> > Anyway I have a feeling that your problem (even
> > if I don't understand what it is :-) could easily be
> > solved by a macro with some loops that does
> > all the CSG.


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

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