Jack000 / SVGnest

An open source vector nesting tool
MIT License
2.26k stars 372 forks source link

lasercut optimisation #7

Open Neon22 opened 8 years ago

Neon22 commented 8 years ago

Great work !. I suggest an optimisation which could be added as an option.

If two edges are coincident and one lies enirely within the length of the other, then eliminate the shorter edge.

This will optimise out the duplication of cuts in a way that does not chop an edge into a number of shorter cuts - which frequently generates bumps in a physically cut result. Further types of reuction could be looked at as well but the direction and order of each cut is an ordering problem within the SVG and a tricky one to calculate.

Jack000 commented 8 years ago

someone else mentioned this to me too. I think it's do-able but not necessarily a trivial change, the 2 co-linear parts would have to be split into 3.

I'll add it to the todo list : ]

Neon22 commented 8 years ago

ahh - no - ideally reduces to one... svg-fit-01

Jack000 commented 8 years ago

Right, I mean that instead of 2 closed paths we'd end up with 3 open paths in the output.

Currently the output is simply the input svg paths with some transforms applied. Implementing this feature would require an extra post-processor before export.

redteam316 commented 8 years ago

Then implement post-processors. Nuff said. You know what your talking about. (unless of course you have a better idea, then screw that and implement that intead :)