POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
19 Apr 2024 18:27:14 EDT (-0400)
  Re: Minimum Distance Function  
From: jceddy
Date: 14 Jul 2022 18:10:00
Message: <web.62d093c06fb4e448314aa6845d51d79c@news.povray.org>
> Next step (after some more testing) will be to implement Proximity() for other
> object types.

Implemented Proximity() now for:

Mesh
Sphere
Box
Triangle
Plane
Disc
Cone (includes cylinder)

For non-solid objects like Triangle, Disc, Cone (if open), the proximity will
always be positive, since there is no well-defined "inside", so for testing
isosurfaces, I set threshold to 0.001 instead of 0.0, so it actually renders a
little thickness around the object.

I also implemented fn_nearest_point, that returns the nearest point calculated
by the Proximity() code.

So for proximity, you define the function like this:

#declare fn_X = function { proximity { shape } }

For nearest_point, you define the function like this:

#declare fn_N = function { nearest_point { shape } }

proximity functions return a double
nearest_point functions return a 3d vector position <x, y, z>

Attached a test render for an open cone, with some test points arrayed around
it.


Post a reply to this message


Attachments:
Download 'test_new.png' (91 KB)

Preview of image 'test_new.png'
test_new.png


 

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