Save/Save a copy to PLT format problem, HPGL question(s)

Post about using Inkscape with cutters or plotters.
MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Sun Apr 10, 2016 6:50 am

Hi everybody,

I am new in this forum, I hope I am writing into correct place...
I have following problem(s)/question(s) regarding PLT format in Inkscape:

1. What is the difference between PLT and HPGL when they are written down from Inkscape? I read everywhere that these two formats are identical, but there are 2 different exports in Inkscape and the exported PLT and HPGL files have definitively different content. It seems the PLT uses the subset of the HPGL syntax, but I am absolutely not sure about it... in any case the exported PLT contains only the IN, PU and PD commands in all PLT exports I tried till now... this is exactly what I need - I don' want more commands.

2. The PLT export (Save/Save a Copy) uses wrong(?) resolution when the SVG file is opened and the PLT is saved - it uses 50 dots/mm, it should be 40 dots/mm (which is the default because no "SC" command is present, as far I understood the corresponding article on wikipedia: https://en.wikipedia.org/wiki/HPGL). This leads to ugly things on my end device. The workaround is as follows:
- Save/Save copy the opened SVG into PLT file
- close the SVG
- open the newly exported PLT
- adapt the sizes of the objects
- Ctrl-s (save it all - it will save the PLT because it was opened as PLT)
- now the PLT has 40 dots/mm as awaited
And, finally my question: Is there a better (shorter) fix and/or workaround for this very annoying problem? (May be I am doing something not correctly :-D)

I am using Inkscape (0.48.4 r9939) for 2 days only :-D on Ubuntu 64 bit.
Please, if somebody knows the answers/hints/workaround(s) then please let me know.

Thanks a LOT!

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby Moini » Sun Apr 10, 2016 7:27 am

Hi MH7400,

you might want to update your Inkscape version to 0.91 by using the ppa (https://launchpad.net/%7Einkscape.dev/+ ... ntu/stable).

The plotter extension created by timewaster (http://timewasters-place.com/) is now included in Inkscape, and Inkscape 0.91 has got some serious performance improvements (http://wiki.inkscape.org/wiki/index.php ... notes/0.91). 0.48.4 is an *ancient* version... you even missed 0.48.5... Ubuntu repos are too old.

(I can't help with any plotter file formats, sorry)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Sun Apr 10, 2016 4:38 pm

Hi Moini,

thanks for the answer!

Unfortunately, (I am doing something wrongly again? :-D) - there seems to be no Inkscape update in the PPA - I've added the PPA successfully, it fetches the content successfully (using the apt-get update, no errors, no warnings, software source is processed) - but there is no newer Inkscape available for install/update - it tells me the "inkscape is already the newest version." :-( I don't know why - any hint for me?

In any case, I have another question/problem (may be stupid question, but I am new in the topic and Inkscape) - all DXF files I try to import (still using the "old" Inkscape I mentioned above) have no content (no object(s)) after import. What is wrong? Are e.g. the DXFs containing 3D data supported? I mean - import 3D data - transform/solve the visibility - save/export as 2D object?

Thanks a LOT for any hint regarding all my problems in advance ;-)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby Moini » Sun Apr 10, 2016 11:59 pm

MH7400, can you copy the output of

apt-cache policy inkscape

here? (it will tell you about available Inkscape versions - maybe there's a priority problem)
(again, no idea about the dxf stuff - but if legally possible, you could just upload one of your files and we can take a look).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Mon Apr 11, 2016 12:38 am

Hi Moini,

thanks a LOT for your support, now I managed to set up the system properly, on the first try I followed the instructions to append the Inkscape PPA as mentioned here http://www.ubuntubuzz.com/2015/12/how-t ... m-ppa.html - this was apparently wrong way :-D

The proper way is this one: http://sourcedigit.com/14936-install-in ... ntu-12-04/ - this one worked :-) Now I have the Inkscape 0.91 r (says about...)

Sorry for the chaos, it was apparently my bad :-D - I am really not familiar with all this pkg/ppa/software sources stuff.

OK, first - the updated Inkscape is really MUCH FASTER compared to the previous one. Unfortunately - the Save/Save a Copy to PLT 40 dot/mm vs. 50 dot/mm problem (bug?) still remains :-(

The story with DXF is the same - no content. I am not sure about the DXF licenses - I've downloaded them from somewhere - I have no idea. I'll try to find out, or, I'll try to find the DXF with no license "problems" and if it will not work then I'll ask again here.

OK, so, again - does somebody know the better solution/workaround for the PLT export problem?
When saving to PLT all the relevant document infos are lost - page format, orientation... everything. Thats why the best way is to have the data stored in e.g. SVG and do only PLT exports from them. For the problem description see my first post.... any ideas?

Thanks!

TimeWaster
Posts: 5
Joined: Mon Apr 11, 2016 6:13 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby TimeWaster » Mon Apr 11, 2016 6:29 am

Hi MH7400,

The "save as PLT" function (i assume that is what you mean with "export") is using Uniconvertor ( http://sk1project.org/modules.php?name= ... iconvertor ) as a converter from SVG to PLT, and this tool has known bugs but is not associated with Inkscape.
The "save as HPGL" function on the other hand uses the code from my extension and produces correctly sized HPGL with all the convenience functions.

it would help a lot to know what you want to do with these files, are you using a plotter? if so, you can plot directly from the plot extension over a serial connection in HPGL format which is the intended way to use the extension since PLT and HPGL are on a basic level the exact same format.

If you for some reason cannot use the plot extension you can just save to HPGL and rename that file to .plt, that is all.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby Moini » Mon Apr 11, 2016 6:46 am

Off topic:
Welcome, timewaster! :-D
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

TimeWaster
Posts: 5
Joined: Mon Apr 11, 2016 6:13 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby TimeWaster » Mon Apr 11, 2016 6:50 am

Hi De Ho! ^^

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Mon Apr 11, 2016 7:19 am

Hi TimeWaster,

thanks a LOT for your explanation about plt vs. hpgl - as I've mentioned above - it was absolutely not clear to me what is the difference between the PLT and HPGL - I was only guessing and found the PLT one "simpler" - only looking at it.

Yes, with "export" I mean "save as PLT".

The reason why I need to write the data to the file is the fact my plotter doesn't understands HPGL at all. It is an prehistoric piece of HW built in Czechoslovakia in the mid of 80's - the "Didaktik Z", and, it has no intelligence at all on board - in contains only stepper motors transistors with some very basic logic to drive them. And, I've built the HW which communicates over RS232 and has only very basic functionality (move, pen UP, pen Down, Reset/Park) to control the plotter. And, I don't want (I have no time, and, it is not worth to do it...) to implement the HPGL interpreter in the small MCU I use to do the job. Thats why I wrote simple translation utility (C++), which takes the exported PLT (HPGL) and translates it into the plotter "language" (and performs some scaling - I had no possibility to define the resolution with PLT export...) and performs the optimization of the paths contained so that always the "nearest" path is taken after the previous one was finished during plotting (this saves up to 80% of plot time - compared to the non-optimized, simply converted "PLT" file - depending on the data structure, of course).

And... here the reasons why I asked what is the difference between PLT and HPGL :-D My conversion utility understands only the IN, PU and PD HPGL commands (the others are ignored). And, I need the HPGL export which uses only these commands (ok, some SP's can be ignored, may be some others too....), but, my tool doesn't understand any other commands (like circles, ellipses, and, all other HPGL things). Thats why I need the HPGL export which uses only these few basic commands: IN, PU, PD and may be some others which can be gratefully ignored for my needs.

So, finally ;-), my question: does your HPGL export uses only such simple commands? It is possible to count with it in the future too? And, as you mentioned in your post - the HPGL export (the "save as HPGL") uses the same code as your plotter extension - it is not needed to have the file output from the plotter extension self - as far I understoon it correctly (?)

In any case - you helped me a lot, thanks in advance for any feedback :-)

BR,
MH7400

TimeWaster
Posts: 5
Joined: Mon Apr 11, 2016 6:13 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby TimeWaster » Mon Apr 11, 2016 8:08 am

yes it does, as long as you set the speed and force options to "0" the used commands are IN, SP, PU, PD, and this will be the same in the future.

and yes, "Save as HPGL" uses the exact same code as the plotter extension itself, just use it and open the resulting file, it will only contain the above mentioned commands.

can you add some photos of your fantastic contraption here? sounds like a fun project...

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Mon Apr 11, 2016 4:10 pm

OK, this is great (about the limited HPGL commands used) - to be exact - it is of course possible to add support for any thinkable HPGL commands into this conversion tool - but, as long it is not needed then I'll keep it simple (keeping it simple is the best strategy (almost ;-)) always ;-))

And, yes, the project is really funny, beside the fact it is completely useless - I cannot imagine I'll use the plotter to do something really serious :-D
The case is loose and it doesn't fit exactly, it heats like a hell - the heat deforms the paper (not much, but it leads to unwanted "lines" during move with pen up under circumstances - I avoided this by adding some "weight" pressing to the paper near the pen), the transistors for the second pen are burned (I don't plan to replace them) and so on... see the pictures attached. But, after I spent 3 evenings to develop the interface HW + MCU SW, I decided to finish it all - thats why I was searching for the suitable software - now I found Inkscape and together with your HPGL export it is apparently the right choice, because...

... good news - after my PLT vs. HPGL "problem" is solved/clarified I've used your HPGL export to feed my converter, and, everything works very well! Now it produces correct plots with correct sizes!

Now, I have to solve the "DXF problem" I've mentioned somewhere above - then I'll create short video how it works together. There are lots of videos on youtube regarding the "ALFI" plotter (the do-it-yourself plotter - coming from Czechoslovakia too, it was available in 80's) but I found no one video with working Didaktik Z :-(. BTW - the HW I've built would work (with some small changes in stepper motor driving and timing) with ALFI plotter too.

Thnaks!
BR,
MH7400
Attachments
DidaktikZ_02.jpg
DidaktikZ_02.jpg (34.44 KiB) Viewed 6997 times
DidaktikZ_01.jpg
DidaktikZ_01.jpg (30.33 KiB) Viewed 6997 times

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby Moini » Mon Apr 11, 2016 10:06 pm

Thanks for the pics :)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

TimeWaster
Posts: 5
Joined: Mon Apr 11, 2016 6:13 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby TimeWaster » Tue Apr 12, 2016 3:06 am

wow that thing is really crusty.

i found this forum post here: http://blog.3b2.sk/igi/post/Plotter-Didaktik.aspx
and it really just consists of some transistors and a really badly design mechanic ^^

i love it :lol:

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Tue Apr 12, 2016 4:56 am

Hi *,

now I've found some DXFs which can be read by Inkscape without errors (http://www.ceco.net/). OK, soon I'll create and publish some video with the running Didaktik Z.

And, yes, the Didaktik Z contains only the stabilized power supply, the transistors and two 1 of 8 decoders, and the keyboard is not functional without the connected master device which is able to read the key states from the Didaktik Z (there is separate connector on it where the keyboard can be read from outside) and react accordingly - drive the two 1 of 8 decoders wired over the transistors to the step motors and two pins driving the pens.

OK, I can say, from my POV - Mission accomplished!

Thanks a LOT for all your very valuable help guys!

BR,
MH7400

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Wed Apr 13, 2016 7:00 am

Hi TimeWaster,

... I have some problems with the "Save as HPGL".

The first problem appears only on Windows (Running on Win10 Pro 64 bit, the 64 bit Inkscape 0.91 r13725) - see below the error text, on Linux everything works well (Xubuntu 64bit, and I have no idea whether Inkscape is 32 or 64 bit :-D on Lin).
Traceback (most recent call last):
File "hpgl_output.py", line 80, in <module>
e.affect()
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\inkex.py", line 268, in affect
self.effect()
File "hpgl_output.py", line 54, in effect
self.hpgl, debugObject = myHpglEncoder.getHpgl()
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\hpgl_encoder.py", line 180, in getHpgl
self.processGroups(self.doc, groupmat)
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\hpgl_encoder.py", line 207, in processGroups
self.processPath(node[1], node[2])
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\hpgl_encoder.py", line 242, in processPath
self.processOffset(cmd, posX, posY)
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\hpgl_encoder.py", line 300, in processOffset
pointThree = self.changeLength(self.vData[0][1], self.vData[0][2], self.vData[1][1], self.vData[1][2], self.toolOffset)
File "C:\Users\bastel\local_programs\inkscape\inkscape\share\extensions\hpgl_encoder.py", line 276, in changeLength
x = x2 + (x2 - x1) / self.getLength(x1, y1, x2, y2, False) * offset
ValueError: ('', <type 'exceptions.ZeroDivisionError'>, ZeroDivisionError('float division',))

This happens for "some" documents - I have no idea which document content/conditions leads to this error :-D

The second problem is reproducible on both Win and Lin: When the "Mirror X axis" option is selected then almost all X coords are exported as 0 (zero). Not all of them.... but definitively too much of them - may be I misunderstood something :-D.

Actually, it is not really a problem for me - I've installed Inkscape on Win today only because I have two bigger monitors connected to my Win PC - it looks better on them, and, to "Save as HPGL" + my conversion tool (it mirrors the X axis for me ;-)) + plotting is done on the Lin PC.

OK, I don't know whether this my post is helpful for, you :-D - Sorry if not :-D

BR,
MH7400

MH7400
Posts: 8
Joined: Sun Apr 10, 2016 4:58 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby MH7400 » Thu Apr 14, 2016 5:51 am

Hi *,

here is the promised video: https://youtu.be/HsjUsFid5xw

Thanks a LOT again for your support!

BR,
MH7400

TimeWaster
Posts: 5
Joined: Mon Apr 11, 2016 6:13 am

Re: Save/Save a copy to PLT format problem, HPGL question(s)

Postby TimeWaster » Sun Apr 17, 2016 10:33 pm

can you send me a file where the first problem happens to sebi at timewaster.de and for the second one use the plotting extension instead of the hpgl export, use the same settings, activate the debug output (last tab, last option) and send me the complete output?

thanks


Return to “Inkscape & Cutters/Plotters”