POV-Ray : Newsgroups : povray.binaries.images : Moire patterns when trying to create isosurface sphere : Re: Moire patterns when trying to create isosurface sphere Server Time
27 Apr 2024 18:53:01 EDT (-0400)
  Re: Moire patterns when trying to create isosurface sphere  
From: clipka
Date: 7 Jan 2019 11:22:10
Message: <5c337cb2$1@news.povray.org>
Am 07.01.2019 um 12:53 schrieb jr:

>> The magnitude of the `polarity` paramezer is irrelevant, only the sign
>> matters (or, more precisely, whether the parameter is positive; zero has
>> the same effect as a negative value).
> 
> so why is the parameter a float, when (just) a boolean would seem to be a better
> fit?  future expansion?

No; I just think the parameter should be `polarity SIGN` rather than 
`positive_polarity BOOL`; but POV-Ray doesn't have a `SIGN` type, so I 
went for the next best thing, which is the sign of a `FLOAT`. So in a 
sense the "most official" syntax is `polarity +1` or `polarity -1`.

Since this has the side effect that `polarity on` /will/ also inevitably 
work, I opted to make `polarity off` work as well (meaning `polarity 0` 
would have to act like `polarity -1`).

Allowing for arbitrary magnitude was also pretty much a no-brainer, 
because it simplifies the implementation, while having the side effect 
that it is easier to use in cases where the polarity might be derived 
from some computed value.


Post a reply to this message

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