POV-Ray : Newsgroups : povray.advanced-users : DF3 density file generation for a generic 3D object ? : DF3 density file generation for a generic 3D object ? Server Time
8 Jul 2024 19:12:32 EDT (-0400)
  DF3 density file generation for a generic 3D object ?  
From: Antonio Ferrari
Date: 1 Oct 2007 11:10:00
Message: <web.47010cde36c235964e64f15d0@news.povray.org>
Prerequisites:

1) Having a generic closed object O;
2) Being able to apply inside(O,V) operator for a generic vector V
3) Being able to write DF3 files using povray language, maybe applying the
patch "Extended Density File"

What I'm looking for:

I'm looking for a macro for generating a DF3 file in output for the interior
of the object O passed to the macro. I'd like that the density is a function
of the minimal distance of V from the external surface of O: for V internal,
density[V] = density_function(minimal_distance(O,V)). In particular I'd like
a function the make the density greater when moving toward the interior of
O, where the increment could be linear, exponential, logarithmic, etc.

Is there a function for calculating the minimal distance of an internal
point V from the contour of O?

Have you any idea?

Do you think that only a patch could give me the expected result?

Some time ago I had the following idea: calculating the dimensions X, Y and
Z of the box containing O. Subdivide both X, Y and Z into n segments. Use
of 3 innested loops for x, y and z axis in order to cycle the segments and
see if the are or are not part of the interior of O. This is a sort of
sampling method. The greater n is, the more accurate the samples are.

Then I needed an algorithm for finding interior points at first level,
second level, third level, etc. The greater the level, the higher the
density, for example.

Oh these are just ideas. I don't know if I'm on the right way.

Bye,
A.


Post a reply to this message

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