We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a2c5954 + c222966 commit 7fafd8dCopy full SHA for 7fafd8d
src/g/check-size.ls
@@ -0,0 +1,17 @@
1
+#
2
+# Test if part fits into workpiece
3
4
+module.exports = check-size
5
+
6
+!function check-size
7
+ require! <[
8
+ ./state
9
+ ./croak
10
+ ]>
11
12
+ state.job
13
+ size = ..size
14
+ g = ..global
15
+ if size[0] < g.W and size[1] < g.D / 2
16
+ return
17
+ croak "Деталь (#{size.join 'x'}) меньше заготовки (#{g.W}x#{g.D / 2})"
src/g/order.ls
@@ -11,6 +11,7 @@ module.exports = order
# true = right
function order side
require! <[
+ ./check-size
../math/rect/union
../math/rect/size
../math/path/bounds
@@ -73,6 +74,8 @@ function order side
73
74
state.job <<<
75
bounds: R
76
size: size R
77
+ check-size!
78
79
O2 = if side
80
translation [-R[1][0], 0]
81
else
0 commit comments