geoffd123 / Hpgl2Gcode

A simple HP Graphics Language to GCode converter
12 stars 5 forks source link

Undefined method when parsing my HPGL #1

Open jridley opened 12 years ago

jridley commented 12 years ago

My HPGL appears OK but I get this when I give it to HGPL2Gcode:

ruby bin\hpgl2gcode.rb -i foo.hpgl D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:70:in process': undefined method[]' for nil:NilClass (NoMethodError) from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:89:in block in execute' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:ineach' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:in each_with_index' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:inexecute' from bin/hpgl2gcode.rb:7:in `

'

My HPGL file is at http://make-something.com/stuff/foo.hpgl

Note this is the first time I've touched Ruby so I could have something wrong with my install, but it does run OK against the provided HPGL file.

geoffd123 commented 12 years ago

Hi

Thanks for reporting this, and for trying the software.

It is failing in the routine that draw arcs. Currently it only deals with full circles. I will take a look at your code in the morning and see what the problem is.

Cheers Geoff

On 29 Dec 2011, at 04:43, jridley wrote:

My HPGL appears OK but I get this when I give it to HGPL2Gcode:

ruby bin\hpgl2gcode.rb -i foo.hpgl D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:70:in process': undefined method[]' for nil:NilClass (NoMethodError) from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:89:in block in execute' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:ineach' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:in each_with_index' from D:/apps/reprap/geoffd123-Hpgl2Gcode-c6e7067/lib/hpgl2gcode/gcode.rb:88:inexecute' from bin/hpgl2gcode.rb:7:in `

'

My HPGL file is at http://make-something.com/stuff/foo.hpgl

Note this is the first time I've touched Ruby so I could have something wrong with my install, but it does run OK against the provided HPGL file.


Reply to this email directly or view it on GitHub: https://github.com/geoffd123/Hpgl2Gcode/issues/1

geoffd123 commented 12 years ago

Hi Jr

This is now fixed and foo.hpgl creates valid Gcode.

I had an error in the RegEx that parsed the arcs.

Originally the code was only written to draw full circles, not partial arcs. I have added code for that too as some of your arcs were only 180 degrees.

Can you try the fix and confirm that what it draws is what you expect.

Cheers Geoff