BetaBetaBetaGives the ANSI B17.1 square key for a shaft: the key's width and height, and how deep its keyseat goes into the shaft and into the hub.
Depths are from the top of the round, half the key standing at each keyseat's side. Example: a 1 inch shaft -> a 1/4 square key, 0.141 deep in the shaft
The shaft's diameter and the unit
The key's and keyseat's sizes in unit
The sizes of ANSI B17.1 square parallel keys and their keyseats, with no CAD kernel needed, in the unit asked for.
occt.parts.mechanical.keys.ansibuilds the keys as solids andocct.parts.mechanical.machining.ansicuts their keyseats.