diff options
Diffstat (limited to 'ShedCalc/ParamModel.swift')
| -rw-r--r-- | ShedCalc/ParamModel.swift | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ShedCalc/ParamModel.swift b/ShedCalc/ParamModel.swift new file mode 100644 index 0000000..4935bcd --- /dev/null +++ b/ShedCalc/ParamModel.swift @@ -0,0 +1,37 @@ +// +// ParamModel.swift +// ShedCalc +// +// Created by Jacky Jack on 01/08/2026. +// +import Combine +import SwiftUI +import Observation + +@Observable +class ParamModel { + var width: Float = 1.0 + var height: Float = 1.0 + var length: Float = 1.0 + var beamSpace: Float = 0.6 + + func floorArea() -> Float { + return width*length + } + + func roofArea() -> Float { + return width*length + } + + func dimensions() -> SIMD3<Float> { + return [width,length,height] + } + + func widthBeamNum() -> Int { + return Int(width/beamSpace) + 1 + } + + func lengthBeamNum() -> Int { + return Int(length/beamSpace) + 1 + } +} |
