Page 1 of 1

Bearing and Azimuth

Posted: Fri Jan 28, 2022 11:59 pm
by gmpowell71
Hello,

I posted this in the introduction section. It's a script that calculates Bearing and Azimuth between two points.

I'm working towards being a surveyor so this is extremely helpful when laying things out.

I just wish I had the knowledge to refine it more and make it similar to an aligned dimension tool. Maybe someone else can take it further. Enjoy!

Re: Bearing and Azimuth

Posted: Sun Jan 30, 2022 9:14 pm
by andrew
Thank you for your contribution.

Can this be added to the QCAD repository and future QCAD and QCAD Professional releases?

If so, it would be added under Misc > Information > Bearing / Azimuth.

How would you like to be credited in the Help > About dialog? As "gmpowell71" or with a real name or another pseudonym? Thanks!

Re: Bearing and Azimuth

Posted: Sun Jan 30, 2022 11:32 pm
by CVH
gmpowell71 wrote:
Fri Jan 28, 2022 11:59 pm
I just wish I had the knowledge to refine it more and make it similar to an aligned dimension tool.
Could you explain this further?
It now adds a message to the Command History. It doesn't add the line because that is ruled out on line 154.
In fact, getOperation returns an empty operation named 'op'.

With an aligned dimension you would add a dimension with extension lines having a measured value.
One could replace the displayed value with the same text of the message ... What is rather long.
Still, it troubles me as the extensions don't necessarily indicate the picked points ... :?

What about casting the line and adding 4 custom properties to the line entity?
One for each value: Delta X, Delta Y, Bearing, Azimuth
BearingAzimuth.png
BearingAzimuth.png (3.33 KiB) Viewed 8319 times

Now that Andrew proposed to include it as a Misc Info tool ...
... I think more in the direction of the Distance Point to Point (IP) behavior, but without the ticks :wink:.
Basically a Line from 2 Points (LI)

Regards,
CVH

Re: Bearing and Azimuth

Posted: Mon Jan 31, 2022 8:24 pm
by gmpowell71
andrew wrote:
Sun Jan 30, 2022 9:14 pm
Thank you for your contribution.

Can this be added to the QCAD repository and future QCAD and QCAD Professional releases?

If so, it would be added under Misc > Information > Bearing / Azimuth.

How would you like to be credited in the Help > About dialog? As "gmpowell71" or with a real name or another pseudonym? Thanks!
Yes sir. Go for it! Sure gmpowell71 would be fine with me. I surely appreciate you guys taking this to the next level.

Re: Bearing and Azimuth

Posted: Mon Jan 31, 2022 8:32 pm
by gmpowell71
CVH wrote:
Sun Jan 30, 2022 11:32 pm
gmpowell71 wrote:
Fri Jan 28, 2022 11:59 pm
I just wish I had the knowledge to refine it more and make it similar to an aligned dimension tool.
Could you explain this further?
It now adds a message to the Command History. It doesn't add the line because that is ruled out on line 154.
In fact, getOperation returns an empty operation named 'op'.

With an aligned dimension you would add a dimension with extension lines having a measured value.
One could replace the displayed value with the same text of the message ... What is rather long.
Still, it troubles me as the extensions don't necessarily indicate the picked points ... :?

What about casting the line and adding 4 custom properties to the line entity?
One for each value: Delta X, Delta Y, Bearing, Azimuth
BearingAzimuth.png


Now that Andrew proposed to include it as a Misc Info tool ...
... I think more in the direction of the Distance Point to Point (IP) behavior, but without the ticks :wink:.
Basically a Line from 2 Points (LI)

Regards,
CVH
Honestly, I have no idea what I'm doing! I'm familiar with coding but event based coding is new, really new to me. I played with the script a little more over the weekend to refine the output. Attached is the update.

Whatever you come up with is fine with me. I'm just the kid in the candy store if I can use a metaphor.

What would be really awesome is if at the click of a button every point to point line in a drawing would receive their bearing or azimuth or all the lines in a selection window or something like that. Just dreaming I guess.

Thanks again, you guys are awesome!

Re: Bearing and Azimuth

Posted: Tue Feb 01, 2022 9:16 am
by CVH
gmpowell71 wrote:
Mon Jan 31, 2022 8:32 pm
I played with the script a little more over the weekend to refine the output. Attached is the update.
Great, I was already wondering why the cardinal directions were missing.
Pitty that Andrew didn't pick that up:
https://github.com/qcad/qcad/commit/abc ... 970c377fb5
https://github.com/qcad/qcad/commit/08a ... 5560172430
For the next release it is included under Misc .. Information :)
gmpowell71 wrote:
Mon Jan 31, 2022 8:32 pm
I'm just the kid in the candy store if I can use a metaphor.
Have a look at the PM (Private messages) with some refinements/explanations I'll send to you. :wink:

Regards,
CVH

Re: Bearing and Azimuth

Posted: Tue Feb 01, 2022 11:30 am
by andrew
gmpowell71: Thanks for the update.

Your script now lives in our git repository at:
https://github.com/qcad/qcad/blob/maste ... Bearing.js

Note that I've made some adjustments (class name, menu location, menu order, change user prompts from corner to reference and direction, etc.) to blend in with the other scripts. You might want to download that version to build on that.

Feel free to submit changes directly to github if you are comfortable with that. You can do that with git or directly in your browser using the Edit button on the page above (you'll need a github account for that).

Re: Bearing and Azimuth

Posted: Wed Feb 02, 2022 11:07 pm
by Nigel
New Bearing and Axzimuth tool:
Congratulations on your thoughtful work in developing this tool!
As I cheer you on from the sidelines as you drive by, I hope that on planning completion for the 'next release' you will be including some guidelines on how to use the tool and the options available within it. As you develop the tool the "tool team' is the best ones to explain its functions and limitations. Learning to drive by trial and error is an expensive and dangerous way to learn! An explanation could be part of this Forum but better if part of the manual I am sure most would agree.
Additionally, gauging the popularity of a tool is difficult if there is no explanation, and a steep learning curve is required to learn how to use it. Then disappointingly finding the tool or program does not do what you hoped, as I am sure we have all experienced. A tool may be more popular if easy to learn.
Regards, Nigel

Re: Bearing and Azimuth

Posted: Thu Feb 03, 2022 8:22 am
by CVH
Nigel,
There is not much to it ... it's a from point - to point script.
Only, the reported values differ from e.g. Info .. Distance Point to Point (IP).
Mostly because CAD is based on Euclidean geometry where degrees are measured CCW and zero degrees is equal to East. :wink:
https://www.e-education.psu.edu/natureo ... c5_p7.html

Also read this:
https://qcad.org/rsforum/viewtopic.php? ... isc#p36005

Regards,
CVH