Browse Source

Add example to readme

master
Stephen 1 week ago
parent
commit
20b85d9f22
1 changed files with 74 additions and 2 deletions
  1. +74
    -2
      README.md

+ 74
- 2
README.md View File

@ -2,8 +2,80 @@
Optocut is a program for generating a cost-optimized cutlist for wood. Give it a list of lumber available at your local hardware store, as well as a list of lenghts you need, and it will tell you what to buy and how to cut it. It also accounts for the width of your sawblade.
For more information, see the example.toml file. Try it out with `optocut example.toml`
## Installation
`cargo install optocut`
## Example
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]
```

Loading…
Cancel
Save