Page 1 of 1

Point to point distance 2D

Posted: Sat Jan 29, 2022 11:35 am
by Anda
Hi, I have files where objects have Z values, but depending on the situation I usually like to measure the 2D distance. However QCAD seems to only show the 3D distance (plus dX and dY) using the info distance point to point tool.

Is it possible to optionally show the 2D distance, and maybe dZ separately? Thanks!

(OS: any, QCAD version: 3.27.1)

Re: Point to point distance 2D

Posted: Sat Jan 29, 2022 6:42 pm
by Husky
Anda wrote:
Sat Jan 29, 2022 11:35 am
Hi, I have files where objects have Z values, but depending on the situation I usually like to measure the 2D distance. However QCAD seems to only show the 3D distance (plus dX and dY) using the info distance point to point tool.

Is it possible to optionally show the 2D distance, and maybe dZ separately? Thanks!
QCAD has limited possibility's to show Z values at entities within the Property Editor. However - QCAD is a plain 2D program which means it could behave "weird" with 3D drawings. Maybe just test your drawing and see how useful it would be for you ...

Re: Point to point distance 2D

Posted: Sat Jan 29, 2022 11:04 pm
by CVH
Anda wrote:
Sat Jan 29, 2022 11:35 am
Is it possible to optionally show the 2D distance,
As far as I know there is no option/preference to do so.
Perhaps it may be considered as a feature request:
https://www.ribbonsoft.com/bugtracker/

One could duplicate the drawing in a second tab and 'flatten' that to 2D.

One could script that.
InfoDistancePP.js is open source:
https://github.com/qcad/qcad/blob/maste ... tancePP.js
You could expand the resultMessage with the value from this.point1.getDistanceTo2D(this.point2)
And including dz analog to dx & dy.
A customized script with the same name will supersede the standard one.

Regards,
CVH

Re: Point to point distance 2D

Posted: Sun Jan 30, 2022 12:58 pm
by Anda
CVH wrote:
Sat Jan 29, 2022 11:04 pm
A customized script with the same name will supersede the standard one.
Wow, that's pretty awesome, didn't know that. I did as you suggested, and also added a checkbox to switch between 2D and 3D, seems to work well. Thanks!

(Only downer, did see source code indented with spaces. :cry:)

I guess something like this makes sense as a general feature, so I'll also create a ticket.

Re: Point to point distance 2D

Posted: Sun Jan 30, 2022 1:36 pm
by CVH
Anda,
Great, would you consider sharing your scripting endeavor?
https://qcad.org/rsforum/viewforum.php?f=30
Anda wrote:
Sun Jan 30, 2022 12:58 pm
(Only downer, did see source code indented with spaces.)
Don't understand exactly what you mean by that.
- Most QCAD scripts use 4 spaces over tabs.
- Space in the message make it more readable, no?

Regards,
CVH

Re: Point to point distance 2D

Posted: Mon Jan 31, 2022 4:45 pm
by Anda
CVH wrote:
Sun Jan 30, 2022 1:36 pm
Great, would you consider sharing your scripting endeavor?
https://qcad.org/rsforum/viewforum.php?f=30
Ok, did that, but I hope the feature request (https://www.qcad.org/bugtracker/index.p ... sk_id=2337) gets accepted, and a better version of these changes hopefully into the official version.
CVH wrote:
Sun Jan 30, 2022 1:36 pm
Anda wrote:
Sun Jan 30, 2022 12:58 pm
(Only downer, did see source code indented with spaces.)
Don't understand exactly what you mean by that.
- Most QCAD scripts use 4 spaces over tabs.
That's the point. It was just a bad joke referring to the spaces vs tabs war. (QCAD source seems to be all spaces, which I dislike very much. We shouldn't really get into that.)

Re: Point to point distance 2D

Posted: Mon Jan 31, 2022 5:01 pm
by CVH
Anda wrote:
Mon Jan 31, 2022 4:45 pm
That's the point. It was just a bad joke referring to the spaces vs tabs war.
I really don't mind, I even suppose that any kind of space is truncated when reading it.
Anda wrote:
Mon Jan 31, 2022 4:45 pm
and a better version of these changes ....
Have you some ideas in mind? :P

Regards,
CVH