summaryrefslogtreecommitdiff
path: root/ShedCalc/ParamModel.swift
diff options
context:
space:
mode:
authorArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-07 02:01:40 +0100
committerArturs Artamonovs <arturs.artamonovs@protonmail.com>2026-08-07 02:01:40 +0100
commit91d0042017e6c46f2c9f5d42d438836efa6d53e4 (patch)
treeaf8c2dbad8ea148e882136843634ff53c42dd20b /ShedCalc/ParamModel.swift
parentdabeb1603cf146aa671dddf949788b514b983b76 (diff)
downloadShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.tar.gz
ShedCalc-91d0042017e6c46f2c9f5d42d438836efa6d53e4.zip
Added 3 views. Added basic beam drawing and basic calculations for width and length + beam drawing
Diffstat (limited to 'ShedCalc/ParamModel.swift')
-rw-r--r--ShedCalc/ParamModel.swift37
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
+ }
+}