Segment layout, driven by one number: distance from centre
Everything about a segment's size is a function of its radius ρ and the segment count N. Set those two and the sector angle, arc length, chord, taper, hide window and gear tooth count all fall out. These are the expressions to paste into a Variable Studio so you never type a dimension into a sketch again.
QThe one you asked for — arc length at a radius
A segment spans 360°/N of arc. At distance ρ from the centre of the flower, its two ends are that angle apart, so:
Arc is what you need for surface finish, tape runs and gear pitch. Chord is what you need for stock size and print-bed fit. They differ by ~2 % at 40°, which is enough to matter when you are checking whether a segment fits a 256 mm bed.
OnShape carries units through every expression, and an angle is a real unit there. #Ri * #sector would give you mm·degrees, which is not a length and OnShape will reject it. Dividing by 1 rad converts the angle to a plain number, so the result comes out in mm. This is also why you never need PI anywhere below.
1Inputs — the twelve you actually turn
Define these first, in this order. OnShape resolves variables top-down, so a variable can only reference ones defined above it. Everything after this group is derived and should never be edited by hand.
2Sector & radii
The four values that nearly every later expression depends on.
3Arc & chord
Length of the segment at each radius that matters.
4Planes & taper
The offsets that build the land plane, the clearance plane and the flat bottom. #rise is the number to watch — it is the sole reason the segment is a wedge.
5Envelope & overlap guard
Outside dimensions, plus the guard rail that stops you building a ring whose wafers do not overlap.
6Hide window — closed form
The radial band over which the frame is invisible behind the wafers, measured at the joint meridian where coverage is thinnest. Substituting the wafer's projected ellipse into the joint ray gives a quadratic in ρ, so this solves exactly — no iteration.
Written directly in millimetres, A comes out in 1/mm² and OnShape has to take a square root of a squared reciprocal length. It can do it, but the expressions get fragile and hard to read. Dividing through by the wafer radius makes A, B, C plain numbers, and you multiply by #r once at the very end. Same answer, far less unit wrangling.
7Ring gear on the flat-bottom flange
The gear cannot go on either rim — both follow the tilted land and swing out of the ring plane. It lives on the planar flange instead. The critical expression is #teethSeg: the tooth count must be a whole number per segment or the pitch breaks at every joint, and round() is what enforces it.
8Feature placement
OnShape evaluates a Variable Studio top to bottom. If #Ro is defined above #Ri, you get an "unresolved variable" error rather than a wrong number — which is at least loud. Paste the groups in the order they appear here (1 → 8) and every reference resolves.
Two more gotchas that cost real time: an angle input must carry its unit (10 deg, never 10), and a count like #N must be unitless (9, never 9 mm). If a trig expression returns an error, one of those two is almost always why.