It’s great to be able to chamfer boolean operations between shapes, but something missing is the ability to generate chamfered shaped initially.
let
chamfered_rect = size -> chamfer_r ->
let
r = size / 2 - chamfer_r;
in
make_shape {
dist[x,y,z,t] =
if (abs(x) > abs(r@X) && abs(y) > abs(r@Y))
(abs(x)-abs(r@X)+abs(y)-abs(r@Y)) - chamfer_r
else
(max(abs([x,y]) - (r + chamfer_r)));
bbox = [[-r@X,-r@Y,0],[r@X,r@Y,0]];
is_2d = true;
}
;
in
show_dist (chamfered_rect (2, 3) .5)
This could be added as a .chamfered
alternate distance field like .exact
or .mitred
and could be added to all of the primitives with sharp edges. since it would be an addition it should not break any backwards compatibility.