2 个版本
0.1.1 | 2021年2月13日 |
---|---|
0.1.0 | 2021年2月13日 |
在 #diy 中排名第 4
9KB
254 行
Optocut
Optocut 是一个用于生成木材成本优化切割清单的程序。给它你当地五金店可用的木材列表以及你需要的长度的列表,它将告诉你需要购买什么以及如何切割。它还会考虑到你的锯片宽度。
安装
cargo安装 optocut
示例
example.toml
# Used to define the width of the saw blade
[blade]
inches = 0.125
[[available]]
name = "2x4x8"
feet = 8
cost = 6.98
[[available]]
name = "2x4x104"
feet = 8
inches = 8
cost = 9.15
[[available]]
name = "2x4x10"
feet = 10
cost = 9.55
[[available]]
name = "2x4x12"
feet = 12
cost = 11.45
[[available]]
name = "2x4x16"
feet = 16
cost = 15.36
[[required]]
name = "2'"
feet = 2
amount = 4
[[required]]
name = "42in"
inches = 42
amount = 4
[[required]]
name = "1'"
feet = 1
amount = 6
[[required]]
name = "34in"
inches = 34
amount = 8
[[required]]
name = "10cm"
cm = 10
amount = 1
optocut example.toml
Best cost: $48.92
2x4x12 -> 10cm 34in 34in 34in 34in [Leftover: 8.73 cm]
2x4x8 -> 34in 34in 1' 1' [Leftover: 8.89 cm]
2x4x8 -> 34in 34in 1' 1' [Leftover: 8.89 cm]
2x4x8 -> 1' 1' 42in 2' [Leftover: 13.97 cm]
2x4x10 -> 42in 42in 2' [Leftover: 29.53 cm]
2x4x8 -> 42in 2' 2' [Leftover: 14.29 cm]
依赖关系
~0.5–1.1MB
~25K SLoC