knotflow Handbook Deutsch Lessons Modeller ↗ Source

Chapter 8

Rounded edges

knotflow rounds edges exactly: with true circular arcs that touch both sides, not with many small facets. Rounded edges look better, feel nicer in the hand and break off less often; down on the print bed, a first layer that has spread out (the "elephant's foot") shows less at a rounded edge.

Which edge with what

Edge Tool Example
corners of an outline or a profile fillet(curve, r) cup, fidget_rings_rounded
rectangle with rounded corners rounded_rectangle(w, h, r)
box with all edges rounded rounded_box(w, d, h, r) rounded_plate
outline pulled up, rounded at top and bottom rounded_extrude(outline, h, r) rounded_shapes
any edge profile around an outline around(profile, outline)
boss with a fillet at its foot boss(outline, height, r) rounded_plate
round an edge of a finished solid fillet_edges(shape, point, r) edges, tee, soap_dish
chamfer an edge of a finished solid chamfer_edges(shape, point, d) edges, picture_frame

Behind these are two ways:

A fillet is a rounding in an inner corner, such as the foot of a boss: there material is added. At an outer edge the rounding takes material away.

fillet: rounding the corners of a curve

let profile = polyline([(0, 0), (20, 0), (20, 30), (0, 30)], closed: true)

export extrude(fillet(rectangle(40, 20), 3), 5) color "terracotta"
export extrude(fillet(rectangle(40, 20), [6, 0, 6, 0]), 5) |> move(x: 50) color "ochre"
export revolve(fillet(profile, p => if p.x == 0 then 0 else 4)) |> move(x: 110) color "sage"

All corners rounded, only two corners rounded, a turned profile with rounded edges

fillet(curve, r) replaces every corner of a flat curve with a circular arc of radius r. r comes in three forms:

The third form is needed for profiles for revolve. A profile that begins on the axis has corners there. Round them, and turning makes a small dent in the middle of the floor and the top.

A cup with rounded edges

The example cup rounds the profile from chapter 6 before turning it:

param height   = 95  in 40..200 "height [mm]"
param wall     = 2.4 in 0.8..6  "wall thickness [mm]"
param rounding = 1   in 0..3    "radius of the rounded edges [mm] (at most half the wall)"

let floor   = line((0, 0), (32, 0))
let side    = interpolate([(32, 0), (46, 0.45 * height), (40, height)])
let profile = thicken(chain([floor, side]), wall)

export revolve(fillet(profile, p => if abs(p.x) < 1e-6 then 0 else min(rounding, wall / 2))) color "terracotta"

Upright edges

For the upright edges of a part pulled up, round the outline: extrude(fillet(outline, r), h). The same goes for holes with rounded corners (in perforate or as a difference): round the outline of the hole.

Ready-made shapes: rounded_rectangle, rounded_box, rounded_extrude

let ell = fillet(polyline([(0, 0), (50, 0), (50, 25), (25, 25), (25, 50), (0, 50)], closed: true), 6)

export rounded_box(40, 30, 20, 4) |> move(z: 10) color "blue"
export rounded_extrude(ell, 12, 2.5) |> move(x: 35, y: -25) color "terracotta"

around: carrying an edge profile around an outline

rounded_box and rounded_extrude are built with around. around(profile, outline) carries a profile once around a flat, closed outline, the way revolve turns a profile around the axis. In the profile,

That way you can build any edge shape, for example a plate with a chamfer at the top:

let chamfer = polyline([(0, 0), (4, 0), (4, 6), (2, 8), (0, 8)])
export solid(around(chamfer, rounded_rectangle(40, 20, 6))) color "plum"

rounded_box, rounded_extrude of an L, a plate with a chamfer from around

Bosses with a rounded foot: boss

Where a boss stands on a plate, the corner should be round on the inside, a fillet at its foot. It makes the boss sturdier and the part easier to print. boss(outline, height, r) builds a boss with a rounded foot of radius r, standing on z = 0; union puts it on the plate:

param thick = 6 in 5..12 "plate thickness [mm]"

let plate = rounded_box(60, 40, thick, 2) |> move(z: thick / 2)
let peg   = boss(circle(6), 12, 2) |> move(z: thick)
let hole  = cylinder((0, 0, -1), (0, 0, thick + 13), 2.5)

export difference(union(plate, peg), hole) color "sage"

A plate with rounded edges and four bosses with rounded feet, drilled

The example rounded_plate puts it all together: a plate from rounded_box, four bosses from boss, holes with difference, and an assert that reports when the bosses come too close.

Edges of finished solids: fillet_edges, chamfer_edges

param corner = 6 in 1..12  "Rounding of the upright edges [mm]"
param foot   = 3 in 0.5..6 "Fillet at the boss's foot [mm]"

let (w, d, h) = (60, 40, 12)
let (boss, height, hole) = (11, 14, 5)

let block = box(w, d, h) |> move(z: h / 2)
let part = difference(union(block, cylinder((0, 0, h / 2), (0, 0, h + height), boss)),
                      cylinder((0, 0, -1), (0, 0, h + height + 1), hole))

let upright = [(x * w / 2, y * d / 2, h / 2) | x <- [-1, 1], y <- [-1, 1]]

export part
  |> fillet_edges(_, upright, corner)
  |> fillet_edges(_, (boss, 0, h), foot)
  |> fillet_edges(_, (boss, 0, h + height), 1.5)
  |> chamfer_edges(_, (hole, 0, h + height), 1)
  color "teal"

A block with a boss and a hole, edges rounded and chamfered

Which edges work:

For the first two, the rounding is exact: a circular arc touching both faces. For curved edges and runs of edges a ball of radius r rolls along the edge. knotflow computes it at many places along the edge, the stations, and spans a surface through its sections there; where the edge bends more, the stations lie closer together. The rounding dips r/100 into the faces (at r = 2 mm, 0.02 mm), so that the Boolean operations find a clean cut, as with boss. Chamfers work on all these edges.

let b = fillet_edges(box(40, 20, 10), [(20, 10, 0), (-20, 10, 0), (-20, -10, 0), (20, -10, 0)], 5)
export fillet_edges(b, (0, 10, 5), 2)

The ball rolls round roundings at least as large as the new one (here 5 mm). Over tighter ones the run is mitred, as if the corners were sharp; that holds when only some corners are tighter too (example mixed_run). A run that goes round all corners but one sharp one ends at that corner against itself; fillet_edges reports that.

let tee = union(cylinder((-50, 0, 0), (50, 0, 0), 12), cylinder((0, 0, 0), (0, 0, 42), 8))
export fillet_edges(tee, (0, 8, sqrt(12 ^ 2 - 8 ^ 2)), 3)

Two pipes as a tee, rounded, with a hole through (example tee)

The examples show the cases one by one:

How that works inside, and why touching is the hard part, is in lesson 3.10.

What the messages say

The most common messages; all of them, with their remedies, are in chapter 14.

Message what is going on, what helps
the roundings at both ends of the side near … overlap: make them smaller Two arcs on one side need more room together than the side is long: smaller radii.
the rounding of 2 mm at the corner … does not fit between the corners next to it – at most about … The arc does not fit between the corners next to it; the message names the largest radius that fits.
the section has an inward corner near … around: fillet the outline first.
no edge near …: the nearest is … away fillet_edges: the point is too far from every edge; point closer to the edge.
the rounding of … mm does not fit at the edge at …: the faces next to it are too short or too curved The faces next to the edge do not reach as far as the radius, or they curve too much: make it smaller.
the edge at … is only partly an edge of the shape Another part cuts the edge off, or three rounded edges would meet in a ball corner (see below).
the edge at … is not an edge of the shape there There is no edge there, for instance at the rim of an earlier rounding: round in another order.

Limits

What is listed above under "Which edges work" works, at corners too: mitred, over tight corners and in mixed runs. The following is not built:

Some combinations of rounded solids are weak spots of the Boolean operations; they give a message or an open mesh:

How the roundings come about is explained in lesson 3.9 (curves) and lesson 3.10 (edges of solids).