From: Mathias K. <mk...@gm...> - 2015-02-09 21:02:40
|
On 07.02.2015 18:18, Nicola Corna wrote: >> --optimise does not reduce >> the file size more than ~40%, because it just removes the redundant >> intermediate positions >> along vertical and horizontal moves. The paths for 45 degree traces and >> pads are rectangular step curves, --optimise does not touch them because >> adjacent segments >> are short but perpendicular. >> >> 'simplifypath' is somewhat different from 'optimise': >> >> //take two points of the path >> // and their interconnecting path. >> // if the distance between all intermediate points and this line >> is smaller >> // than the accuracy, all the points in between can be removed.. >> >> - If it really does what is advertised, I did not check that. >> >> At least it does not only merge adjacent segments as 'optimise'. >> >> I fully agree on the precision calculation - computing it all in terms >> of dpi sounds good as well, so there is only one handle to turn. > I've also noticed that the code for simplifypath was created by Bernhard Kubicek in commit b49f0f1f70dfc0ad7c31fb8a250dc85b3a9ff361 in 2010, and no one has modified it since then. He also has his fork of pcb2gcode (https://github.com/bkubicek/pcb2gcode), but I don't think that a pull from him is a good idea, the repo changed a lot since his last commit (2012) and the current simplifypath function works well enough without the need of a merge with an unmaintained repo. > > I've done some tests on my gerber file, here's are the sizes of the front output gcode: > no optimization: 432 KB > "optimise" optimization: 245 KB > simplifypath optimization: 27 KB > both: 27 KB > A diff between "simplifypath optimization" and "both" returns that the two files are identical, therefore the optimise code should be completely redundant. In the simulator, the simplifypath's output seems to be ok, the only thing that doesn't work is the "bridge" option (with simplifypath enabled only 2 bridges of 4 are created, I'll work on it). > I hadn't tested autoleveller + simplifypath yet. > > If we fix this bug, do you think it's reasonable to remove the current optimise code and replace it with simplifypath? From my (little) experience with both I would say yes. A little test checking the precision on sample files would give some more confidence. Bye Mathias |