domoszlai / juicy-gcode

A lightweight SVG to GCode converter for maximal curve fitting
https://hackage.haskell.org/package/juicy-gcode
MIT License
115 stars 8 forks source link

Generates INaN JNaN IInfinity JInfinity #1

Closed ulidtko closed 6 years ago

ulidtko commented 6 years ago

I get this "GCode":

G00 X-0.2646 Y10.3188
G01 Z0 F10.00
G02 X0.2646 Y10.8479 IInfinity J-Infinity
G02 X0.2646 Y10.8479 INaN JNaN
G00 Z10
G00 X0.2646 Y10.3188
G01 Z0 F10.00
G02 X-0.2646 Y10.8479 IInfinity JInfinity
G02 X-0.2646 Y10.8479 INaN JNaN
G00 Z10
G00 X0.2646 Y10.5833

I don't think this is correct in any way.

domoszlai commented 6 years ago

Agree. Can I have the SVG?

ulidtko commented 6 years ago

Yes sure. Not minimized though.

hatching-test.zip

domoszlai commented 6 years ago

This one causes it for whatever reason. I'll have a look

  <path
     d="M -0.99999997,39.000001 C 0.99999997,41 0.99999997,41 0.99999997,41 "/>
domoszlai commented 6 years ago

The control points and the endpoint are the same, so this is practically a line. Actually infinity makes sense as arc parameter in this case :)

ulidtko commented 6 years ago

Damn it, Inkscape...

Would it be feasible to uhh optimize output arcs with "big enough" radii to line segments then?

The tool trades an approximation withing an error margin, anyway.

domoszlai commented 6 years ago

I'll add a special case for this

domoszlai commented 6 years ago

fixed in master, give it a try

domoszlai commented 6 years ago

v0.1.0.5 has been released