Skip to content

recipe 01 fillet never applies: radius 8 exceeds the 5mm leg thickness, hidden by ?? fallback #105

Description

@gsdali

Found while running the version comparison for #101.

The defect

recipes/01-mounting-bracket/main.swift:40:

var bracket = prism.filleted(edges: prism.concaveEdges(), radius: filletRadius) ?? prism

With the recipe's own parameters, filletRadius = 8 and thickness = 5, this always returns
nil
and the ?? prism fallback fires. The bracket ships with a sharp inside corner.

A fillet radius of 8 mm cannot be placed on a 5 mm thick leg: the radius exceeds the material.
Measured directly on the recipe's prism:

r=8.0 (configured) -> nil (FALLBACK FIRES) removed=0.00
r=5.0              -> nil (FALLBACK FIRES) removed=0.00
r=4.9              -> ok  removed=475.01
r=3.0              -> ok  removed=176.42

Corroborated end to end: reproducing the full recipe shows prism = 19000.00 and
afterFillet = 19000.00, identical, at OCCTSwift 1.3.1, 1.15.0 and 1.17.0 alike. This has never
worked, at any version.

Why it matters

The fillet is advertised in three places:

  • main.swift:4, "an L-bracket with a filleted inside corner"
  • main.swift:7-8, which explains selecting it "geometrically with Shape.concaveEdges()
    (OCCTSwift v1.3.1, #171) rather than by a fragile edge index"
  • the README's description and its "OCCTSwift APIs used" list

The recipe is a reference example whose stated purpose is demonstrating concaveEdges()-driven
filleting, and that is the one thing it does not do.

Suggested fix

  1. Pick a radius that fits. Anything below the 5 mm leg thickness works; 3 mm removes
    176.42 mm3 and leaves a sensible bracket. 4 mm is probably the largest sane choice.
  2. Remove the silent fallback. ?? prism should not be how an advertised feature degrades.
    Force-unwrap or fail loudly, as recipe 03 chamfer never applies: chamfered() returns nil and the ?? fallback hides it #103 did for the flange chamfer.
  3. Regenerate output.brep, which is needed for recipe 01 (mounting-bracket) volume drifts 2.27% from committed reference under OCCTSwift 1.17.0 #101 anyway.

Related

This is the third instance of the same pattern:

Common shape: an optional-returning geometry op degrades silently via ??, the output still looks
plausible by every metric measured, and the docs keep describing the intended behaviour. Worth
considering a sweep for ?? fallbacks on geometry operations across the recipes, and a policy
line about it, rather than fixing them one at a time as they are discovered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions