POV-Ray : Newsgroups : povray.unofficial.patches : Density_file extention patch: a patch for 3D data Server Time
10 Oct 2026 05:08:04 EDT (-0400)
  Density_file extention patch: a patch for 3D data (Message 1 to 18 of 18)  
From: R  Suzuki
Subject: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 04:05:58
Message: <3d6dd5e6@news.povray.org>
As I promised in the message 
  http://news.povray.org/3be6713e$1@news.povray.org,
I've uploaded a patch for 3D data at
  http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm

Comments and suggestions are welcome.

R. Suzuki


Post a reply to this message

From: ABX
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 04:22:01
Message: <n8mrmusor79q44peol7b0d4f5jse5n4fjf@4ax.com>
On Thu, 29 Aug 2002 17:07:54 +0900, "R. Suzuki" <r-s### [at] aistgojp> wrote:
> As I promised in the message 
>   http://news.povray.org/3be6713e$1@news.povray.org,
> I've uploaded a patch for 3D data at
>   http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm
>
> Comments and suggestions are welcome.

I will add this to http://abx.art.pl/pov/patches/patches.php (with all patches
announced recently) as soon as possible.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 04:46:28
Message: <3D6DDF64.1627DB33@gmx.de>
"R. Suzuki" wrote:
> 
> As I promised in the message
>   http://news.povray.org/3be6713e$1@news.povray.org,
> I've uploaded a patch for 3D data at
>   http://staff.aist.go.jp/r-suzuki/e/povray/iso/df_body.htm
> 
> Comments and suggestions are welcome.

Looks interesting and useful, the data file format seems somewhat strange
though, as i understand it you always have two files, the header and the
actual data file.  Wouldn't it be better to merge them, like in the ppm
image file format for example?

A macro for generating a density file from a function (using the file
writing routines) would be a useful addition.

BTW it would be very helpful if you could separate you changes with
'#ifdef DENSITY_PATCH' otherwise one will have to do a lot of searching to
find what you have changed.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ingo
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 05:52:22
Message: <Xns9279797CC5021seed7@povray.org>
in news:3D6DDF64.1627DB33@gmx.de Christoph Hormann wrote:

> Wouldn't it be better to merge them, like in the ppm
> image file format for example?

Don't think so, it would mean that one has to convert datasets to a format 
readable by POV-Ray, now one can just "describe" the way the dataset is 
put together in the sepparate header file and use it staight away.

Ingo


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 05:56:24
Message: <3d6defc8@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3D6DDF64.1627DB33@gmx.de...
> Looks interesting and useful, the data file format seems somewhat strange
> though, as i understand it you always have two files, the header and the
> actual data file.  Wouldn't it be better to merge them, like in the ppm
> image file format for example?

It also allows one file if the filename of the data is not specified.
In this case, the data should be after the [data] line of the df file.

> A macro for generating a density file from a function (using the file
> writing routines) would be a useful addition.

It would be useful.

> BTW it would be very helpful if you could separate you changes with
> '#ifdef DENSITY_PATCH' otherwise one will have to do a lot of searching to
> find what you have changed.

OK.  I will add it in the next revision.

R. Suzuki


Post a reply to this message

From: ABX
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:10:06
Message: <6isrmu4o6nvn8hlcgel4vlg7mu2k74a6sb@4ax.com>
On Thu, 29 Aug 2002 18:58:20 +0900, "R. Suzuki" <r-s### [at] aistgojp> wrote:
> > A macro for generating a density file from a function (using the file
> > writing routines) would be a useful addition.
>
> It would be useful.

That's what I tried for "really smooth" proximity/blur pattern: sample space,
write samples to file, load it and interpolate between.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:12:47
Message: <3D6DF39E.65DE83E@gmx.de>
"R. Suzuki" wrote:
> 
> [...]
> 
> It also allows one file if the filename of the data is not specified.
> In this case, the data should be after the [data] line of the df file.
> 

I saw that after looking at the source code.  Some more documentation
about the header fields would be good, what does 'cyclic' mean for
example?

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ABX
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:13:02
Message: <gmsrmusgkrjpiajf5bk6ej8hnmntbbddvv@4ax.com>
On Thu, 29 Aug 2002 10:46:28 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> A macro for generating a density file from a function (using the file
> writing routines) would be a useful addition.

What about
  function 100,100,100{...}
?

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:17:38
Message: <3D6DF4C1.6381E31F@gmx.de>
ABX wrote:
> 
> > A macro for generating a density file from a function (using the file
> > writing routines) would be a useful addition.
> 
> What about
>   function 100,100,100{...}
> ?

Hmm, interesting, you mean for use in:

#declare DATA3D2= function { 
  pattern{
    density_file function 100,100,100{...}
    interpolate 2    
  }
}

But a 'save_file' option would be good (for the 2D version this would be
useful too BTW)

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:21:16
Message: <3d6df59c$1@news.povray.org>
"ABX" <abx### [at] abxartpl> wrote in message
news:n8mrmusor79q44peol7b0d4f5jse5n4fjf@4ax.com...
> I will add this to http://abx.art.pl/pov/patches/patches.php (with all patches
> announced recently) as soon as possible.

Thanks.  But I am still working on the coding.
The [Endian] option does not work at present.
And binary data formats in various platform should be added.

R. Suzuki


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 29 Aug 2002 06:42:16
Message: <3d6dfa88@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote 
> I saw that after looking at the source code.  Some more documentation
> about the header fields would be good, what does 'cyclic' mean for
> example?

Thanks for the comments.  I will add more documentation and examples.
The 'cyclic' is used for the cyclic pattern but I have not tested it yet.
Maybe there is a bug.

R. Suzuki


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 02:18:59
Message: <3d6f0e53$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote
> #declare DATA3D2= function {
>   pattern{
>     density_file function 100,100,100{...}
>     interpolate 2
>   }
> }

I have added this feature in the new patch uploaded today.
It also has a 'save file' option.
The below is an example code.

R. Suzuki

-----------------------------------------------
#version unofficial dfe 3.5;
#include "functions.inc"

camera { location  <25, 20, -40.0> look_at <0,0,0> direction 45.*z}
light_source { <1,1.4,-1>*5 color rgb <1.4,1.2,1.0>*1.7 }


#declare DATA3D2= function { pattern{
    density_file
      function 40,40,40 {f_noise3d(x*8,y*8,z*8)/4
                +f_sphere(x-0.5,y-0.5,z-0.5,0)}
//        df3 "povdata.df"
      interpolate 102
  }
}

 isosurface{
   function{
     DATA3D2(x,y,z)
   }
   contained_by{box{0.05,0.95}}
   max_gradient 3
   threshold 0.4

   texture{ pigment{color <0.8,0.7,0.7>}  finish{phong 0.30 phong_size 90}  }
   translate <-0.5,-0.5,-0.5>
 }


Post a reply to this message

From: Christoph Hormann
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 02:37:13
Message: <3D6F1298.90C2C927@gmx.de>
"R. Suzuki" wrote:
> 
> I have added this feature in the new patch uploaded today.
> It also has a 'save file' option.
> The below is an example code.
> 
> [...]

Great, but for the saving option i would rather use a different syntax
than the trick with the interpolation value.

Maybe:

#declare DATA3D2= function { pattern{
    density_file
      function 40,40,40 {f_noise3d(x*8,y*8,z*8)/4
                +f_sphere(x-0.5,y-0.5,z-0.5,0)}

      save_file {
        df3 "povdata.df"
        [type 0|1|2]
        [format 0|1]
      }

      interpolate 2
  }
}


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ABX
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 02:43:30
Message: <8t4umu4ipja647objsmoee5al5f7nkt4fq@4ax.com>
On Thu, 29 Aug 2002 19:23:12 +0900, "R. Suzuki" <r-s### [at] aistgojp> wrote:
> Thanks.  But I am still working on the coding.

I have added your patch and have changed navigation and administration (under
construction). Would you like to specify which files you have changed exactly.
I assume pvengine.h and some other are distributed in zip only becouse they
contain 'unofficial' notes. My intention was to list only files required to
changed to turn on patch.

http://www.abx.art.pl/pov/patches/patches.php

ABX


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 06:46:29
Message: <3d6f4d05@news.povray.org>
"ABX" <abx### [at] abxartpl> wrote in message
news:8t4umu4ipja647objsmoee5al5f7nkt4fq@4ax.com...
> On Thu, 29 Aug 2002 19:23:12 +0900, "R. Suzuki" <r-s### [at] aistgojp> wrote:
> > Thanks.  But I am still working on the coding.
>
> I have added your patch and have changed navigation and administration (under
> construction). Would you like to specify which files you have changed exactly.

I've added '#ifdef DENSITYFILE_PATCH' in the source files for the
density_file patch.

The source zip file also contains a language specific patch for Japanese
Windows.
I added '#ifdef LANG_PATCH' for this.

R. Suzuki


Post a reply to this message

From: ABX
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 07:08:57
Message: <5bkumu8344sbve94bkqh3k0l9k27jsbnnl@4ax.com>
On Fri, 30 Aug 2002 19:48:24 +0900, "R. Suzuki" <r-s### [at] aistgojp> wrote:
> I've added '#ifdef DENSITYFILE_PATCH' in the source files for the
> density_file patch.

Thanks, it helped me to remove not necessary files from database.

> The source zip file also contains a language specific patch for Japanese
> Windows.
> I added '#ifdef LANG_PATCH' for this.

Thanks for pointing it. I have added this as 'Japanese Language Patch'.
Additionally I have added categorization by author so you are listed with

http://www.abx.art.pl/pov/patches/patches.php?Author=R.Suzuki

Mail me if you want to be listed otherwise.

ABX


Post a reply to this message

From: R  Suzuki
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 30 Aug 2002 07:15:25
Message: <3d6f53cd$1@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote:
>       save_file {
>         df3 "povdata.df"
>         [type 0|1|2]
>         [format 0|1]
>       }

This would be better.  But it requires more work.

R. Suzuki


Post a reply to this message

From: William F  Pokorny
Subject: Re: Density_file extention patch: a patch for 3D data
Date: 27 Sep 2002 10:25:28
Message: <3D946A57.4A7FA579@attglobal.net>
Thank you very much for this patch.

I did run into a couple problems which  seem to be
driven by differences in platform and compiler.

1) In the file pattern.cpp I had to change the lines:

__inline float intp3(....)
__inline float intp3_2(...)

to

inline float intp3(...)
inline float intp3_2(...)

2) To prevent and endless loop after picking up the [Data]
token the following lines were changed in pattern.cpp:

char buf[256],w1[256],w2[256],Fname[256],w;
int x,y,z,sx,sy,sz,n,ofs=0,fmt=0,i,d;

to

char buf[256],w1[256],w2[256],Fname[256];
int x,y,z,sx,sy,sz,n,ofs=0,fmt=0,i,d,w;


I also found a couple of code changes which did not seem
to be  bracketed with #ifdef DENSITYFILE_PATCH
and #endif.

1) In pattern.cpp the line:
Tpat->Vals.Density_File   = NULL; //R.S. 17 Aug. '02

2) In pattern.cpp the lines:
  if (((i0&0xff)=='d')&&((i1&0xff)=='f')) return(0);
  else return (unsigned short)((((unsigned short)i0) << 8) | ((unsigned
short)i1));

should probably be:

#ifdef DENSITYFILE_PATCH
  if (((i0&0xff)=='d')&&((i1&0xff)=='f')) return(0);
  else return (unsigned short)((((unsigned short)i0) << 8) | ((unsigned
short)i1));
#else
  return (unsigned short)((((unsigned short)i0) << 8) | ((unsigned short)i1));
#endif

Regards, Bill P.

>
> Comments and suggestions are welcome.
>
> R. Suzuki


Post a reply to this message

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