WAFER HALO / ONSHAPE WORKFLOW / BEVELOID DRIVE

Cut the halo's gear inside Onshape — procedurally.

A complete walkthrough of scripts/onshape/wafer_halo_beveloid.fs — two custom FeatureScript features, modelled on Anthony Lu's Gear Lab, that generate the segment-edge beveloid band and its parallel-axis pinion natively in Onshape, with sliders instead of STL re-imports.

FeatureScript 1803 108T ring · 12T pinion · 9:1 straight or spiral flush module 5.384 crossed 5.4:1 · ~2 rpm
Independent project documentation for the Wafer Halo repo, styled in the spirit of the tool it targets. Not affiliated with, sponsored, or endorsed by PTC / Onshape. "Onshape" is a trademark of PTC Inc.
01
One-time setup

Install the Feature Studio

Custom features live in a Feature Studio — a code tab inside an Onshape document. You install once, version it, and every Part Studio in the document (or any document that links it) gets two new toolbar features.

  1. Open (or create) your Wafer Halo Onshape document.
  2. Click the + at the bottom-left tab bar → Create Feature Studio. Name it halo-beveloid.
  3. Delete the stub content and paste the entire contents of scripts/onshape/wafer_halo_beveloid.fs.
  4. Press ⌘S / Ctrl S — the studio commits (compiles). Green check in the tab = good.
  5. Open any Part Studio → toolbar → the puzzle-piece Custom features flyout → you'll see Halo Beveloid Band and Halo Beveloid Pinion.
First-commit expectations The geometry math in this file is parity-tested against the Python model to 1 × 10⁻⁹ (all 11 spec quantities), but the file has not been executed inside Onshape's runtime. If the studio flags a standard-library call on commit (sketch or loft API spelling), it's a mechanical fix — paste the error back into the repo session and it gets patched. The math is the load-bearing part.
02
Concept

What these features actually build

The halo's drive is a parallel-axis beveloid pair — conical involute gears whose axes are parallel, not intersecting. The ring's teeth sit on a 45° cone with the big end at the wall; each mm of axial travel trades 1 mm of ring radius for 1 mm of pinion radius, so the centre-radius sum is constant across the face and the pinion's axis points straight out of the wall.

This is why Gear Lab can't produce this pair, as brilliant as it is: its bevel gears are spherical involutes for intersecting shafts. A 45° Gear Lab bevel wants its mate's axis to cross the ring's axis at the cone apex — and on the halo, a radial-axis pinion's swept disc spans its full Ø along the wall normal, straight through the drywall behind or the wafer field in front. Gear Lab also has no ring-sector output, no flush-root module retune, and no joint-phase convention. Use Gear Lab for spurs and intersecting-axis bevels; use these two features for the halo drive.

PropertyBand (ring sector)Pinion
Cone directionbig end at the wall (z = 0)big end at the front (z = face)
Teeth @ B.3108 (12 per segment)12 — ratio 9:1, counter-rotating
Module5.6 nominal → 5.384 effective (flush retune, shared)
Front radiiroot 284.0 · pitch 290.7 · tip 296.1pitch 32.83 mid-face (s_prof 1.0163)
Phaseevery segment joint lands mid-spacetooth points at the ring at build
03
Feature 1

Halo Beveloid Band — the segment's teeth

Model your segment first (the 46 variable expressions + DXF sketches drive everything except the gear). Then run the feature. It builds at the origin in the same frame the printed parts use: wall face on the XY plane, the 40° sector centred on +X, front face at z = face height.

Halo Beveloid Band
Segments (N)9
Band inner radius (Ri)255 mm
Band width (bw)30 mm
Nominal module5.6 mm
Face height (gear_F)9.5 mm  — ceiling ≈ 9.83, see step 06
Pressure angle20°
Spiral angle0°  (straight)
Full ring (all N sectors)☐
Cancel✓ OK
  1. Accept the defaults (they are the shipped Rev B.3 build) → OK. A notice reports the derived numbers — tooth count, flush module, tip radii, and the pinion centre distance C.
  2. Position your segment so its flat bottom is on XY with the sector centred on +X (that's the repo's native frame — the DXF sketches import this way), or Transform the band solid to the segment.
  3. Boolean → Union the band into the segment body. The root circle lands 1 mm inside the band OD, so the union is watertight by construction — teeth rise straight off the band's outer wall, no gap, exactly like the printed part.
Design on the fly Everything re-derives when you drag a parameter. Change N and the sector angle, tooth count, and phase all follow; change the nominal module and the flush retune keeps the root on the band wall. Tick Full ring to generate all 108 teeth for an assembly-level check — spaces land mid-joint at every seam, so N sector instances tile seamlessly.
04
Feature 2

Halo Beveloid Pinion — the mate

Same dialog family, plus drive-side hardware: a big-end hub and a D-shaft bore sized for the 22PG-2430BL gearmotor's 4 mm D-shaft (catalog-typical — measure the purchased unit). Rev B.5: the pinion is the CROSSED-drive 20T cone (Ø9.9→Ø25.3 tips, apex toward the halo centre) — small on purpose; only the tooth count is forced by the 5.4:1 ratio, and rho 8 at 20T sits right on the 0.8 mm section-module print floor.

Halo Beveloid Pinion
Ring parameters (N, Ri, bw, module, face)match the band exactly
Backlash0.3 mm  — keep ≥ 0.3 for printed parts; 0.6 would halve the 0.8-module tooth
Hub length5 mm (Ø16, wall side)
Bore diameter4.2 mm
D-flat depth0.5 mm
Cancel✓ OK

Mating it. The feature reports the small-end ring radius (~298.8) and axis height (~13.6 off the ring's wall plane) at B.5. In an Assembly:

  1. Insert ring and pinion. Add a Revolute mate on each — the ring about the halo axis, the pinion about a radial axis (vertical at 12 o'clock, shaft pointing down toward the halo centre).
  2. Position the pinion with its small end at ring radius ~298.8 and its axis ~13.6 mm in front of the ring's wall plane, apex toward the halo centre; the 22PG-2430BL sits directly above on the hub.
  3. Add a Gear relation between the two revolutes, ratio 5.4:1. Drag the ring: one ring rev per 5.4 pinion revs — ~2 rpm at the sculpture, PWM-dialed via the motor's integrated driver.
Mesh fidelity The Python model generates the ring as the swept envelope of its cutter (conjugate by construction; the repo's mesh gate measures 0.00000 mm³ interference). These features loft analytic involute sections — identical at the mid-face, a few hundredths off toward the faces. Visually and kinematically indistinguishable in Onshape; for anything you print, the repo's segment_stl.py gates remain the authority.
05
Options

Spiral teeth, one slider

Set Spiral angle on both features (same value, and it must match on both). The wall section rotates by tan(spiral) · face / pitch_r — the same twist the Python twist-extrude applies — so the flanks become ruled helicoids and the pair stays complementary.

The repo ships 0° (straight) deliberately: at 0.3 rpm a spiral buys no smoothness, and its ~tan(sp) axial thrust component would fight the idler-groove mount — the ring's only axial restraint. If you want the spiral look, 35° matches the old aesthetic; just know the groove takes the thrust.

06
Constraints that don't move

The two numbers Onshape can't see

Two halo-level constraints live outside the gear geometry. The features can't enforce them — the Python gates do, on every CI run:

ConstraintValue @ B.3What breaks if violated
gear_F ceiling — the band face must clear the neighbour wafer's clearance plane over the leading ~15–20° of the sector≤ ≈ 9.83 mm (tmin=15)
(computed live by gear_F_ceiling())
The mandatory clearance cut planes the leading teeth to partial height and sheds slivers at the disc rim — the exact regression the repo gates against.
Tooth count ≡ 0 (mod N) — enforced by construction here (teeth = tps × N)108 = 12 × 9The pattern breaks at every segment joint; the ring stops tiling.

If you explore a different face height or tilt in Onshape, run python3 scripts/segment_stl.py --gear_F <x> before printing — exit 0 with the gate line means the clearance cut removed zero tooth material.

07
Working together

Collaboration: versions, links, and the repo loop

Onshape's collaboration model is what makes the custom-feature route worth it:

  • Share the document (Share → email or link). Edits are simultaneous and live — two people can have the same Part Studio open; feature regenerations propagate in real time. No files, no checkouts.
  • Version the Feature Studio before you lean on it. Right panel → Versions → create V1. Custom features referenced from other documents bind to a version, so downstream models never shift under you when the studio changes.
  • Publish across documents: in any other document, Custom features flyout → Add custom feature → pick your halo-beveloid document at version V1. Team members can use the features without ever seeing the code.
  • Branch to experiment: Versions panel → branch a workspace (e.g. spiral-35), crank the spiral slider, compare, and merge back if it wins — Onshape's branching is real, like git for CAD.
  • The repo loop: the git repo stays the source of truth for printed parts. Check your Onshape rebuild against the shipped solids by importing stl/step/segment.stp (view-only reference), or export your Part Studio STL into stl/my_frame_segment.stl — viewer_export.py carries it through to the web viewer as a compare overlay (mis-orientation warns, never gates).
  • Update path: when the repo's gear parameters change, this page's crib numbers and the FS defaults are regenerated together — diff scripts/onshape/wafer_halo_beveloid.fs, paste the new version into the Feature Studio, commit, create V2, and re-point consumers when ready.
Crib sheet @ Rev B.3 108T / 12T · flush module 5.384 (5.6 nominal) · face 9.5 mm · PA 20° · straight · front radii 284.0 / 290.7 / 296.1 · wall = front × 1.0327 · C = 328.31 mm · hub Ø16 × 5 · bore Ø3.2 + 0.4 flat · backlash 0.6