POV-Ray : Newsgroups : povray.newusers : Isosurface and f_spiral - bug or feature? : Re: Isosurface and f_spiral - bug or feature? Server Time
2 May 2024 02:02:38 EDT (-0400)
  Re: Isosurface and f_spiral - bug or feature?  
From: Bald Eagle
Date: 30 Sep 2017 09:05:01
Message: <web.59cf95b2808cf4025cafe28e0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> To Bald Eagle:
> That's some nice detective work with the source code; way beyond my skills.

Thanks, Kenneth - I could probably use a LOT more practice in working with cpp -
I've only had the opportunity to dabble a tiny bit with Perl, cpp, C#, python,
BASIC (of course), and maybe one or two other languages.
Someone probably tried to show me Pascal in the 80's....

It's usually just a matter of copy/paste, reformatting to figure out the large
brush strokes and indenting them properly to keep everything straight, and then
fiddling with syntax differences and doing some searching to figure out "Now WTF
is _THAT_ mathematical / function / logical operator ????  Does POV-Ray even
HAVE that???"

> Currently, the center sphere size seems(?) to be 'coupled' to the spiral's
> thickness parameter, as part of the same code(?) (I thought the sphere was
> simply an added object!) I wonder if its size/diameter could be 'un-coupled' in
> some way-- so that it *maintains* a much smaller and visually less obtrusive
> size, no matter what the spiral thickness is-- while still serving its original
> purpose.

Yes.  And at this point I believe that it has something to with:

#declare r2 = mod (r, Spacing) - (Spacing/2);
and then
#declare r2 = sqrt(r2*r2 + Y*Y);
or
#declare r2 = pow( (pow(abs(r2), temp) + pow(abs(Y), temp)), 1/temp);


Why: because the whole point of the code is to finally spit out:

#declare VALUE = -min( Dia - r, Thickness - min(r2, r) );

So, the first half of the min comparison is just a limitation of the major
radius r so that it doesn't overrun the maximum diameter parameter that the user
passes to the isosurface function.
r2 is sort of like the minor radius for a torus.

So, with:
Thickness - min(r2, r)

it can't be Thickness, because that's a parameter, it can't be r - because
that's just where on the spiral you are, so it has to be r2 being way out of
scale with the other values at/near the origin.

Unary negative of a LARGE r2 subtracted from a smaller scalar (Thickness) gives
- a positive value.

picture making circles with some calculated radius.  You can keep making the
radius smaller, until it hits zero, and then --- becomes increasingly negative.
Which is just the same circles, only "inside out" - but they can still get
large.
And I believe that somewhere in that logic and the calculations, that
subtraction of r2 from thickness is sufficiently "inside out" to make a
spherical bulge near the origin - where r is very small.

Got a bunch to do today / this weekend, so I dunno if I'll get to this, but I'm
thinking:
plot out the values of those parts of the equations relative to Thickness and r.
  Throw some abs()'s in there and see if it fixes anything.

*** See what the exact radius of that sphere is - I'll bet that would be an
important datum to have.


Hope this helps some.

:)


Post a reply to this message

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