Author Topic: How to determine a point is on the left of right of Pline  (Read 1128 times)

0 Members and 1 Guest are viewing this topic.

donwynne

  • Mosquito
  • Posts: 1
How to determine a point is on the left of right of Pline
« on: March 24, 2022, 02:25:09 AM »
I have a Point (PT1) and a Pline, always exist a Line accross PT1 and perpendicular with Pline
How to know a Point is on the left or Right of Pline by autolisp?
Please help.
Thank all.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: How to determine a point is on the left of right of Pline
« Reply #1 on: March 24, 2022, 05:49:53 PM »
I have some code to share but I cannot post a reply with it included until you have made a few more posts.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: How to determine a point is on the left of right of Pline
« Reply #3 on: March 25, 2022, 11:51:09 AM »
FYI, both of the methods offered in the link VovKa provided fail to work correctly when the polyline segment and pt are near the X-axis 0/360 angle or if the polyline segment is an arc.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: How to determine a point is on the left of right of Pline
« Reply #4 on: March 25, 2022, 01:22:58 PM »
FYI, both of the methods offered in the link VovKa provided fail to work correctly when the polyline segment and pt are near the X-axis 0/360 angle or if the polyline segment is an arc.

Haven't tested, but should be OK - based on provided link...

Code - Auto/Visual Lisp: [Select]
  1. (defun c:pt-curve-side ( / pt ent )
  2.  
  3.  
  4.   (setq pt  (trans (getpoint "\nPoint : ") 1 0)
  5.         ent (car (entsel "\nCurve : "))
  6.   )
  7.  
  8.     (prompt "\nPoint is on left side of picked curve...")
  9.     (prompt "\nPoint is on right side of picked curve...")
  10.   )
  11.   (princ)
  12. )
  13.  
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube