POV-Ray : Newsgroups : povray.bugreports : inside() results in: Parse Error: Expected 'operand', object identifier, found instead : Re: inside() results in: Parse Error: Expected 'operand',objectidentifier, = Server Time
3 Jun 2025 23:20:57 EDT (-0400)
  Re: inside() results in: Parse Error: Expected 'operand',objectidentifier, =  
From: Kenneth
Date: 31 May 2025 06:15:00
Message: <web.683ad4363675925ce83955656e066e29@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
>
> Adding to that:
>
> //---
> #version 3.7;
>
> #declare V = <1,2,3>;
> #declare OBJ = torus { 5,1 }
>
> // #declare F = function { inside(OBJ, V) }
>     #declare F = function { pattern { object { OBJ } } }
>
> plane { -z, 0
>      pigment { function { F(x,y,z) } }
>      finish { emission 1 }
> }

So, by moving the z plane in increments-- as 2-D slices-- we get a nice *visual*
representation of which parts of the torus are 'inside' or 'outside'.

But can the V vector here still be used in some way-- with the object
*function*-- to determine if that particular point is inside/outside? (I admit
that I have trouble understanding some of the subtleties and limitations of
function use.)

I tried two naive tests, but both resulted in fatal parse errors for one reason
or another:

1) As a purely visual test, to see if the plane object would appear either fully
white or fully black:
plane { -z, 0
     pigment { function { F(V.x,V.y,V.z) } }
      finish { emission 1 }
}

2)
#if(inside(F(x,y,z),V))
// -- do something--
#else
#end

In one of the old posts mentioned previously (from 2010), Thorsten posted the
following...although I might be taking his remarks out of context:

> As you can see, "inside" is not in the list of built-in functions for use in
> "function" statements.
>
> However, you can still access an object inside a function by using the object
> pattern. This works because you can declare pattern functions...

I'm not sure what 'access' means... but does it imply that there *is* a way to
use the V vector in the example here?


Post a reply to this message

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