1. About
  2. Features
  3. Explore

I am modelling a few cut templates to be used on an hexagonal grid (honeycomb) material using OpenSCAD. Basically, from a reference cell, I need to select all cells that are within a given range and given angle.

I implemented this by creating an in memory grid that covers an area larger than what I need (extra range, 360 degrees), and then testing each cell for both the distance and angle requirements, extruding only those that test positive for both conditions.

Everything works as expected...

Range = 15, Angle = 60°

...but now I would also like to add the possibility to have the outer contour of the template without having each individual cell within it (so, a single thin line going around the whole "pizza slice" above).

I'm pretty new to OpenSCAD: what would be the best approach here? (I'm happy even with a solution that requires to re-implement what done until now).

1 Answer 1

Unfortunately, OpenSCAD does not have a 2D hull() transformation, although it has been requested. You might be able to find a pre-written package that implements a 2D hull. However, if all you want is a hexagonal grid with a border of some arbitrary shape, could you not cheat, and get your slicer to generate the grid for you? All you would need to do is generate the envelope, and then slice with a hexagonal grid as in-fill, and request no top or bottom layers. Most slicers will do hexagonal in-fill.

If you want to do it all in OpenSCAD, then I would go about it like this:

  1. Create a 2D grid, similar to what you have now.
  2. Create a 2D outline of the shape you want, undersized so that you can add a manifold (as a perimeter).
  3. Duplicate this shape.
  4. Add a manifold to the first copy.
  5. Create an intersection of the second copy and the grid.
  6. Create a union of the two copies.
  7. Extrude the union.