POV-Ray : Newsgroups : povray.binaries.images : Grid SDF for Isosurfaces : Re: Grid SDF for Isosurfaces Server Time
14 Jan 2025 19:29:40 EST (-0500)
  Re: Grid SDF for Isosurfaces  
From: Bald Eagle
Date: 10 Jan 2025 12:40:00
Message: <web.67815b3f74b4ba1ea2cb7a7025979125@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> Following up on the 3D and 2D SDF functions from Inigo Quilez' articles, I added
> macros to my libisosurfaces.inc library to implement his SDF duplication
> functions in SDL.  (https://github.com/carath63/povlibrary)

Seems very similar to what I did here:
https://news.povray.org/povray.binaries.images/thread/%3Cweb.5d3c5fe27be432e04eec112d0%40news.povray.org%3E/?ttop=44460
4&toff=600


> If you want the same object in all cells, your function just ignores
> cx,cz,idx,idz.  In this example, the shape is an Iso_sphere() scaled in the
> x,y,z directions to look like a flat stone.  The dimensions of the stone are
> based on the cell size (cx,cz) and noise functions that I call with
> (idx*cx,0,idz*cz).  I add further noise to get the rough edges of the stone
> based on idx*cx+x, and idz*cz+z.  I also generate a random rotation for each
> stone based on idx and idz, as well as random translations of the stone within
> the cell.  As you can see this sometimes causes stones to overlap, which I
> haven't bothered to try and fix.

For a quick, naive solution, I would imagine that if you just figure out what
the maximum possible offset is, then you could just expand your base cell size
to take that into account and not get any overlaps.

I was reading some interesting articles on "filling" space with patterns a while
back, and they had some interesting ways of going about that.

https://www.gorillasun.de/blog/a-simple-solution-for-shape-packing-in-2d/

Maybe you can make some sense of what they're doing.

- BW


Post a reply to this message

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