Author Topic: Angle of Closed polylines elbows  (Read 359 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 764
Angle of Closed polylines elbows
« on: July 19, 2019, 06:54:45 AM »
Hello guys.
Hope you all doing well.

I am trying to get the angle of closed LWPolyline elbows, like 30,45,90 ... etc.
How to code such a routine?
Thank you.

Lee Mac

  • Seagull
  • Posts: 12254
  • London, England
Re: Angle of Closed polylines elbows
« Reply #1 on: July 19, 2019, 08:08:43 AM »
Find the first non-zero bulge value (DXF group 42), calculate the arctangent (atan), and multiply by 4.

This will give an answer in radians, which may be converted to degrees if necessary by dividing by pi and multiplying by 180.

Coder

  • Swamp Rat
  • Posts: 764
Re: Angle of Closed polylines elbows
« Reply #2 on: July 19, 2019, 08:26:49 AM »
Wow that's great.  :wink:

Can you please tell how does atan work and why to multiply with 4.0 and not another decimal number?

Thank you Lee for your kind help.

Coder

  • Swamp Rat
  • Posts: 764
Re: Angle of Closed polylines elbows
« Reply #3 on: July 19, 2019, 09:27:33 AM »
I got it.  :wink:

Thanks again.

MP

  • Seagull
  • Posts: 17399
Re: Angle of Closed polylines elbows
« Reply #4 on: July 19, 2019, 09:52:09 AM »
In addition to Lee’s most excellent guidance you may find this useful in your lisp journey: http://www.afralisp.net/autolisp/tutorials/polyline-bulges-part-1.php ...
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Coder

  • Swamp Rat
  • Posts: 764
Re: Angle of Closed polylines elbows
« Reply #5 on: July 19, 2019, 11:14:57 AM »
In addition to Lee’s most excellent guidance you may find this useful in your lisp journey: http://www.afralisp.net/autolisp/tutorials/polyline-bulges-part-1.php ...
Beautiful indeed.  8-)
Thank you for taking the time and post that informative link.

MP

  • Seagull
  • Posts: 17399
Re: Angle of Closed polylines elbows
« Reply #6 on: July 19, 2019, 02:10:35 PM »
My pleasure; cheers.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox