How to remove internal part of a hex grid 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...



...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).
I ended up finding a reasonable solution myself:



Basically, I diffed two identical, non-hollow geometries, in which the first one had the cells larger than they needed to be (so overlapping with others), and the second one had them exactly of the right dimension:

difference() {
  base_geometry(range, angle, infill, extra_padding = 2);
  base_geometry(range, angle, infill, extra_padding = 0);
}


This way the only portion of the solid remaining was the extra_padding on the outer edges of the geometry.