Author Topic: find the unknown point on a polyline  (Read 1269 times)

0 Members and 1 Guest are viewing this topic.

civil.eng

  • Newt
  • Posts: 66
find the unknown point on a polyline
« on: July 23, 2023, 05:47:05 AM »
Hello everyone,
Suppose we have 3 given data including the start point and second point on a polyline and also an area which is specified by the user. Now we want to find the third point on the polyline which creates the area based on the first point. In this image the p1 is the start point, p2 is the second point and the area is the desired area of a user (for example: 250 m2), based on these items we should find the third point (Red point).

Do you think it's possible ?
« Last Edit: July 23, 2023, 09:16:30 AM by civil.eng »

d2010

  • Bull Frog
  • Posts: 326
Re: find the unknown point on a polyline
« Reply #1 on: July 23, 2023, 01:34:23 PM »
In my country, EuroepeEast,  the firmware develope AreaDecrypt, in 100%autolisp.
Please you search TopoLT@Cadware.com , this program calculate AreaDivide .
Believe me the TopoLT via vlisp is one the top.

If you need a demo inside Drawing.dwg of powerfull TOPOLT.lisp from autolispR2000
 then you send a drawing.dwg for autocad2010 to  my PM not online.




« Last Edit: July 23, 2023, 01:37:57 PM by d2010 »

civil.eng

  • Newt
  • Posts: 66
Re: find the unknown point on a polyline
« Reply #2 on: July 23, 2023, 04:22:54 PM »
I searched, but TopoLT is an Autocad plugin and not AutoLisp.

Could you find the third point on the polygon which creates Area = 300 m2 via your Lisp ?
« Last Edit: July 23, 2023, 05:46:00 PM by civil.eng »

BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: find the unknown point on a polyline
« Reply #3 on: July 23, 2023, 07:44:02 PM »
This is land property development, there are multiple options normally available, I used Civil software that has those features built in.

You want swing bearing.
Another is parallel line.
From frontage.
Plus others.

For swing bearing its simple in your example get area of the guess, if to big rotate the line smaller, if to small rotate the line bigger, once within a tolerance stop. You use a very small angle change as the step size. Try Googling Area by Line Autocad Lisp pretty sure it exists.
A man who never made a mistake never made anything

civil.eng

  • Newt
  • Posts: 66
Re: find the unknown point on a polyline
« Reply #4 on: July 24, 2023, 07:55:24 AM »
Thank you Bigal,
The important part is step size for angle, it will take a long time to check every small degree. Is there any algorytm to get results fast ?
I mean any way to guess the degree and so decrease the loop.

hmspe

  • Bull Frog
  • Posts: 367
Re: find the unknown point on a polyline
« Reply #5 on: July 24, 2023, 04:29:51 PM »
Start with an angle from P2 to the lower right vertex.  That will give an area that is too small.  Increase the angle by 1 degree intervals until the area exceeds your target.  Decrease the angle by 0.1 degree intervals until the area is too small.  Increase the angle by 0.01 degree until the area is too large.  Etc.  Stop when the area is within your tolerance.   
"Science is the belief in the ignorance of experts." - Richard Feynman

Lastknownuser

  • Newt
  • Posts: 29
Re: find the unknown point on a polyline
« Reply #6 on: July 25, 2023, 06:49:01 AM »
As said, you need to create while loop where you are rotating xline for example until you get wanted area within defined tolerance. And yes like you said, the tricky part is angle step size, but you can define conditions for optimal running. In each loop you will check if result has been reached, if its not you will know the difference between current and needed area, and depending on that you can increase the rotation angle. In simpler words, as difference in area is decreasing you decrease rotation angle, so you don't have too many iterations.

I have done something like that for my company. I attached image with point where area is 300 m2 if it still interests you.