Jump to content

Recommended Posts

Posted
On 10/20/2025 at 12:25 PM, PGia said:

Hi again.

This may also happen to others: sometimes I have two polylines and I need to get something like a common parallel to both. A sort of hybrid parallel from the original two.

Is it possible that this topic has been discussed in the history of this forum and there is a LISP to solve this problem?

 

Thanks in advance.

 

I guess the solution is to programme how you currently do this - what is your manual method?

 

As for a solution, haven't looked how SLW210 does his but might expand MHUPP to use both polylines and find the mid points using all verticies.

  • Like 1
Posted

I guess you could do like

(setq i (+ i 0.01)) 16 vertex poly would then create a 1600 vertex poly

 

And then run overkill on the created polyline to remove all collinear vertexes.

  • Like 1
  • Agree 1
  • Thanks 1
Posted (edited)
2 hours ago, Steven P said:

 

I guess the solution is to programme how you currently do this - what is your manual method?

 

As for a solution, haven't looked how SLW210 does his but might expand MHUPP to use both polylines and find the mid points using all verticies.

 

Basically I try to draw a polyline equidistant to the reference lines.

To do this, I draw perpendiculars from each point of each polyline to the closest segment of the other. Sometimes several points are concentrated in one of the polylines while in the other polyline there is only one long segment. In these cases, I draw all the perpendiculars that intersect that long segment, but for the last point, I already draw a line to the end of the long segment. When the perpendicular from a point goes to the next segment to which the previous ones were in the opposite polyline, then the perpendiculars must continue being made from the opposite polyline.

I suppose it is a bit complicated to explain and understand, so I attach images of what I mean.

img2.thumb.gif.4a80fefb2f3ff34847e21b65ec9d8483.gifimg3.thumb.gif.5e529eddc09be49c8e6f9f6ff4efcc43.gif

 

 

My method isn't perfect, but it's pretty close.

I thought there would be a better method, one that would be more geometrically rigorous than mine.

 

As for Lee Mac's code, I must thank him for sharing his knowledge and his great code 🙂 I've tested it, and the result is pretty close to what the true axis between the two polylines should be. But it still deviates in the pivot areas. Also, the result varies depending on the order in which the polylines are selected, and this isn't good. A robust method should produce the same result in both cases.

 

My idea was that it should be possible to obtain an axis in which any perpendicular to it is equidistant from the reference polylines.

 

But I'm starting to think this isn't so easy.

img1.gif

Edited by PGia
Posted

Can you post a drawing with your manual center line?

 

I always pick in the same direction, never noticed the line was different if selection reversed, I'll see if I can find out why.

 

Your examples are much more extreme than anything I would have, could you say what those are and how they are generated?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...