POV-Ray : Newsgroups : povray.text.scene-files : ObjectToDF3Example.pov for creating DF3 files with povray directly. Server Time
15 Oct 2024 02:40:01 EDT (-0400)
  ObjectToDF3Example.pov for creating DF3 files with povray directly. (Message 1 to 1 of 1)  
From: William F Pokorny
Subject: ObjectToDF3Example.pov for creating DF3 files with povray directly.
Date: 22 Sep 2013 21:27:52
Message: <523f9918$1@news.povray.org>
All,
I worked up a povray only solution for creating df3 files using objects 
grouped by color in the 0-1 unit space & the relatively new 
ARRAYS_WriteDF3() of arrays.inc.

As part of the attached code I have documented several DF3 issues I've 
found the hard way and I'll duplicate that information here so it 
eventually shows up in searches.

---
Notes on DF3 files in general no matter how used. Someday I'll have the 
time to put together a tutorial with images. Perhaps one or more explain 
why folks sometimes struggle with DF3 files.

1) Today we have 3 DF3 density file interpolation techniques 0,1 and 2. 
0 = NO_INTERPOLATION, 1 = TRILINEAR_INTERPOLATION and 2 = 
TRICUBIC_INTERPOLATION.

    - The 0 interpolation type is voxel centered.

    - The 1 & 2 types are vertice centered, shifting everything lower 
1/2 voxel.

      - If mixing the two types this is important to understand, 
especially with smaller DF3 files where the shift is relatively more 
substantial. Functions in isosurfaces or patterns can re-align.

2) Interpolation type 2 rings / wobbles when there are any surface 
protrusions, or when say a plane of one value has a larger or smaller 
value inserted in that plane. If using type 2 for anything you want to 
be numerically stable, use multiple single value coincident DF3 files. I 
tend not to use option 2 at all.

    a) Further, if the ring goes below 0 or above 1 it gets clamped at 0 
or 1.

3) Keep your DF3 data away from the array edges for interpolation types 
1 & 2.

    - Both techniques implement edge wrapping / handling which mangle 
things near the DF3 edges.

    - I'm now adding a buffer of 5 df3 voxels around meaningful inner 
values.

Bill P.


Post a reply to this message


Attachments:
Download 'utf-8' (7 KB)

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