Does anyone know of any free software for working out cutting lists?
(i.e. you feed it the sizes of the parts you need, it works out the best way to cut them from standard stock sizes).
There seem to be plenty of quite pricey commercial apps...
Does anyone know of any free software for working out cutting lists?
(i.e. you feed it the sizes of the parts you need, it works out the best way to cut them from standard stock sizes).
There seem to be plenty of quite pricey commercial apps...
John,
I use
hth
Bob
There were a few free on US woodworking sites ... for sheet cutting lists ... a minute on Google should find them
A quick review of the web page reveals that the app requires .Net framework 4, which is the last thing I need to clutter up the PC even more. Completely unnecessary, too. No developer needs the crazy, overblown Net Framework for simple apps like this.
I'd do a search on Google, as someone suggested, and find a similar, older app that does the job as a standalone.exe
MM
Hi John,
So happens I wrote a perl script for that a while back:
It's a fairly basic bin packing algorithm - not the most optimal in theory, but in practise (skirting for 3 rooms) it is pretty good.
Should run under any version of perl - no dependencies.
Cheers
Tim
Make a datafile (in perl Dumper dialect) and save as cutlist.dat
{ cutwastage => 0.03, # A few cm padding for cuts, eg mitres stocklength => 2.6, # Lenght of stock carryoverstock => 0, # Spare piece of stock from last job cutlist => { 1 => 1.21, # each individual length we want 2 => 3.20, 3 => 3.35, 4 => 0.71, 5 => 0.70, 6 => 1.79, 7 => 0.70, 8 => 0.70, 9 => 1.31, }, }
Save this as lcut and run lcut cutlist.dat
################################################ #!/usr/bin/perl
use strict; use warnings;
my $datfile = shift;
die "Usage: lcut datafile" unless $datfile; die "Datafile $datfile does not exists or is not readbale" unless -r $datfile;
our $data = require $datfile;
die "cutwastage must be defined" unless defined $data->{cutwastage}; die "stocklength must be defined" unless $data->{stocklength}; die "cutlist must be defined" unless $data->{cutlist}; die "cutwastage must be a scalar" unless ref \$data->{cutwastage} eq 'SCALAR'; die "stocklength must be a scalar" unless ref \$data->{stocklength} eq 'SCALAR'; die "cutlist must be a hash" unless ref $data->{cutlist} eq 'HASH';
my $cutwastage = $data->{cutwastage}; my $stocklen = $data->{stocklength}; $stocklen = $data->{carryoverstock} if $data->{carryoverstock}; # Redo cut list to suit stock length
foreach my $cut (keys %{$data->{cutlist}}) { my $cutlen = $data->{cutlist}->{$cut}; next unless $cutlen + $cutwastage > $stocklen; # OK chop it up delete $data->{cutlist}->{$cut}; my $remaining = $cutlen; my $c = 1; while ($remaining + $cutwastage > $stocklen) { my $t = sprintf("%s.%d", $cut, $c); $data->{cutlist}->{$t} = $stocklen - $cutwastage; $remaining -= $stocklen - $cutwastage; $c++; } my $t = sprintf("%s.%d", $cut, $c); $data->{cutlist}->{$t} = $remaining; }
# Cutting algorithm
my @cuts; my @results;
my $i = 0; foreach my $cut (keys %{$data->{cutlist}}) { push @cuts, {cut => $cut, length => $data->{cutlist}->{$cut}, rind => $i}; push @results, {cut => $cut, length => $data->{cutlist}->{$cut}}; $i++; }
# sort by length @cuts = reverse sort {$a->{length} $b->{length}} @cuts;
# Do the first-fit-decreasing packing algorithm
my $stock = $stocklen; my $stockcnt = 1; my $stockpiece = 1; my @wastage = ();
SCAN: while (scalar @cuts > 0) { #print scalar "Scalar cuts=" . @cuts . "\n"; foreach my $i (0 .. $#cuts) { #printf "Examine stock %d.%d length=%0.2f against cut=%s cutlen=%0.2f\n", $stockcnt, $stockpiece, $stocklen,$cuts[$i]->{cut}, $cuts[$i]->{length} ; next unless exists $cuts[$i]; if ( $cuts[$i]->{length} + $cutwastage {rind}]->{stock} = sprintf("%d.%d", $stockcnt, $stockpiece); $stock -= $cuts[$i]->{length} + $cutwastage; $stockpiece++; splice @cuts,$i,1; next SCAN; } } # Either the job's done or we cannot get any more out of the current stock if ( $stock > 0 ) { # Have some wastage push @wastage, {stock => $stockcnt, length => $stock}; } #print "Stock = $stockcnt, Len = $stock\n"; $stock = $stocklen; $stockcnt++; $stockpiece = 1; } if ( $stock > 0 ) { # Have some wastage push @wastage, {stock => $stockcnt, length => $stock}; }
print "Cutting list\n"; print "Cut\tLength\tStock\n";
#foreach my $cut (sort {$a->{stock} cmp $b->{stock}} @results) foreach my $cut (sort {$a->{cut} cmp $b->{cut}} @results) { printf "%s\t%0.2f\t%s\n", $cut->{cut}, $cut->{length}, $cut-
}print "\nWastage summary\n"; print "Stock\tLength\n"; foreach my $waste (@wastage) { printf "%s\t%0.2f\n", $waste->{stock}, $waste->{length}; }
################################################
There's SizeFitter
Didn't TMH have something in Excel?
Neat and very useful. Though it needed a bit of editing to get rid of the line breaks.
I found the output a bit confusing to follow but it seems more intuitive if you sort the cutting results on stock instead of cut, i.e.group all the cuts for each piece of stock together.
Ta - it was very useful when I went to the wood merchant and he did not have the lengths I'd assumed. I took the laptop and plugged in the other sizes he had until the wastage came down to something sensible :)
Just to make it easier:
Yep - many improvements are possible - it was a quick hack.
I sorted it that way as the left hand numbers were noted on a sketch of the room and as that was the order I was working (around the room) it made sense to me - I did a "cut, fit, cut, fit" operation
But you could easily sort on the stock ID if you wanted to.
Cheers,
Tim
Version 4 does seem to cause some stability problems on XP machines as well at times.
Nice job Tim.
I was actually thinking of something that could pattern fit in two dimensions though...
I have some basic excel sheets that will optimise into standard 300mm multiple board lengths etc, but was thinking about something a little more flexible that you could feed a list of parts to, a kerf size, a board size, and have it produce a nice 2D plan of cuts - optimised for either rips or cross cuts etc.
Oh - never mind - I assumed you were cutting linear stock :-|
Now that *is* a hard problem...
Cheers
Tim
I have a suspicion this is NP-complete.
I remember E.Jones Timber in Dartford had such a beast, in effect a totally automated sheet cutting suite. Quite a large minimum order size IIRC.
I've used this for ages
Only provides costings & buying lists for decking I'm afraid.
Mmm. I suspect so too.
There is software used by tailors, but I think its simply tries all possibles and keeps the 'best one' and tailoring is warp/weft sensitive and has infinitely long rolls of cloth - more or less.
HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.