POV-Ray : Newsgroups : povray.binaries.images : Helical SDF for Isosurfaces : Re: Helical SDF for Isosurfaces Server Time
4 Jan 2025 18:11:03 EST (-0500)
  Re: Helical SDF for Isosurfaces  
From: Kenneth
Date: 24 Dec 2024 09:40:00
Message: <web.676ac6794a98c6d6e83955656e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:

> >
> > Sorry if I totally misunderstood the problem(?)
>
> Nope - you got it.
> I had a few spare minutes last night and pasted Chris' fix into my scene and it
> worked as claimed.
>
> Maybe start with a fresh copy of my scene and make the minimum necessary
> correction.
> (comment out my Theta function, and just paste Chris' 2 functions in after
> that.)
>
> I'm guessing that you have something in your scene that snuck in that you
> haven't undone.
>

Interesting! I need to take another look at that. Admittedly, my eyes and brain
were starting to fuzz over from hours of 'ultra concentration' (although I
thought I double-checked everything before posting...)

Meanwhile...

I came up with this little change for your own code, using 'clamp'. It might be
considered a 'hack', but it solves two problems at once: no more truncated
spirals; and the rifling is now continuous in both +x and -x (with no glitch at
x=0.)

#declare Helix = function {select (mod (Theta(clamp(x,0,1.0),y,z),
                 tau/3) - tau/6, 0.25, 0.35)}

Limitations:
clamp's 'max' value needs to be 1.0 (or any integer multiple of 1.0; it doesn't
seem to matter.) But no fractional part.

The first tau's divisor: any integer of 1.0 or greater, no fractional part.

The second tau's divisor can be anything > 1.0, any float value.


Post a reply to this message


Attachments:
Download 'rifling_for_be_3__kw.jpg' (261 KB)

Preview of image 'rifling_for_be_3__kw.jpg'
rifling_for_be_3__kw.jpg


 

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