Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Close

Visual LISP, AutoLISP and General Customization

- Autodesk Community
- >
- AutoCAD Customization
- >
- Visual LISP, AutoLISP and General Customization
- >
- Self-intersecting Polyline/Spline: find both Param...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

601 Views, 2 Replies

01-21-2013 10:54 AM

[I did a Search for threads about self-intersecting things, but didn't find this question raised.]

See the attached image. I'm trying to find a way to identify *both* Parameter or *both* Distance values, not just one, along a self-intersecting Polyline or Spline at its point of self-intersection. Given that intersection as the 'point' argument, the (vlax-curve-get...AtPoint) functions "see" [or at least *return*] only the *first* (i.e. numerically lower) value, for either Parameter or Distance along the object. Maybe there's some function that can find them both, that I'm not aware of, or that I haven't realized would be applicable. Either both Parameters or both Distances would do -- I wouldn't need both kinds.

The image shows *closed* objects, but the same applies if they're open-ended.

Some related information follows, in case it helps find an answer. [The first two bracketed items are *incidental* to the question, which really comes *after* the self-intersection point has been defined, but I include them just in case.]

[For a self-intersecting Polyline, (vla-intersectwith...) finds all vertices (not including ends if it's open), in addition to the self-intersection point. That point can be isolated by comparing the results to a list of the vertices, but *not* if there happens to be a vertex *at* the self-intersection point. So it's more reliable to ask the User to pick it, and use INTersection object snap.]

[For a Spline, INTersection object snap does *not* recognize the self-intersection point! So the User can't pick it, but it can be found using (vla-intersectwith...), giving it the same object twice. It's "cleaner" than for a Polyline, in that it returns only the *one* self-intersection point, not any of the fit points or control points.]

For a Polyline, if the "B" portion/segment is a *line* segment, it seems possible to calculate the value along that segment, if there's nothing that will simply return it. It would require determining *on which segment* the self-intersection point falls, probably by looking for a pair of adjacent vertices for which the direction from the first to the intersection is the same as that from the intersection to the second. Then the proportional Parameter or Distance value could be calculated with a few (distance) functions and a division. But again, that depends on the intersection being in the middle of a segment, not *at* a vertex.

For a Polyline, if the "B" portion/segment is an *arc* segment [as in the attached image], there may be some way to calculate the values, but even just determining *on which segment* the self-intersection point falls looks like it would be pretty tricky, and once that's determined, calculating the proportional values would also be far more challenging than for a line segment, but might be possible.

I suppose it would be possible, and might be necessary, to *reverse* the object [I have a routine to do that], get the value at the self-intersection point for the reversed version, and subtract that from the value for the overall original object. But I'd rather not go through that if there's a more direct way. And for some Splines [those without fit points, e.g. one that's been Broken], I believe a reversal can only be approximated, so there would be some loss of precision [though maybe not enough to matter to what the result would be used for].

So far, for Polylines I've only been thinking in terms of *Lightweight* ones. I'm hoping that if there's a solution for those, it will also be applicable to, or adjustable to apply to, "heavy" 2D and 3D Polylines, but that's further down the road. And I haven't thought about any complications regarding such things as different coordinate systems yet, either.

Kent Cooper

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-21-2013 11:38 PM in reply to:
Kent1Cooper

Maybe this topic can help you...

http://www.theswamp.org/index.php?topic=28438.msg3

M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-22-2013 05:49 AM in reply to:
marko_ribar

marko_ribar wrote:Maybe this topic can help you...

....

Thank you -- that looks promising. It will take a little time to absorb and compare, but I'll delve into it.

Kent Cooper

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements

Start with some of our most frequented solutions to get help installing your software.

Upgrading to a 2015 product? Make sure to check these out 1st!

- Privacy | Legal Notices & Trademarks | Report Noncompliance | Site map | © Copyright 2014 Autodesk Inc. All rights reserved

Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Please see the Autodesk Creative Commons FAQ for more information.