|Home » Forums » CAD » Message||Login|
You are not logged in. Consider these WOODWEB Member advantages:
Replacing fence panels, 1D nesting11/4
I have been asked to replace the fence panels in a 20 or so year old fence. The field of boards in the panels, is mostly vertical 1x6. Probably lots of fences like that around. How this one is different, is that the length of the panels is not constant, or even close to constant. The smallest span is 34 inches, and the longest is 129 inches. The average is a bit over 9 feet.
I wrote a program (in perl) to calculate the gaps: all boards the same width, the edge boards can be smaller or the center board can be smaller. And it seems to work quite nicely, producing gaps of quite close to 0.5 inches across the 51 panels I presented it with.
In the program, are nominal and actual sizes for many kinds of planed 1x6. If I change to rough lumber, I'll need to alter the program for the larger size of rough lumber.
You may not know the Perl environment well, but it isn't unusual to find perl programs and libraries distributed freely, which is what I am intending.
Are there other things this program should do?
The image shows 3 smoothed histograms of the gaps produced: Try 1 (red) is all boards being the same width (5.5 inches). Try 2 is sometimes using 3.5 inch wide edge boards. Try 3 is sometimes using 3.5 inch edge boards or sometimes using a 3.5 inch board in the center of the panel.
Talking to myself. I suspect symmetry is important to fence panels. I wrote a number of subroutines to fit narrower boards into a field of full width boards. Some subroutines only work for special circumstance.
If the number of boards is odd, putting a narrower board in the center of the field.
If the number of boards is even, putting a pair of narrower boards in the center. If the number of boards is a multiple of 3, putting a pair of narrower boards at the 1/3 and 2/3 position. If the number of boards is greater than 1, putting a pair of narrower boards at the two edges.
Triplets: if the number of boards is odd, a board on each edge and a board in the center. If the number of boards is a multiple of 4, putting boards at 1/4, 2/4 and 3/4.
Quadruplets: If the number of boards is a multiple of 3, boards at 0/3, 1/3, 2/3 and 3/3.
Other patterns could be examined for, but I thought that was enough to start.
The gaps were evaluated by comparing them to the gap preferred and calculating a penalty based on the ratio of widths for the narrower board, and how many substitutions were being made.
I have 37 unique panel widths (out of 52) in a fence I can walk a few feet to examine, ranging from 34 to 129 inches, but few below 100 or above 120.
With all these different methods, and different sizes of boards, lots of possibilities come up. With S4S lumber, I seen 646 different solutions for gaps between 0.25 and 0.75 inches, preferring 0.5 inches. Using kind of a magic way of evaluating all these solutions, what seems to catch most situations is to accept all boards being full width, if that is the best solution calculated. The next solution to try, is to replace the two edge boards with narrower boards. Third choice is to replace the center board with a narrower one, if the number of boards is odd. What was left after this, was the 34 inch wide panel. None of the remaining solutions was appetizing, so after walking to the fence section and measuring it more closely, I think the best solution is to custom rip edge boards (4.75 inches). So, another subroutine to do this is in the works.
I repeated the run, assuming "rough" lumber (actual width equals nominal width). The same 3 mechanisms adequately handle all 37 panel widths (only 553 different solutions to look through).