QCAD-Plugin for laser cutting

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
RR88
Junior Member
Posts: 18
Joined: Sun Apr 29, 2018 7:04 am
Location: Leinefelde

QCAD-Plugin for laser cutting

Post by RR88 » Thu Jun 14, 2018 8:42 pm

I'm proud to introduce a new plugin for QCAD. It is made for laser cutting and it is hosted at https://github.com/zippy84/lc-qcad or https://gitlab.com/zippy84/lc-qcad. The main features are implemented and it can be used in production. It is not perfect yet but it will be improved whenever I have the time. Constributions via pull request, bug reports or e-mails are explicitly welcome. A full description and the install instructions are contained in the readme of the project. A small example is also provided within the project. Pictures say more than thousand words:
t1.png
t1.png (144.33 KiB) Viewed 2425 times
t2.png
t2.png (156.05 KiB) Viewed 2425 times
t3.png
t3.png (144.96 KiB) Viewed 2425 times
t4.png
t4.png (143.38 KiB) Viewed 2425 times
The plugin works also with the trial version of QCAD.
Gentoo/Linux, QCad 3.20 Prof.

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

Re: QCAD-Plugin for laser cutting

Post by Husky » Thu Jun 14, 2018 10:07 pm

Hi RR88 - nice approach! Thanks for sharing that!

I made a first test but I'm experiencing a few difficulty's. Just to be sure that the installation of this plugin is correct on my Win10.

Folder:
... qcad-3.20.1.3-pro-win64\scripts\Misc\Modify\LaserCuttingFormatter

contains 3 files:

FormatterDialog.ui
LaserCuttingFormatter.js
lcBundle.js

Correct?
Work smart, not hard: QCad Pro

RR88
Junior Member
Posts: 18
Joined: Sun Apr 29, 2018 7:04 am
Location: Leinefelde

Re: QCAD-Plugin for laser cutting

Post by RR88 » Thu Jun 14, 2018 10:13 pm

Yes, that's true. I never tried it with windows. What are the difficulties?
Gentoo/Linux, QCad 3.20 Prof.

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

Re: QCAD-Plugin for laser cutting

Post by Husky » Thu Jun 14, 2018 10:44 pm

RR88 wrote:
Thu Jun 14, 2018 10:13 pm
Yes, that's true. I never tried it with windows.
Thanks for confirmation.
RR88 wrote:
Thu Jun 14, 2018 10:13 pm
What are the difficulties?
If I use your script it will delete all blocks, correct?
If I try to undo the result of your script I have to do it multiple times and then QCAD will be terminate by itself ...
Work smart, not hard: QCad Pro

RR88
Junior Member
Posts: 18
Joined: Sun Apr 29, 2018 7:04 am
Location: Leinefelde

Re: QCAD-Plugin for laser cutting

Post by RR88 » Thu Jun 14, 2018 11:29 pm

The undo argument of all transactions is set to false because there is no need of a history tracking. I think it is not turned off for the addLayer function. That causes the crash.

It's right that there are no blocks at the end, but blocks will be handled. Only blocks that are not referenced will be deleted. Or what do you mean?
Gentoo/Linux, QCad 3.20 Prof.

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

Re: QCAD-Plugin for laser cutting

Post by Husky » Fri Jun 15, 2018 12:52 am

RR88 wrote:
Thu Jun 14, 2018 11:29 pm
The undo argument of all transactions is set to false because there is no need of a history tracking.
Ok, that is then a matter of opinion. I think there is a need to adjust the settings or ad least undo the action.
RR88 wrote:
Thu Jun 14, 2018 11:29 pm
It's right that there are no blocks at the end, but blocks will be handled. Only blocks that are not referenced will be deleted. Or what do you mean?
Partly what I mean.
New Blocks created in that particular drawing are deleted when unused. Used Blocks will remain.

Blocks loaded with a template are always deleted. Regardless of used or not used.

BTW: Your script creates the blocks BO, BB. Trying to edit or make them invisible leads to an unintended deleting of the block.
Work smart, not hard: QCad Pro

RR88
Junior Member
Posts: 18
Joined: Sun Apr 29, 2018 7:04 am
Location: Leinefelde

Re: QCAD-Plugin for laser cutting

Post by RR88 » Fri Jun 15, 2018 1:32 am

I don't know much about templates to understand what you are expect from my plugin. Please describe it in more detail. Actually all blocks and layers must be visible and unlocked. Otherwise it leads to an unexpected termination.
Gentoo/Linux, QCad 3.20 Prof.

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

Re: QCAD-Plugin for laser cutting

Post by Husky » Fri Jun 15, 2018 4:21 am

A template can be used as s a starting point for a new drawing and is basically an ordinary drawing which could also contain blocks.
Here a brief description:
http://www.qcad.org/doc/qcad/latest/ref ... te_en.html
Work smart, not hard: QCad Pro

User avatar
andrew
Site Admin
Posts: 5644
Joined: Fri Mar 30, 2007 6:07 am

Re: QCAD-Plugin for laser cutting

Post by andrew » Fri Jun 15, 2018 8:53 am

RR88 wrote:
Thu Jun 14, 2018 11:29 pm
The undo argument of all transactions is set to false because there is no need of a history tracking.
Undo should only be turned off if there is absolutely no doubt that undo / redo will never be used (i.e. when automatically generating a drawing off-screen without any user interaction possible).

You might want to group multiple transactions into one undo / redo step, so user can undo everything at once after running a tool. You can do this as follows:

Code: Select all

// start a new transaction group:
doc.startTransactionGroup();
...
// then, for all operations in the same group:
op.setTransactionGroup(doc.getTransactionGroup());

RR88
Junior Member
Posts: 18
Joined: Sun Apr 29, 2018 7:04 am
Location: Leinefelde

Re: QCAD-Plugin for laser cutting

Post by RR88 » Fri Jun 15, 2018 2:12 pm

Thanks for the feedback. I'm afraid that the tracked transactions will make it significantly slower. But I will try to make it possible. Also the better handling of unused blocks.
Gentoo/Linux, QCad 3.20 Prof.

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”