Skip to content

Commit 7fafd8d

Browse files
committed
Merge branch 'oct02' into main
2 parents a2c5954 + c222966 commit 7fafd8d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/g/check-size.ls

+17
Original file line numberDiff line numberDiff line change
@@ -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

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = order
1111
# true = right
1212
function order side
1313
require! <[
14+
./check-size
1415
../math/rect/union
1516
../math/rect/size
1617
../math/path/bounds
@@ -73,6 +74,8 @@ function order side
7374
state.job <<<
7475
bounds: R
7576
size: size R
77+
check-size!
78+
7679
O2 = if side
7780
translation [-R[1][0], 0]
7881
else

0 commit comments

Comments
 (0)