POV-Ray : Newsgroups : povray.unofficial.patches : Density_file extention patch: a patch for 3D data Server Time
5 Jul 2024 12:39:52 EDT (-0400)
  Density_file extention patch: a patch for 3D data (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
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

<<< Previous 8 Messages Goto Initial 10 Messages

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