FlexPainter Painter and Painter generator

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
CVH
Premier Member
Posts: 3364
Joined: Wed Sep 27, 2017 4:17 pm

FlexPainter Painter and Painter generator

Post by CVH » Fri Jan 03, 2020 12:19 am

From a fellow developer:
pietro_72_ wrote:
Thu Jan 02, 2020 11:33 pm
I thought, if possible, that I could make sure that your FlexPainter program allows users to create arbitrary forms to follow path
I get what you mean by that.
I am very aware that that would be a nice side add-on.
Doing everything to leave that path open.

Well, the coding of a painter is no rocket science. 8)
But I am not so sure that one can leave the human intellect aside. :?

While it is already included in the latest Qcad releases it is accompanied with a tutorial.
You may find how the rope is coded in :
...\scripts\Misc\Examples\MathExamples\FlexPainter\FlexPainterTemplates\PainterConstruct_Rope.dxf

While painters are still hardcoded you can find them in FlexPainter.js itself :
section: FlexPainter.prototype.PainterSetInit
Painter data types are explained at the top. e_geek

To be included in the dialog list a painter has also an entry here :
section: FlexPainter.prototype.initWidgetsCombo e_geek

And is further accompanied by a preview icon in the icon folder.
A Painter is coded a lot faster then that a proper icon is made. :(
I got several new Painters without a preview still .... work in progress.
If the icon isn't present you get a blank preview, not an error state.

I don't exclude a Painter generator at this moment.
But I am not saying it would be a straight forward task.

Step by step, the next focus is on separating the Painters into individual files.
Don't want some, then leave them out
OR
Add any custom one

Cheers,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”