- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
... snipped all sorts of whining and boo-hooing about metric...
Note from Alex: We use feet and inches here, not your goofy metric systems. Yeah, yeah, we all get it... metric's better, you're superior, we should all look at you because you have a snarky comment about how outdated it is, blah blah blah.
Admin
I'm not familiar enough with carpentry to understand what a splice is in this context. Is it something like each piece of board used must have one original end of the board?
Admin
Admin
16 feet = 4.88 meters 8 feet = 2.44 meters
I'm American, so I have no idea what would be standard board length in the rest of the world. Maybe 5 and 2.5 meters?
Admin
Ah, I understand. I also know this problem under a different name. The bin packing problem, which is one of those pesky NP complete problems.
Thanks, that's really helpful. Now when I see examples such as "84 + 84 + 34 can't fit in to 16" I will clear my mind of hatred and fear. Thanks. You really helped.
Admin
For those not sure
Imagine a single board running without a cut in it, wall to wall.
A splice occurs when the contractor, wanting to only buy min(x) amount of boards, uses "scraps" to finish that wall.
You can probably get away with this by caulking the final product to hide the seam then paint it.
Staining over the seam, on the other hand, would not look right.
For instance....we have a 4x 12'(3.67m) walls. I COULD only buy 3x 16'(4.88m) boards and use the scrap to finish the other wall. BUT....then I end up with a crappy looking seam @ 4ft & 8ft.
A good contractor would buy 4x 16'(4.87m) boards and do it right.
Admin
Generally wood (in the uk at least in DIY stores) is sold in multiples of 300mm, 1.2m, 2.4m or 3m being particularly common depending on what you are buying (sheet or lengths). Any similarity to lengths measured in feet are of course entirely co-incidental.
Admin
This is a classic bin packing problem:
http://en.wikipedia.org/wiki/Bin_packing_problem
Admin
Solution used in most American produced housing: Don't give the customer stained wood trim or charge them way extra so they don't want to pay for it. Force painted wood on them because most carpenters can't afford a computer and are too dumb to figure it out manually and rely on the lumber yard to figure it out for them and the lumber yard is usually wrong. You see, with painted wood trim you can splice whereever you want and hide it by caulking the joint in the wood and painting over it so the customer will never see it. In a past life I was a construction manager and these were the tricks of the trade.
Admin
Isn't using integers a bit of a WTF? How do I resolve less than 1/16 of available length with integers. I propose we use floting point numbers instead. Also, using inches and feet is probably a pitfall. Shouldn't we just provide a dimensionless solution and let the caller take care of inches to feet conversions?
Admin
TRWTF is people on the INTERNET who are helpless when confronted by "inches", "feet", and "splice". Really?
http://www.lmgtfy.com/?q=splice http://www.lmgtfy.com/?q=imperial+units
Admin
If the goal is to minimise the number of boards, then you'll never use a board other than of the maximum length! What's should we be optimising for in the Medium and Hard case?
-- Note from Alex: Longer boards are usually cheaper by the foot; a 16' length might cost $30, while a 8' could be $16. But if you only need a 8', then no sense in buying a 16'.
Admin
Admin
Not sure where that centimeter went, but I'll find it!
Admin
The units don't really matter as long as there are no conversions. Hell, you could write your program using a 10-inch foot and it wouldn't really change the algorithm, which is the interesting part.
Admin
Admin
It comes from old imperial materials. A standard gypsum board would have been 4ft, (1219.2mm),
When it all went metric the boards were produced at 1200mm, so 300mm is 1/4 of 1200mm, which is the distance between studs.
Admin
This seems a lot like the making change problem. You find all the measurements, then take the largest possible [strike]demoninations[/strike] available board lengths first.
Only difference here is you have to keep track of the extra lengths you've cut off because a left over few feet could be used elsewhere.
Admin
Admin
I demand using old russian units! Screw english/imperial/metric or whatever systems!
http://en.wikipedia.org/wiki/Verst
Arshin FTW.
Admin
Wow. I solved this exact problem this past weekend. I'm redoing my dinning room in wood trim and didn't want splices. I ended up entering all the lengths into Excel and finageled them around to minimize scrap.
The advantage to doing it in Excel was that I could include the order in which I planned to cut the boards.
Regarding the metric comments: We used to work with a team in Canada (metric) and they said they still buy their plywood in 4-foot by 8-foot sheets. Must be an America thing.
Admin
That's an ad hominem conclusion. (I don't think there's an established term for deleting disagreeing comments, especially on a recreational website like TDWTF).
But then again, the units really don't matter. Just convert them to the smallest unit (or nm) and start calculating.
Admin
You Americans and your weird units of measurement! Is something decimal-based not good enough?
With measurements like that I'm surprised you don't lose spacecraft. Oops! http://mars.jpl.nasa.gov/msp98/news/mco990930.html
Admin
do NOT use "m" do speak about something else than a meter. the MKSA system has well defined unit abbreviations for each unit: m for meter, Kg for kilograms, s for seconds, A for amperes. Each can be prefixed by c,m,u,n,.. for centi,milli,micro,nano or prefixed with K,M,G for Kilo, Mega, Giga. your mph are converted into Km/h and not kph or KM/hrs.
Here is a post from someone who would like to be able to read an american article without unit errors, thanks :)
Admin
Maybe this challenge is to be done on an embedded system, where there's no file system to store a decimal-based system of measurement.
Admin
As added bonus, if you come up with a working solution and a decent UI for it that would work on iPhone/Android, you could sell a fair number of copies. I'd only get to use it for my own house, but it would still be worth spending a few bucks on an app that is easy enough to use (and accurate, of course).
Admin
As an added bonus, prove your solution always runs in polynomial time. :-D
Admin
Admin
Gypsum != wood.
saluto: "I saluto you."
Admin
Basically: If the 16' board costs less than two 8' boards, it's never advantageous to buy more than one 8' board--you could instead buy 16' boards and cut them in two, if for whatever reason you wanted 8' boards.
Admin
Not entirely true. Now this might be true for the Big Box Stores (Home Depot & Lowes), it is not true for real hardwood suppliers. Most woodworkers want pieces of wood that are 14' and greater. When a mill gets 8' boards, it is hard for them to offload because most people want the longer boards, so the shorter boards are sold at a discount. Reason being is that you want to decrease your joints/splices, so longer boards are more desirable, and therefore, in higher demand. the Big Box Stores have a huge markup on wood so the the difference doesn't matter (besides, most people going to them don't need 16' of hardwood)
Admin
Admin
Extra hard - do it using a polynomial time algorithm (at first glance it looks NP-complete to me, so it's probably not possible, but I'm way too lazy to think about it in more detail)
Admin
Ah, so that's where my comment went. Which wasn't whining or anything, but pointing out that something non-decimal, such as 12 inches to the foot, is hugely confusing to anybody outside the US (and Liberia and Burma).
But this sort of cultural sensitivity is perhaps a bit too much to expect, which would explain the callow response.
Admin
Another is even simpler: You measure the rooms, then buy maximum length boards and add a few more than you need for good measure. While this is by no means an economically optimal solution, it provides very good results with minimal effort.
And that's also the way 90% of the workers around here would do it. 9% would buy too little and splice a lot (like in your case), 1% would try to calculate the optimal solution. Time is much more expensive than wood.
For anyone who wants to buy the boards in Central Europe: Lengths of any material are usually sold in full meter units. 2m and 3m is common, sometimes even 4m. That's already very unhandy, but it would make sense for header casings.
Admin
While this IS known as an NP-complete problem, it is, fortunately, one that is easy to approximate. The Best Fit Decreasing algorithm will order, at most (if I recall correctly) 22% too much wood. This algorithm can be performed effectively and efficiently. I'd say more, but it's probably best to refer to wikipedia lest I make a teensy mistake about which other commentators obsess.
Admin
I'm not sure it got lost. It probably crashed or got mixed up with one of the other Mars rovers. You know the ones from all the countries who use the metric system.
Admin
Although, for a do-it-yourselfer, you may not be able to haul 16' boards, so it would be an advantage to be able to enter the length of board options the program is able to use.
Captcha: damnum "Damn them?"
Admin
There are, like, 7 or 8 terms I've never heard of in the first paragraph of this writeup.
Admin
Here in Metric-land it always makes me chuckle that wood is sold in 1200mm lengths.
It might seem more logical for them to be sold in metre (or 1000mmm) lengths but your options are limited when it comes to splitting the board into equal lengths.
You can cut a 1000mm board in half and in quarter pretty easily. But say you want it split into 3? each piece would be 333.33 mm (pretty hard to get that 1/3mm accurate).
However 1200mm boards can be split into: half: 600mm quarter: 300mm third: 400mm sixth: 200mm twelfth: 100mm etc
So for all thge wisdom of the metric system, it seems that we sell boards in quasi-imperial, metrically measured lengths.
Genius.
Admin
You are mistaken. The symbol for kilograms is lower case k. Upper-case K stands for Kelvin. Hence a kK is a kilokelvin, and a Km/s is a Kelvin-meter per second.
Admin
Admin
Curious Perversions in Joinery Technology
Admin
Simple and easy, with all requirements, written in C#. Meets the "HARD" requirements. Call "SetBoardQuantities" to specify board sizes and their quantities you have on hand (pass int.MaxValue for the quanity for an infinite quanity, such as you plan to order whatever is needed at that size). Call "GetCuts" to determine which board to use and where the cut should be made. Call "GetMinimumRequiredBoards" to get the minimum required board count--it will take into account scraps that are large enough to be used for some measurements. Call "GetMinimumRequiredBoardsUsingScrap" to just be the lazy carpenter. Oh, and by-the-way, this will work with Metric, if you simply change the default addition for the 16' board to be whatever the metric equivalent is (or just remove it and make the user enter it manually). I have no idea if this code really works. It compiles, so it ships (no testing--it wouldn't be WTF if I tested it):
using System.Collections.Generic; using System;
namespace WTF_BYOC_AvoidTheSplice { public class BoardCalculator {
}
Admin
Admin
The solution is simple. Don't worry about the splices, just stick a couch (or chair, or table, or the TV) in front of it so you can't see it. With enough furniture you can hide many sins. Also, fix problems with the paint (or wallpaper) on walls by buying a picture of hanging it over it. Easy!
Admin
My experience in the UK is that most lengths of wood are very rough metric equivalents of imperial measures. e.g. 6' becomes 180cm. Problem is of course that 6' is 182.88cm, so if you're doing something to an older house many of the standard lengths are pretty useless - if you want 6' you have to buy 240cm and trim off 57cm...
Admin
Btw, how may square feet are in one acre? But it's good to know that 1 acre = 1 forlong*1 chain ;-)
Captcha: erat. Quot erat demonstrandum
Admin
err not quite, if you cut a 16[whatever unit] board in half, you do not get 2 8[whatever unit] boards in return. You will loose 1/2 the width of your saw blade on each side.
The other problem involves cutting mitered edges in the corners, you can also loose 1/2 the thickness of the board - as the cut may not be on the correct face of the board to match up with another - moldings may not have symmetrical top to bottom faces, and cannot just be "turned around".
Admin
"Take the casing on a 7’ door, for example" Why use a none standard door size instead of 6'6"?