WIP: Adds more tagged types for rectangular size calculations.

This commit is contained in:
2026-01-29 20:50:33 -05:00
parent 9379774fae
commit 9b618d55fa
9 changed files with 75 additions and 39 deletions

View File

@@ -39,9 +39,12 @@ extension ManualDClient: DependencyKey {
// let groupLengths = request.effectiveLengthGroups.totalEffectiveLength
// return trunkLengths + runoutLengths + groupLengths
// },
rectangularSize: { request in
let width = (Double.pi * (pow(Double(request.roundSize) / 2.0, 2.0))) / Double(request.height)
return .init(height: request.height, width: Int(width.rounded(.toNearestOrEven)))
rectangularSize: { round, height in
let width = (Double.pi * (pow(Double(round.rawValue) / 2.0, 2.0))) / Double(height.rawValue)
return .init(
height: height,
width: .init(rawValue: Int(width.rounded(.toNearestOrEven)))
)
}
)
}