Some questions about plugins.

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

Moderator: andrew

Post Reply
AndreasO
Junior Member
Posts: 16
Joined: Fri May 02, 2014 8:41 am

Some questions about plugins.

Post by AndreasO » Sat Jun 27, 2015 4:12 pm

I'm going to learn ecmascript to make a plugin to handle some things that is neaded for geodetics.

have some questions:
Does qcad snapp Z(hight) or can it be made to do it?
Can a plugin retrieve Z to calculate slope?
Can I remake the parallel line function to do a Z-move?
Is it possible to edit points in an excelformat style?

Well... if the answer is yes I'll do it now!:-)

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

Re: Some questions about plugins.

Post by andrew » Mon Jun 29, 2015 3:24 pm

AndreasO wrote:Does qcad snapp Z(hight) or can it be made to do it?
I've committed the necessary changes to snap to Z levels for end points and middle points. Other reference points such as intersections are not covered by these changes.
AndreasO wrote:Can a plugin retrieve Z to calculate slope?
Yes, Z coordinates for example for lines are stored in the line's start and end point. You can display / edit Z coordinates using the property editor:
Edit > Application Preferences > Widgets > Property Editor > Display Z coordinates.
AndreasO wrote:Can I remake the parallel line function to do a Z-move?
I'd recommend to implement a new tool for something like that, e.g. "Z Offset". You could project your 3D line onto a vertical plane, then use ShapeAlgorithms.getOffsetLines(...) and project the result back.
AndreasO wrote:Is it possible to edit points in an excelformat style?
No. The closest to that is the property editor. There's also a simple example script which imports points from a text file in x,y format. This could be easily adjusted to (optionally) support Z coordinates:
scripts/Misc/MiscIO/ImportPoints/ImportPoints.js

User avatar
Arie Kabaalstra
Newbie Member
Posts: 5
Joined: Sat Dec 24, 2011 11:51 am

Re: Some questions about plugins.

Post by Arie Kabaalstra » Sat Aug 03, 2019 1:23 pm

Yes, Z coordinates for example for lines are stored in the line's start and end point. You can display / edit Z coordinates using the property editor:
Edit > Application Preferences > Widgets > Property Editor > Display Z coordinates.
That was just what i needed.. i often have to deal with "projected" DXF's with 3D geometry, that has to be "Flattened" in order to create "Boundaries" for CAM purposes.. sometimes i have to "reverse engineer" NC Files, by projecting the Toolpaths to Geometry, giving me 3D toolpaths, which have problems when trying to offset them to get the actual original geometry in 2D.. also with Projection of 3D STL models, this also happens.. since projecting an STL gives you a 3D wire model..

Selecting all and entering "0" for all the Z-coordinates solves the problem, and "flattens" the drawing.. Thanks!

CVH
Premier Member
Posts: 775
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Some questions about plugins.

Post by CVH » Sat Aug 03, 2019 7:08 pm

I'm intrigued with the purpose!?
As I cast an offset to lines, arcs or polys Qcad does a good job in keeping the Z correct.
Although it might leave gaps.

Your last post sounds more like
Misc/Modify/Flatten2D

User avatar
Arie Kabaalstra
Newbie Member
Posts: 5
Joined: Sat Dec 24, 2011 11:51 am

Re: Some questions about plugins.

Post by Arie Kabaalstra » Sat Aug 03, 2019 11:20 pm

Damn!.. :D i hadn't yet found that one..

That does the trick also
I'm intrigued with the purpose!?
well I ran into problems with 3D DXF's projecting some lines and arcs to one Z level.. i ended up with "Weird geometry"

Sometimes i'm provided with only an STL model, ori have to make a certain projection.. my Cam Software can project all edges on a model.. i then need to "flatten" it for drawing boundaries to contain my milling operations..
I make titanium watches.. and these cases can be quite intricate parts..

CVH
Premier Member
Posts: 775
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Some questions about plugins.

Post by CVH » Sun Aug 04, 2019 12:05 am

Sub mm details, I know all of that.
Still I can not figure out your workflow
STL > DXF by CAM Gcode >2D
STL are all triangles, downside lots of similar edges.
offsets (Dmill/2)

Post Reply

Return to “QCAD Developers and Contributors”