

Le 171027 Ã 21:03, Bald Eagle a Ã©critÂ :
> I was trying to create a cylindrical pigment pattern with a color map, and use
> that inside of a hexagon pigment pattern.
>
> Does the center of the cylindrical pattern not start at the center of each
> hexagon?
> This seems like odd and unexpected behaviour to me.
>
> But it's late and it was a long day, so maybe I'm botching something that's
> otherwise simple.
>
>
>
> #version 3.71;
>
> global_settings {
> assumed_gamma 1.0
> }
>
> #declare Aspect = image_width/image_height;
> camera {
> location <0, 5, 5>
> right x*Aspect
> look_at <0, 0, 0>
> }
>
> #include "colors.inc"
>
> light_source {<0, 50, 0> 1}
>
> #declare Hole =
> pigment {
> cylindrical
> color_map {
> [0.0 White]
> [0.5 White]
> [0.5 Black]
> [1.0 Black]
> }
> }
>
> plane {y, 0
> pigment {
> hexagon
> pigment {Hole},
> pigment {Hole},
> pigment {Hole}
> }
> }
>
>
>
>
That pattern is centered arount the Y axis. So, if you want it somewhere
else, you need to translate it accordingly.
In your case, some judicious and creative use of warp repeat, with some
offset, may be more indicated.
Post a reply to this message




"Bald Eagle" <cre### [at] netscapenet> wrote:
> I think I might have to write a function pigment with mod() to pattern the
> plane.
All ye here, witness thee the math[s] suckification:
(at least the pattern sorta matches up with the spheres...)
#version 3.71;
global_settings {
assumed_gamma 1.0
}
#declare Aspect = image_width/image_height;
camera {
location <0, 15, 0.001>
right x*Aspect
look_at <0, 0, 0>
}
#include "colors.inc"
#include "stbHexPatterns.inc"
light_source {<0, 50, 0> 1}
#declare Hole =
pigment {
cylindrical // cylinder shaped gradient along the Yaxis
color_map {
[0.0 White]
[0.5 White]
[0.5 Black]
[1.0 Black]
}
}
#declare Hex = 2*sin (pi/3);
// 0.03655205525709550570167739213998
//#declare HexGrid = function { abs(x + mod(x, 2)*1.5) + abs(z + mod(z,
sin(pi/3))) + sqrt(pow(x,2)+pow(z,2)) + 0*y}
//#declare HexGrid = function { x + mod(x, 2)*1.5 + z + mod(z, sin(pi/3)) +
sqrt(pow(x + mod(x, 2)*1.5,2)+pow(z + mod(z, sin(pi/3)),2)) + 0*y}
//#declare HexGrid = function { (x + mod(x/2, 2)*1.5) + (z + mod(z, sin(pi/3)))
+ sqrt(pow(x + mod(x, 2)*1.5,2)+pow(z + mod(z, sin(pi/3)),2)) + 0*y}
//#declare HexGrid = function { (x + mod(sqrt(pow(x + mod(x, 2)*1.5,2)+pow(z +
mod(z, sin(pi/3)),2)), 2)*1.5) + (z + mod(sqrt(pow(x + mod(x, 2)*1.5,2)+pow(z +
mod(z, sin(pi/3)),2)), sin(pi/3))) + 0*y}
//#declare HexGrid = function {select ( sin(z*Hex/3),
mod(abs(x),2)+sqrt(pow(mod(abs(x),2),2)+pow(mod(abs(z),2),2)1),
mod(abs(x),2)+sqrt(pow(mod(abs(x),2),2)0.5+pow(mod(abs(z),2),2))0.5,
mod(abs(x),2)+sqrt(pow(mod(abs(x),2),2)+pow(mod(abs(z),2),2)Hex) )}
//#declare HexGrid = function {select ( sin(z*Hex),
mod(abs(x),2)+sqrt(pow(mod(abs(x),2),2)+pow(mod(abs(z),2),2)1), 0, 1 )}
#declare XStep = 3;
#declare ZZ1 = function {x+sin(z*Hex/2)}
#declare ZZ = function {x+sin(z*2*Hex)}
//#declare Cyl = function {sqrt (pow(x,2)+pow(z,2))*2}
#declare Cyl = function {sqrt (pow(ZZ1(x, y, z),2)+pow(z,2))/3}
//#declare HexGrid = function {Cyl (mod(abs(x),XStep)XStep/2, y,
mod(abs(z),Hex/2)Hex/4)}
#declare HexGrid = function {Cyl (mod(abs(ZZ(x, y, z)),XStep)XStep/2, y,
mod(abs(z),Hex/2)Hex/4)}
//#declare HexGrid = function {Cyl (mod(abs(x),XStep)XStep/2, y,
mod(abs(z),Hex/2)Hex/4)}
sphere {0, 1/5 pigment {Green}}
plane {y, 0
pigment {
//function {HexGrid (x, y, z)} translate x*1.5 translate z*Hex/4
function {HexGrid (x, y, z)} translate x*0.75 translate z*Hex/4
//pigment {Hole},
//pigment {Hole translate<0, 0, Hex>},
//pigment {Hole translate<0, 0, 2*Hex>}
}
}
union {
#local R = 1;
#local XN = 10;
#local YN = 20;
#local J = YN;
#while(J < YN)
#local K = XN;
#while(K < XN)
sphere {< K*3*R + mod(J, 2)*1.5*R, 0, sin(pi/3)*R*J>, R/10}
// sphere {< K*3*R + 1.5*J*R, sin(pi/3)*R*J, 0>, R}
#local K = K + 1;
#end
#local J = J + 1;
#end
texture {
pigment {Red}
}
}
Maybe this needs to be done similar to the way isosurfaces are blobbed
together....
Post a reply to this message

