|
![](/i/fill.gif) |
"Edouard Poor" <pov### [at] edouard info> wrote:
> stbenge <THI### [at] hotmail com> wrote:
> >
> > The biggest reason I didn't model this as a mesh is because it's
> > currently impossible to use any proximity patterns with meshes. That's
> > right, impossible! Actually, if somebody can figure out how to get a
> > proximity pattern working with meshes, I would really appreciate it :)
>
> Just write your own inside() function. I gave it a go with the following, and it
> seems to work pretty well. It should really be improved with the equivalent of
> an inside_vector, so you can usefully use it with open meshes, but it's OK for
> a quick attempt.
>
> #macro inside_m( obj, pos )
> #local current = pos;
> #local dir = x;
> #local done = 0;
> #local num = 0;
> #while ( done != 1 )
> #local norm = <0,0,0>;
> #local inter = trace( obj, current, dir, norm );
> #if ( vlength( norm ) != 0 )
> #local num = num + 1;
> #local current = inter + <0.0001,0,0>;
> #else
> #local done = 1;
> #end
> #end
> (mod( num, 2 ) = 1)
> #end
>
> Cheers,
> Edouard.
Forgive me for being slow as usual, but could you could help me understand your
macro?
I suppose you could used the inside test to fill up the inside of a mesh with
cubes to make CSG approximation of a mesh shape--but that doesn't appear to be
what you did.
Post a reply to this message
|
![](/i/fill.gif) |