POV-Ray : Newsgroups : povray.general : Creating a Hexagonal Mesh? : Re: Creating a Hexagonal Mesh? Server Time
1 Aug 2024 20:11:36 EDT (-0400)
  Re: Creating a Hexagonal Mesh?  
From: Mike Williams
Date: 13 Apr 2005 15:37:14
Message: <SQYnbDAATXXCFwZq@econym.demon.co.uk>
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}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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