Skip to content

HCAD v0.33.0 — fillets on curved junctions

Pre-release
Pre-release

Choose a tag to compare

@Tibiaworx Tibiaworx released this 15 Aug 22:07
· 55 commits to main since this release

Fillets now work where a raised feature meets the part below it — the circular junction that previously could not be rounded at all.

Fillets

  • Concave rims on curved walls round through the mesh-surgery engine, holding the ideal torus to 0.12% of the radius.
  • A fillet running out onto a curved wall now sits flush in it, instead of leaving a square tab standing proud of the wall or stopping short in a straight chord.
  • Its seam lines run wall to wall and stop there, rather than overshooting into space or ending short.
  • Picking part of a curved rim takes its own corner and nothing else: exact to 0.5% of the analytic volume at any pick size, in about 25 ms where a 24-facet pick used to take a minute.

Fixes

  • A circular cut no longer wedges the exact kernel. Any circular cut with Seamless off could freeze the application outright; a tolerance floor keeps truck's boolean away from tolerances its projection cannot converge to.

Windows installer attached. Requires the VC++ Redistributable, which the installer bundles.


Install

Windows: download hcad-v0.33.0-windows-x86_64.exe and run it.

Linux (AppImage): download hcad-v0.33.0-linux-x86_64.AppImage below, then:

chmod +x hcad-v0.33.0-linux-x86_64.AppImage
./hcad-v0.33.0-linux-x86_64.AppImage

Self-contained — no install needed. Requires a working Vulkan driver and xdg-desktop-portal (standard on modern desktops). Built for x86_64, glibc 2.39+ (Ubuntu 24.04+ / Fedora 40+ etc.).


Changes since v0.25.0 (the previous GitHub build)

HCAD ships nightly-ish builds on the dev server; these versions landed between GitHub releases. Notes below, download/install boilerplate trimmed.

v0.32.1 — Convex rims on curved walls get the good fillet engine

Fillets on curved walls.

  • A rim on a cylinder, cone or any tessellated curved wall now goes through the mesh-surgery fillet instead of being refused. Measured on a 32-gon cylinder's top rim at radii from 0.2 to 3.5: the ideal torus held to 0.12% of r, the exact removed volume to 0.1%, and no sharp edges added — smoother than the CSG round it was previously forced onto.
  • A finely tessellated arc is no longer mistaken for a straight run. It used to be split into a few long straight runs and filleted with one crisp cylinder each — faceted where it should curve, and non-manifold where the mismatched cylinders met. The finer the tessellation, the more reliably it broke.

Known limitation. Filleting the circular junction where a raised feature meets the part below it still does not work. That rim is concave and curved, and the surgery gets the sign of the fillet wrong there — it takes material out of a corner that should be filled — so it is guarded off rather than producing a wrong body. The CSG path cannot do a rim mixing arcs with sharp corners either. Straight edges at such a junction fillet correctly, as before.

v0.32.0 — Angle dimensions hold the wedge you place them in

Angle dimensions.

  • Two crossing lines make four angles, and which one you meant is now said by where you place the label — drop it in the 30° corner and you get 30°, drop it next door and you get 150°.
  • Arc, arrowheads and extension lines drawn like the linear dimensions: heads tangent to the arc, turning inward when the wedge is too narrow to hold them.
  • The preview draws the real arc across the wedge the cursor is in, with a live value.

Fixes

  • The arc could contradict its own number. It recomputed its own rays instead of reading the point order the constraint is written in, so it always drew the smaller wedge whatever the constraint was holding.
  • The preview read 90° for every crossing pair, whatever the actual angle.
  • Retyping an angle swung the wrong line: it held whichever line came first in the constraint rather than whichever was more constrained, so a line already held Vertical got dragged off vertical and the sketch went over-defined. It now weighs how constrained each line already is.
  • Dimension arrowheads were invisible until the camera was moved — their scale came from a field the sketch interaction system writes, and that system stands down while the Modify box has the pointer.

v0.31.0 — Dimension between two lines, and between two circles

Pair dimensions, Smart-Dimension style. Click one entity, click another, click to place.

  • Two parallel lines → the perpendicular distance between them. Resize one and the other keeps its gap. Crossing lines still give the angle.
  • Two circles → the gap between their rims, drawn between the rims and slid along the pair to wherever you put it. Concentric circles are measured all the way round, so you choose which side the dimension sits on.
  • One circle → its diameter, now placed by a second click like every other dimension.

Fixes

  • A line-to-line distance is drawn between the two lines instead of as a leader from whichever endpoint happened to be stored, which sent it off to a far corner.
  • Dimensioning two concentric circles reported over-defined: it was measuring centre to centre, which is zero for a concentric pair and cannot change.
  • The live value read-out no longer swallows the click that places the dimension — you had to swing the cursor wide of it to land one.

v0.30.1 — Polygon rim fillets select the whole rim

Fixed: filleting a polygon extrusion selected only part of the rim.

Two independent bugs in edge selection:

  • The tangent walk's continuation threshold was cos(60°) exactly — a regular hexagon's corner angle — so whether it turned each corner was decided by floating-point noise. A hexagon drawn square to the axes chained all six rim edges; the same hexagon rotated a few degrees chained three or four.
  • When the walk stopped, the loop snap searched the whole body for the cycle with the fewest edges. On a prism that is the four-edge side face next to the click, shorter than any cap with more than four sides — so a pentagon rim selected four edges, never five, at every rotation.

The loop snap now searches one plane at a time (a face perimeter is coplanar by definition, which is what separates the cap from the side face) and keeps the largest loop found.

Pentagon 4 → 5, hexagon 4-or-6-depending-on-rotation → 6 always, octagon unchanged at 8.

v0.30.0 — Dimensions land where you place them

Dimension tool, SolidWorks-style

  • Click to place. Pick the geometry, the dimension follows the cursor, a second click sets it — exactly where you click, including right on the edge. No computed offset to drag off afterwards.
  • The preview is visible. It draws in the placement orange with a leader to the cursor and a live value, so hugging the edge reads clearly instead of vanishing into the sketch line.
  • Drag direction chooses what is measured. Square off the line for its true length, below it for the horizontal span, out to the side for the vertical one.

Drafting styling

  • Filled arrowheads at ~11 px, fixed on screen at any zoom, turning outward only on spans genuinely too short to hold them.
  • Witness lines running from each end of the geometry back out to the dimension line, standing off it and overshooting by a hair.
  • The value centred on the dimension line over a chip that masks it, so the line reads as broken around the number.

Fixes

  • A dimension hugging a horizontal edge read 0 and placing it raised a false over-defined error — the axis rule picked the projection with no span.
  • Dimensions no longer stand off the geometry by an amount nobody asked for.

v0.29.0 — saving no longer throws away an open sketch

Saving no longer throws away an open sketch

Update if you use nothing else from this release.

Save wrote the document only — and a sketch lives in the session until it's committed. So drawing a box, dimensioning it, and pressing Save wrote a file containing nothing but the three datum planes, with a cheerful "Saved" toast and no warning. The reported baddimension.hcad is 914 bytes of exactly that: three planes, no lines, no dimension, saved while all of it was on screen.

That's the worst class of bug this program can have, and it has been there the whole time. Save and Save As now commit the open sketch first and write on the next frame. It's a one-shot, so a sketch that won't commit lets the save go ahead rather than trapping it.

Dimensioning a box no longer over-defines it

tie_opposite_side — added in v0.25.0 so the far side follows the near one — was adding an Equal between opposite sides of a rectangle whose four sides already carry horizontal/vertical relations and whose corners are shared. Those sides are equal by construction, so the Equal is redundant, and the solver reports a redundant relation as "over defined — conflicting relations". It fired on nearly every box.

It now checks first: same axis on both sides means they're already equal, so nothing is added. Hand-drawn quads missing those relations still get the tie.

Both bugs were found from a saved file rather than by reading code — and the second only became findable once the first was fixed, because until then the file contained nothing to look at.

Centred squares

  • A Center Square (construction) tool: a square layout guide sized from its centre, all construction geometry.
  • Centre points now bind to whatever they're dropped on — an existing point, a circle or arc centre, a body corner, or an edge — instead of floating free on top of it. That was why centres drifted when a square was resized.
  • Both diagonals run through the centre, so resizing grows the shape about it rather than sliding it.
  • Dimension anchoring became a preference rather than a demand to suit: a shape that's already held doesn't need an extra pin, and pinning one anyway silently refused the dimension.

Not in this release

The SolidWorks-style dimension rework (click-to-place, drag-direction axis, arrow styling). It shipped broken — the pure functions were tested and correct, the tool itself was never checked in the running app — and has been reverted.

Verification

136 tests.

v0.28.1 — a collapsed edge is not a hole

There are no bevel cracks. The previous release reported that the bevel builder was leaving real cracks and masking them with degenerate triangles. That was wrong, and the bug was in the measuring tool.

An edge whose two ends weld to the same vertex has no side — it's a collapsed edge, not a boundary. The welded edge counters treated it as one. That single mistake:

  • made sound bevelled bodies look torn,
  • blocked the cleanup that removes the very triangles producing those self-loops,
  • and led to a wrong diagnosis that was then acted on.

Strip every degenerate triangle from the two models and count edges properly, and they close perfectly:

edgetest5:   0 real boundary edges, 39 self-loops
extrudertop: 0 real boundary edges, 102 self-loops

That is what the earlier "1 boundary edge" and "10 boundary edges" actually were.

What changed

Both the production measure and the diagnostics now ignore self-loops, so the cleanup runs. edgetest5 and extrudertop drop off the problem sweep entirely — 107 and 78 zero-area triangles gone. Those triangles carry no usable normal, bloat STL and STEP exports, and give the boolean kernel edges to trip over.

The shape is provably untouched: barthing 5621.304916 and filletbug 375.954041, identical to the pre-fix figures, still manifold, still closed. The safety guard added in v0.27.0 stays and is still correct — it simply isn't being fooled any more.

Also adds drop_duplicate_vertex_triangles, the safe-by-construction half of the pair, with a test pinning the distinction so the two kinds of degenerate don't get conflated again.

Verification

136 tests. The lesson is pinned as one of them: a hand-built tetrahedron with a degenerate triangle stitched on must read as closed both before and after removal. Measuring beats theorising only if you check the instrument too.

v0.28.0 — merged sketch regions trace correctly through junctions

circtorttest.hcad — seven overlapping circles with ten of the resulting faces selected — extruded into a badly torn solid. The tearing wasn't in the extruder at all. It was upstream, in the 2D merge that turns adjacent faces into one profile.

before after
manifold no yes
boundary edges (holes) 2012 0
non-manifold edges 1384 3
lossy BSP fallbacks 8 0
triangles 20,267 2,456
merged profiles 6–9, varying 1, every run

Two bugs, found by measuring rather than reading.

The merge was non-deterministic

It traced its boundary loops starting from HashMap::keys(), and Rust randomises hash iteration order per process — so where the boundary got split changed on every rebuild. The same file merged into 9, 6, 8, 7 and 8 profiles across five runs of one binary, and the tearing came and went with it. A model that rebuilds to a different solid each time can't be debugged by anyone.

The trace assumed degree-2 vertices

It kept one successor per vertex in a HashMap<vertex, vertex> — the comment said as much. Overlapping circles put two edges in and two out at every junction, and insert silently overwrote the extras. Dropped boundary edges give open, self-crossing outlines, and no triangulator can make a solid out of those.

Rewritten as the standard planar-subdivision walk: keep every surviving edge, and at each vertex take the first outgoing edge met sweeping clockwise from the direction you arrived on. That keeps the interior on the left the whole way round and traces the correct face at any vertex degree. Edges are marked used rather than vertices, so a junction can legitimately be walked through twice.

The ten selected faces now merge into one outline with a hole and no self-crossings — which is what an arrangement of overlapping circles should give. The 8× drop in triangles is because it's one prism now, rather than ten boolean'd together.

Two guards

The walk is built from a sorted edge list, so determinism is structural rather than a patch on top. And a merge whose traced area disagrees with its input by more than 2% falls back to the unmerged profiles — bad traces fail large, and there's precedent: a bad re-trace once grew a 355 mm² profile to 966 mm² and ate a part's rim.

Verification

134 tests. The new ones assert no merged outline crosses itself, that merging neither invents nor loses area, that the result extrudes to a closed manifold solid with no fallbacks, and that twelve consecutive merges of the same sketch are identical point for point. The document sweep is unchanged at 21 clean, so nothing else moved.

v0.27.0 — multi-region revolve fixed, mesh hygiene, pinch warning

A bug pass driven by measurement rather than reading: every saved document rebuilt and checked for a torn surface, a lossy fallback, or an anomaly counter firing. Clippy found nothing real — the two promising lints (a constant assertion, an if with identical blocks) are both benign.

A multi-region revolve is one boolean, not one per region

strange loft.hcad went non-manifold at a revolve cut, and my first two readings of it were wrong.

The obvious cause is a profile touching the axis — measuring showed all four loops sit 10–20 mm clear of it. Then it looked like a genuine pinch: nudging the tool didn't help, and repair_mesh couldn't recover it. Both were evidence I was testing the wrong thing.

Cutting the same four regions in the reverse order gives a manifold body of the same volume. Merging the tools and cutting once gives the same again. All three agree on volume to three decimals — so the shape was never wrong, the sequence was.

A multi-region revolve was doing one boolean per region, and each intermediate body carries coincident surfaces for the next subtraction to trip over. The damage wasn't local either: 713 edges carrying up to ten faces, spread over the whole part, nowhere near the tool that triggered it — which is what finally pointed away from geometry and toward the sequence.

One feature, one boolean. The region tools are merged first, then subtracted once.

Zero-area triangles from the bevel and thread builders

They cover no surface but carry no usable normal, bloat STL and STEP exports, and give the boolean kernel edges to trip over. Now stripped — but only when the result stays closed.

A first attempt removed them unconditionally and opened holes in two models: a collinear triangle can be the only face on one of its edges, so removing it leaves that edge unmatched. The cleanup is attempted and checked against the same measure that would call it a defect; a mesh that would come out open keeps its triangles.

A pinched body is reported

A body that goes non-manifold exports as invalid STL/STEP and makes later booleans unreliable — but a pinch is invisible on screen, so it used to ship in complete silence. It now raises the warning banner with the usual cause and how to clear it.

The test pins the direction that can go wrong quietly in the other direction — no false positives across plain, cut and filleted bodies — because a warning that cries wolf gets ignored.

Verification

132 tests. The sweep harness is kept as diag_sweep_documents: seconds to run over every saved model, and the cheapest regression net available here. It is what caught the hole-opening in my first cleanup attempt, and what confirmed the revolve fix across the whole corpus rather than on one file.

v0.26.1 — .hasm opens from the command line, dimensions show the real measurement

Patch release: two things that looked broken from the outside.

Double-clicked assemblies opened an empty part

The installer has always registered .hasm, and Windows handed the path over correctly — but the command-line handler covered .hdrw, .hcad and .ron and then returned on anything else, so the file was quietly discarded. It looked like the association was broken when it was the app throwing the file away.

Assemblies now load from the command line exactly like File → Open: components refreshed from their source files where present, a toast per component whose source has gone missing (rather than silently showing a stale copy), and the isometric fit on open.

An argument that isn't an HCAD document now says so instead of opening a blank part, which reads as a crash on open.

The association needs the installer to have run. If you've only ever used a copied .exe, Windows has no registry keys for it — this installer sets them up.

The dimension box showed the last number typed

It always read the constraint's value correctly; the problem was a level down. egui keeps a DragValue's half-typed text keyed by widget id, and that text wins over the value passed in. The box was keyed on the constraint index — which isn't unique over time, because indices get reused as dimensions come and go. So a new dimension landing on an old index inherited whatever had last been typed there.

The box now carries a counter bumped on every opening, so its id is always fresh and has no stored text. It opens on the real measurement, including when you reopen a dimension after typing into a different one.

Verification

282 tests. The dimension fix is tested across the sequence that broke it — dimension one line, type a junk value, dimension a second line, reopen the first — plus that a diameter dimension opens on the diameter rather than the radius. The command-line paths were verified by running the real binary against real files: an assembly loads, a .stl is refused with a message, and a part still opens.

v0.26.0 — sketch planes that land on the right face

Sketch planes that land on the right face

extrusionerror.hcad turned out to be two bugs wearing one coat. The part itself built correctly all along — 2 mm disc, 2 mm boss, 4 mm total — because regeneration re-lands a stale sketch plane on the right face every rebuild. What was wrong was the plane stored in the document, and everything that reads it raw: the sketch editor, the depth arrow, the preview. That mismatch is what made an extrude look like the wrong distance.

  • Reopening a sketch re-landed its plane on the body on screen, which contains the feature being edited — so a boss's own top face sits exactly where its stale plane already is, and the reprojection agreed with the wrong height instead of correcting it. It now lands on the upstream body, the geometry regeneration actually builds the feature on.
  • Confirming a sketch edit never wrote the plane back. It saved the sketch and the contours and skipped the plane, so a stale value survived indefinitely and regeneration re-derived the right answer forever. Editing and confirming a sketch now repairs the document.

If you have files showing this, open the sketch and confirm it — the corrected plane is saved.

A camera that shows the work

  • Opening a part or assembly fits it and turns isometric. The wait is on geometry, not on the regen flag — that clears when a rebuild starts, and the mesh path finishes on a background thread, so framing on it caught an empty part.
  • The framing maths was wrong. Both projections show 2·radius·tan(vfov/2) of height, but the fit returned radius = 0.9 × diagonal, giving a visible height of 0.745 × a diagonal the part can present in full — it overflowed by half again. The radius now comes from the projection instead of a guess. This fixes the Fit button too.
  • Sketching on a face is now exactly square-on. The pitch was clamped to ±1.54 rad, a whisker short of square, leaving a top or bottom face 1.8° out — and since a sketch is lifted toward the camera to stop it z-fighting, that tilt showed as the sketch sitting visibly offset from its own face. The pole's free yaw is now settled by the plane's own u axis rather than dodged by the clamp. The Top button and the view cube were off for the same reason.
  • Starting or reopening a boss/cut extrude turns isometric — square-on is the one angle where a depth is invisible.
  • New Part reframes the datum planes.
  • "Normal to" on the right-click menu of any feature that has a plane.

Datum planes

Named in the viewport, sized to span the part, and gone once the part has started. Rendering and picking now ask one function — when they drifted apart, an invisible plane scaled to the part sat in front of the geometry and swallowed every click meant for a face.

Fixes

  • Viewport labels are clipped to the 3D view. They live on egui's foreground layer, above the panels, so a label whose geometry had scrolled off the top was painted over the toolbar.
  • Clicking empty space clears the feature and plane selection, not just the edge selection.

Polygon angle snap

Orientation latches to 15° steps, with a live readout that calls out the snap. The window is 3°, not the 6 I started with: it applies either side of every step, so it eats twice its width out of each gap — at 6° the snap fired four times in five and read as the cursor being ignored.

Verification

281 tests. The plane fix is tested against the shape from the reported file, asserting both the corrected result and the old wrong one, so the premise is pinned rather than assumed. The framing test projects the part's corners through the camera and checks they land on screen instead of trusting a multiplier. The square-on test measures the angle between camera and face normal across both poles.