POV-Ray : Newsgroups : povray.general : Hexagon pattern with 4 or 7 colors? : Re: Hexagon pattern with 4 or 7 colors? Server Time
28 Apr 2024 10:25:46 EDT (-0400)
  Re: Hexagon pattern with 4 or 7 colors?  
From: Bald Eagle
Date: 3 May 2018 15:15:06
Message: <web.5aeb5f7d97bd1601c437ac910@news.povray.org>
> > 1. Declare this as a standalone texture for use in an include file.
> > That way perhaps we can start a NewPatterns_v1.inc or something.
>
> Yes, either that or maybe as a macro (?)

Well, elaborating on my initial brief post, the whole idea was that it could
probably be implemented as a macro, so that the user could pass parameters to
it.
But also that the include file would/could be a growing repository of new
patterns and variations on themes.  Once 10, 20, 30 patterns got added, it might
make into the next version distribution.


> Yes again. Although, *what if* the user wanted different finishes for the
> different hexagons? (Imagine a hexagonal wood floor!) I guess that would require
>  a "NewPatterns_v2" ;-)  A more complex version, in other words.

Implement it so that you can use a texture_map rather than just a pigment_map.
That way you can pass a full texture or just a pigment.  Or even go so far as to
make it a material_map.
Or have 3 macros, each a little different.
Author's choice as always.  ;)


> > Better still, since that still leaves out the implies "unit length of
> > a side", make it
> > #declare SideLength = 1;
> > #declare Edge2Edge = 2 * SideLength * sin (60);
> >
> > and then scale <3, 1, (3 * Edge2Edge)>
>
> Hmm, I think that might be redundant-- only because the shape of a hexagon is
> 'fixed'. Adding those #declares would only add more bulk to the code (or perhaps
> only 'explanatory' code.) And, if someone wanted to 'stretch' the hexagons, that
> would be done more easily by a final scaling of the whole pattern, as with the
> current implementation.

True, but I think that a lot of posted code and code that can spur people on to
develop new patterns and textures ought to have as much info so that the next
guy can hit the ground running without having to unravel the meaning of his
archaeological find.


> And I'm currently mulling over thought-experiments of how to get the random
> colors to include not only the hue, but the saturation and brightness as well.
> Maybe that should be "NewPatterns_v3", ha-- if I can get it to work.

Well, don't use rgb - use the HSV2RGB macro in colors.inc.
That takes an "rgbft" vector as input (HSVft) and returns rgbft.
#declare it as a color rgbft and THEN use it in your pigment / texture or else
you'll get a "suspicious expression after rgb" warning for every instance.

> I haven't investigated this further; perhaps there's a way around it-- or
> maybe it was due to my own early and uninformed use of the warp{repeat..}
> offsets. (?) I should probably go back and try again.
>
> But back to your idea of hexagon outlines: I think it would require a more
> sophisticated version of something like the 'brick' pattern, with its mortar
> lines. A hexagon-shaped version!

Right.  I'm thinking the key has to be in a cylindrical or spherical pattern, or
maybe triangular with a gradient running from center to edge.

That quantum dot thread had something like that going on - I'll have to go back
and look through that.  There was a LOT of development going on at a very rapid
pace.  Too rapid for me to absorb it.


Post a reply to this message

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