POV-Ray : Newsgroups : povray.general : Creating a Hexagonal Mesh? : Re: Creating a Hexagonal Mesh? Server Time
1 Aug 2024 20:12:09 EDT (-0400)
  Re: Creating a Hexagonal Mesh?  
From: McLilith
Date: 13 Apr 2005 15:42:50
Message: <425d763a$1@news.povray.org>
Mike Williams wrote:
> Wasn't it McLilith who wrote:
> 
>>Does anyone know of a fairly simple way to create hexagonal mesh in 
>>POV-Ray? I want a 3D object, not a pattern. Here's a couple photos of 
>>something similar to what I have in mind:
> 
> 
> I'd probably do it like this, unless I needed rounded edges:
> 
> #version 3.6;
> global_settings {assumed_gamma 1.0}
> camera { location  <6, 0, -10> look_at <0, 0, 0> angle 30}
> light_source {<100,200,-100> colour rgb 1}
> 
> #declare W=3;           // Width of whole thing
> #declare T=0.03;        // Thickness
> #declare S=5;           // Inverse scale
> 
> #include "functions.inc"
> isosurface {
>   function { 1-f_hex_x(x*S,y*S,z,0)}
>   threshold 0.25        // breadth
>   max_gradient 4.6      // will need tweaking when other params change
>   contained_by{box {-<W,W,T>,<W,W,T>}}
>   pigment {rgb 1}
> }
> 

Thanks a lot, that looks great!

For my needs, I dropped the threshold down to 0.15 and it's practically 
perfect.

Thanks again,
McLilith


Post a reply to this message

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