Jump to content
Developer Wiki and Function Reference Links ×

Script to isolate or select outermost line work


Recommended Posts

I often only want the outer lines of a given 2D object that I've imported., e.g. this set of roof line work where I only want the outer roofline.

 

I realise a lot of these lines cross into the inner space (and I'll need to trim them) but just getting the outer ones in a selection would remove a tedious small repeted action.

 

I want to do this with drawn elements, and items like surveyor's TINS, and also the jumble of objects that results from exploding .pdfs (where there is normally only a single layer in the drawing).

VW script to isolate or select outermost line work Q.JPG

Link to comment

Have you tried the outer boundary mode of the polygon tool?

 

Otherwise, you’re interested in a concave hull algorithm. You may be able to find some existing python examples, but I don’t think you’ll find a simple code snippet that someone can provide. 

  • Like 1
Link to comment

Thanks, I didn't know of Outer Boundary tool - It doesn't work for this, BUT it does do something else very useful  - making quick polygons from unjoined lines:

 

Even a concave gull algo may have issues (tho' I'm far from an expert) as there are self interesting lines in my case.

 

 

Link to comment

Thanks Joshua, that's a very useful workflow - basically a flood fill but but for loose vectors.

 

I just drew a box round my various lines (they do have to be touching or crossing and form a hull / continuous closed object), and then did;

2D Tool plus Inner Boundary Mode and;

Ungroup and deleted my outer rectangle

 

No more messing around with dozens of lines/

 

isolate or select outermost line work.JPG

Link to comment

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
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...