POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
15 Aug 2022 08:40:06 EDT (-0400)
  Re: Minimum Distance Function  
From: Bald Eagle
Date: 7 Jul 2022 19:00:00
Message: <web.62c764c36fb4e4481f9dae3025979125@news.povray.org>
"jceddy" <jce### [at] gmailcom> wrote:

> One thing I am curious about, that I haven't dug into yet, is if I can get more
> information about the object being passed to the function and possible enable
> performance improvements based on that. I started down this path because I have
> a mesh object I am working with that I want this functionality for...in the case
> where the "top level" object is a mesh, and I could get access to the mesh data,
> I have a feeling I could improved this quite a bit for that specific use case.

So, first off, this is very interesting, and exciting, that you have C++
development experience, and seem to understand enough to be able to write your
own source code function and plug it into POV-Ray.

I've been interested in doing that ever since I read about Leigh Orf's work on
weather data and super cells.

Several of us have bounced around the idea of having the ability to work with
convex hulls and point-clouds, and this seems to be very closely related to

The idea I had was to have a POV-Ray object that would be simply a set of 3D
vectors, or points.  The advantage being that one could apply things like matrix
transforms to the data without having to loop through all the points in SDL,
which would be very slow in comparison to a source code subroutine.

So, I'm thinking that for your mesh, you would have a set of vertices - so why
not treat those as a point cloud?

Then you could have a tool to just find the minimum Euclidian distance between
the camera and all of the points in the cloud.  I ... feel ... there's some way
to optimize that so you don't have to check every single point. (?)

Then maybe there's a way to generate a true mesh object from the point cloud
object - which would be useful for folks who would like to take a bunch of
points and make a mesh out of its convex hull.

I'm light on details, and fast and loose with mostly everything, because I'm
pretty sure you already understand what I'm suggesting, and have your own ideas
about how best to approach all of this.

Finally, It would be great if you could provide a few posts detailing your
thought processes and some of the pertinent details about how to go about
writing on'es own function and getting POV-Ray to recognize and use it as a
built-in function.  That would greatly help anyone who has enough programming
experience to do so, but doesn't have the time to invest in tracking down all of
the details on the learning curve of doing that for POV-Ray - it's not like any
of that is really documented anywhere, and Dr. Orf's explanation, although good,
seemed like it was brief and geared to people who might already know how to do

Thanks, and I hope you have a lot of success with your project!

- Bill

Post a reply to this message

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