hpgl integer overflow, really

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Shaeto
Newbie Member
Posts: 4
Joined: Thu May 12, 2022 4:33 pm

hpgl integer overflow, really

Post by Shaeto » Thu May 12, 2022 4:52 pm

QCAD/CAM 3.27.5.0, x86_64, MacOS
post-processor HP-GL
plotter hp7475a

problem: plotter has limits for x/y = -32767 .. 32768
post-processor generates arcs with center points outside of the possible coordinates, plotter draws strange things

example : AA-36525.1849,-61167.6598,0.627

attached dxf and hpgl (as .txt)

just fyi I understand this is not a bug, i don't want to force interpolation and will try to write some post-post-processor

may be you can suggest something or add "smart" arc interpolation for small arcs
Attachments
poisonous-spider-svgrepo-com.txt
(6.73 KiB) Downloaded 285 times
poisonous-spider-svgrepo-com.dxf
(284.4 KiB) Downloaded 273 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: hpgl integer overflow, really

Post by Husky » Thu May 12, 2022 8:53 pm

Just a wild guess ...

Explode all splines, generate the code again - test and see what happens ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

Shaeto
Newbie Member
Posts: 4
Joined: Thu May 12, 2022 4:33 pm

Re: hpgl integer overflow, really

Post by Shaeto » Thu May 12, 2022 9:14 pm

explode/rebuild didn't help, btw "interpolate arc by line segments" in HPGL and HP Pen Plotter postprocessors doesn't work

problem in hp7475a firmware and used mathematics libraries - it can't handle "big" (for that cpu :) numbers

CVH
Premier Member
Posts: 3365
Joined: Wed Sep 27, 2017 4:17 pm

Re: hpgl integer overflow, really

Post by CVH » Fri May 13, 2022 7:01 am

Hi,

The CAM output would explode Splines to Arcs and Lines in the background to export them as G-code or as HPGL.

When I explode (XP) your drawing in layer 0 using 0.01 tolerance I get 6 arcs with a radius of over 10.000 (10k).
>> Selection filter (GF) .. Type: Arcs .. Property: Radius .. Comparison: Greater than .. 10.000

The bulging of those arc is so minute that one could replace them with line segments.

CAM would handle the exploded shape just the same but one could recombine all segments to one polyline.

Regards,
CVH

Shaeto
Newbie Member
Posts: 4
Joined: Thu May 12, 2022 4:33 pm

Re: hpgl integer overflow, really

Post by Shaeto » Fri May 13, 2022 2:04 pm

thank you, as i understand if option "interpolate arc by line segments" is enabled resulting .plt file shouldn't contain arcs (AA) but it does

CVH
Premier Member
Posts: 3365
Joined: Wed Sep 27, 2017 4:17 pm

Re: hpgl integer overflow, really

Post by CVH » Fri May 13, 2022 3:21 pm

Shaeto wrote:
Fri May 13, 2022 2:04 pm
if option "interpolate arc by line segments" is enabled resulting .plt file shouldn't contain arcs (AA) but it does
I agree.

The question here is if all the settings are used consecutive in this process.
From Splines with a tolerance to Polylines ...
From the resulting Polylines to Lines and Arcs ...
Interpolating the resulting Arcs with the given segment length ...

What happens if you process a simple Arc with interpolation active?
When I process it as a Polyline then my HPGL export only contains PA's (about 5.000 Plot Absolute) and no AA's (Arc Absolute).

Does the interpolating setting also turns itself off after a single use on your system?

Regards,
CVH

Shaeto
Newbie Member
Posts: 4
Joined: Thu May 12, 2022 4:33 pm

Re: hpgl integer overflow, really

Post by Shaeto » Fri May 13, 2022 5:14 pm

i have attached postprocessor settings

on simplest single arc it produces something like PA1000,0;PD;AA0,0,90;PU;

nothing changed if i play with min/max values and rebuild path
Screenshot 2022-05-13 at 19.10.54.png
Screenshot 2022-05-13 at 19.10.54.png (323.94 KiB) Viewed 8109 times

Post Reply

Return to “QCAD/CAM”