Jack000 / SVGnest

An open source vector nesting tool
MIT License
2.29k stars 382 forks source link

Enhancement suggestion: Required orientation #15

Open servant74 opened 8 years ago

servant74 commented 8 years ago

I would like to suggest allowing some parts to be marked to have a 'grain' direction, as well as the stock piece.

This would allow cutting, say plywood, so the grain is going in the 'correct' direction for the part.

This is important in woodworking to keep the grain right, but also in patterned stock of any kind (wall paper for example).

Thank you for the consideration.

cojarbi commented 8 years ago

+1 for this.

Neon22 commented 8 years ago

This might be more easily defined as marking some parts to not be rotated when fitting. Then you'd mark all of the ones you wanted to be in the same direction to stay there. And its up to you to orient the grain of the wood with the correct initial orientation of those pieces.

If marking parts is tricky then how about two groups of parts. One that can be reoriented and one that cannot.

There are several other reasons for maintaining orientation when fitting. so its a more general solution

servant74 commented 8 years ago

About 1980 I worked for a startup that did this for the flat glass industry. Manual optimization got about 90% yield, but the automated guaranteed 95% yield but typically got 97 to 99 (yep, averaged 98% yield.)

Flat glass industry is ones who cut glass for windows then for some (most commercial windows) have to temper the glass. Depending on how it is hung in the annealing furnace (yes, vertical) the glass stretches. The amount of stretch had to be back calculated to get the dimensions to cut the glass. No one cares now, but it was a big deal when we ran all this using Fortran on a Cromemco Z80 processor with 64K bytes of memory.

We only handled rectangular shapes, but that was most of what our customers wanted.

Now I would like to use nesting to get better yield from my little CNC rig, but shapes are typically not rectangular.

... Have a great day...

Jack000 commented 8 years ago

so I think this is do-able, but I'm a bit concerned about adding complexity to the UX. Maybe the marking could be a config button that then allows you to mark the un-rotatable pieces.

servant74 commented 8 years ago

Would it be possible to 'corral' or otherwise segregate un-rotatable pieces in a container so all pieces inside the 'no rotate' container would be more easily tagged.

The 'no rotate' container could be just another large piece that is larger than the piece to have parts put into (the target material) outline.

Just a thought. I would suggest a 'color' (red or blue rather than 'black' for standard pieces, but that isn't something SVG does, as far as I know (but I am pretty un-knowledgeable in SVG standards)

HJuup commented 7 years ago

Interesting discussion. In metal sheet industry the requirements are somewhat more complex compared to the wood-grain issue. Metal sheet proces is as follows: Sheet metal is cut (lasered or punched) Next step is bending on a press brake. For the press-brake it is important that the grain (molecular structure) is in the same direction for all identical parts in the nest. That is a prerequisition to have a consistent bend during the complete batch. In most cases it does not matter if grain is along or perpendicular to bending axis. Now back to nesting and rotations: Commercial nesting software often has an option to select allowable rotations of a part. Most of the time this is set per part to (0 or 180) or to (90 or 270). This will ensure grain directions for identical parts to be the same. However it does not always produce the best material utilisation. It can be the case that a part (which is set to 0 or 180) will fit better if it were set to (90 or 270) and would result in a better utilisation. I've not seen commercial nesting software that does provide the option per part: try (0 or 180) and try (90 or 270) An approach to a solution might be to bluntly try all the possible combinations and find out which one has the best result. Say there are 20 sets of identical parts, one wants to test 2 sets of orientations. This results in 2^20 = over a milion combinations to test for... Sounds like a huge numbercruncher will be needed. Is there a smart approach to solve this problem?

servant74 commented 5 years ago

Hjuup, to get a good fit, normally you don't need to get a 'perfect' fit. Taking a selection of differnt sized pieces allows 'good' use of material. -- You might just take an arbitrary 40 or 80 parts (or select some other number, larger or smaller) and you will get a 'good' fit for those parts. If there is more room left, add a few more parts and re-run the fit algorithm. If there are big 'holes', add little parts. ...

Just some thoughts.

cptX commented 5 years ago

I think the following are necessary for real environment uses:

  1. Have a way to mark orientation on the original piece
  2. Preserving orientation information during processing
  3. Showing orientation after finishing processing
  4. Ability to set orientation constrains per piece
  5. Ability to rotate text shown on a piece with the piece itself (text could include orientation information or other information, eg. labels, dimensions etc)

As I have suggested in other issues it would be great if every object was a group and the algorithm was using the whole group as an object not only it's outline.