POV-Ray : Newsgroups : povray.binaries.images : Isosurface doodle : Re: Isosurface doodle Server Time
7 Nov 2024 07:34:24 EST (-0500)
  Re: Isosurface doodle  
From: Bald Eagle
Date: 17 Jul 2016 14:40:01
Message: <web.578bd050ca82f27f5e7df57c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 16.07.2016 um 18:24 schrieb Bald Eagle:
>
> > Is there a good way to "get" such a matrix of 3D points from patterns in
> > POV-Ray?  I don't quite understand how the infinite patterns for pigments are
> > generated, stored, and used internally.
>
> For most patterns, the principle is quite simple: To compute the pattern
> value at a particular point in space, a pattern-specific algorithm takes
> the coordinates of the points, does some mathematical operations on
> them, and spits out a result. So in essence, each pattern is a
> mathematical formula.

I got that - after working with SDL for the past several years and reading a
gazillion posts and {gasp!} the documentation, this seems to be the way most
everything is determined - pigment patterns, textures, etc.

I decided to try to work out how to plot a 3D network of points based on what is
presented here:
https://en.wikipedia.org/wiki/Diamond_cubic#Mathematical_structure

It's hard to tell how poorly written this is until you try to actually use it
for anything.  All of the statements are (probably) technically correct and very
specifically factual, but they don't really get you anywhere, and it's very
confusing to follow once you try to get at the meat of it.

This didn't really seem to work so well:

#declare Basis = array[8] {<0, 0, 0>, <0, 2, 2>, <2, 0, 2>, <2, 2, 0>, <3, 3,
3>, <3, 1, 1>, <1, 3, 1>, <1, 1, 3>};
#declare B = dimension_size (Basis, 1);
#declare Multipliers = array[7] {<4, 0, 0>, <0, 4, 0>, <0, 0, 4>, <4, 4, 0>, <4,
0, 4>, <0, 4, 4>, <4, 4, 4>};
#declare M = dimension_size (Multipliers, 1);

#for (i, 0, 4)
 #for (j, 0, M-1)
  #for (k, 0, B-1)
   sphere {Basis[k]+(Multipliers[j]*i) 0.5 pigment {Green} }
   // {Be sure to include debug.inc file!}
#debug concat( " i = ", str (i, 3, 1),  " j = ", str (j, 3, 1), " k = ", str (k,
3, 1), " \n")
#debug concat( "Basis[k]: ", vstr (3, Basis[k], ", ", 2, 0), "   Multipliers[j]:
", vstr (3, Multipliers[j], ", ", 2, 0), "   (Multipliers[j]*i)", vstr (3,
(Multipliers[j]*i), ", ", 2, 0), "\n" )
#debug concat( "Sphere at: ", vstr (3, Basis[k]+(Multipliers[j]*i), ", ", 2, 0),
" \n\n")
  #end
 #end // end j
#end // end i


Post a reply to this message

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