POV-Ray : Newsgroups : povray.newusers : Importing solid body from data Server Time: 18 Jun 2019 06:50:17 GMT
  Importing solid body from data (Message 1 to 2 of 2)  
From: LeoBl
Subject: Importing solid body from data
Date: 20 Aug 2016 21:30:00
Message: <web.57b8cb18c1a12bafc2f2170b0@news.povray.org>
Hi,

I want to render a measured data set. I have it in a 3D NumPy array. The array
is binary - ones for solid locations, zeros for empty locations.

How can I import it to PovRay? I tried exporting .obj isosurface, but it gives
me just the surface, and I want the solid. Tried to go with a .df3 file - but a
density function is not really appropriate here - I don't want a density map,
but a solid body.

Another question: my data is quite "staircased" - lots of squares that result
from the measurement pixels. Once I import it, how can I smoothen it? There are
lots of noise functions in PovRay, is there something for denoising/smoothing?

Thanks!


Post a reply to this message

From: Alain
Subject: Re: Importing solid body from data
Date: 21 Aug 2016 22:14:22
Message: <57ba27be$1@news.povray.org>
Le 16-08-20 à 17:26, LeoBl a écrit :
> Hi,
>
> I want to render a measured data set. I have it in a 3D NumPy array. The array
> is binary - ones for solid locations, zeros for empty locations.
>
> How can I import it to PovRay? I tried exporting .obj isosurface, but it gives
> me just the surface, and I want the solid. Tried to go with a .df3 file - but a
> density function is not really appropriate here - I don't want a density map,
> but a solid body.

You can only render the surface of an object, or make it transparent and 
fill it with some media that use your data as a density map.
The object, even if you can only see it's surface, IS solid.
If you cut away from any object with a clipped_by object, you only get 
thin surfaces. You probably want to use a difference or intersection 
instead. This will fill up the cut.
If using an isosurface, DON'T use the open modifier.

>
> Another question: my data is quite "staircased" - lots of squares that result
> from the measurement pixels. Once I import it, how can I smoothen it? There are
> lots of noise functions in PovRay, is there something for denoising/smoothing?
>
> Thanks!
>
>

To reduce the "staircase" aspect, you can use one of the interpolation 
option. In your case, I'd simply use tri-linear interpolation. You may 
want to experiment with the other interpolation options, but tri-cubic 
interpolation WILL cause you some problems unless you replace your 0 by 
something like 0.01 and ones by something like 0.99.

Using interpolation is highly recomended if you use your 0-1 data with 
an isosurface. It will greatly reduce the max_gradient from near 
infinity to around 2.

An object that is transparent can be given an interior attribute that 
can make it refractive: interior{ior 1.5}// Typical glass


Post a reply to this message

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