POV-Ray : Newsgroups : povray.general : Still making newbie mistakes : Re: Still making newbie mistakes Server Time
29 Jul 2024 10:24:02 EDT (-0400)
  Re: Still making newbie mistakes  
From: Cousin Ricky
Date: 3 Apr 2013 11:05:00
Message: <web.515c44a1c4a906bb78641e0c0@news.povray.org>
"Sohcahtoa" <kil### [at] yahoocom> wrote:
> You could fix it by either putting a call to the macro in parentheses, or
> putting parentheses around the math in the macro definition, like this:
>
> #macro Basic_shape (Rpipe, Rsaddle)
>   (1 - sqrt
>   ( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
>   + RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
>   - RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
>   ))
> #end

Good programming practice suggests the latter.  The caller shouldn't have to
babysit the macro.  See also:

  http://www.povray.org/documentation/view/3.6.1/243/#s02_02_02_08_04


Post a reply to this message

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