Getting Seriously Tired of our stupid MSDOS laser!
Seems it can't interpolate arcs (AA, AR)!
So I guess I'll write a custom script... doesn't look too hard. Something in HPGL.integer.prototype.writeMove() etc.
But, is there another way to tell it to use line segments instead of arcs?
You know, parsing DXF's isn't that hard, wrote my own viewer in 1 hour using Visual Basic. Should have just added an HPGL exporter. Would be done by now.
Anyway, we still like QCAD, use it for EDM at work and GRBL engraver at home, no problem with G-code.
(Maybe can just export the DXF without arcs from Inventor if possible)
Don't use smileys much, but seriously, !!
[Solved] HPGL Arcs as Line Segments (stupid machine!)
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.
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
[Solved] HPGL Arcs as Line Segments (stupid machine!)
Last edited by rabtrfld on Mon Nov 09, 2020 4:24 pm, edited 1 time in total.
Re: HPGL Arcs as Line Segments (stupid machine!)
Here's some boilerplate code that can be used for interpolating arcs with line segments in a legacy post processor:
Code: Select all
include("HPGL.js");
function MyHPGL(documentInterface, newDocumentInterface) {
HPGL.call(this, documentInterface, newDocumentInterface);
this.decimals = 0;
}
MyHPGL.prototype = new HPGL();
MyHPGL.prototype.writeCircularMove = function(x, y, center, radius, startAngle, endAngle, isLarge, isReversed) {
// interpolate arc with line segments:
var shape = new RArc(center, radius, startAngle, endAngle, isReversed);
// segment length: 0.1:
var pl = shape.approximateWithLines(0.1);
var plSegments = pl.getExploded();
for (var k=0; k<plSegments.length; k++) {
var plSegment = plSegments[k];
this.writeLinearMove(plSegment.getEndPoint().x, plSegment.getEndPoint().y);
}
};
Re: [Solved] HPGL Arcs as Line Segments (stupid machine!)
Thank you VERY much for the code! I marked the topic Solved.
Re: [Solved] HPGL Arcs as Line Segments (stupid machine!)
PS: Even though I already marked this "solved," I wanted to report back that it actually worked all the way through the awful MSDOS program and resulted in legible engraving from our old NdYAG laser. Thanks again. This is one of those cases where the company would not invest so I had to buy QCAD/CAM out of pocket or let my project fail. More expensive software was beyond my reach, but QCAD is reasonably priced and I already feel I'm getting my money's worth. Good work QCAD!
Re: [Solved] HPGL Arcs as Line Segments (stupid machine!)
Excellent, many thanks for your kind feedback! Good to hear you got it working