Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

reduce nodes in a polyline?

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Anonymous
18059 Views, 11 Replies

reduce nodes in a polyline?

ok. so a client provided a drawing and we convert them into dxf's so that our industrial machines can translate them into programs. the problem with this polyline is that it is made of over 4000 lines which is too many "nodes" for our machine to handle. normally what i would do, is re draw this which takes up a chunk of my valuable time. we just absorbed another company and are taking on all of their business so time is precious. any ideas on how to make this polyline have less nodes? also, our machines will only recognize CLOSED POLYLINES. nothing 3d or any splines. Please help me!!

 

FILE IS ATTACHED. 

11 REPLIES 11
Message 2 of 12
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> how to make this polyline have less nodes?

Question back: can you define a rule which of the vertices are not important?

 

You can write tools to remove vertices, but saying reduce the vertices also means your geometry is not the same anymore. And when you are feeding your machines with less detailed data you'll get objects with less accuracy.

 

>> which is too many "nodes" for our machine to handle

I'm always wondering why (in the digital area) a number of 4000 or so is an issue, but what is the maximum number of points your machine can handle?

+ can your system work with arcs in polylines?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 12
R.Gerritsen4967
in reply to: Anonymous

Hi drewpeacock44,

 

I have recently made a .net program to simplify polylines with many points by setting a maximum deviation from the original polyline. I have used this to simplify your polyline.

 

Please find attached a file with your cog simplified from 4025 points to 1599 or even 401 points.

It looks like your file is already a simplification of a polyline with arc segments. This means some precision was already lost in that translation. I have set my program to 0.0005 and 0.005 inches deviation from your original to reduce the amount of points.

It is up to you to decide if this deviation from the original cog is acceptable.

 

I hope this helps.

Message 4 of 12
Kent1Cooper
in reply to: Anonymous

Check out PLDIET.lsp, available here.

Kent Cooper, AIA
Message 5 of 12

@Kent1Cooper,

 

I'm not sure if this LISP will work in this particular case.

According to your website, the LISP will delete extra vertices on collinear segments. In this case there are very few colinear segments as far as I can see.

Straightening of arc segments is also not applicable in this case. From the file it looks like this was already done before it was sent to drewpeacock44.

Message 6 of 12


@R.Gerritsen4967 wrote:

 

... 

I'm not sure if this LISP will work in this particular case.

According to your website, the LISP will delete extra vertices on collinear segments. In this case there are very few colinear segments ....


It certainly will.  It will delete extra vertices between collinear segments in addition to reducing the number otherwise.  The point in mentioning collinear straightening in their comments [their website, not mine] was the "regardless of distance" aspect -- it is not limited in collinear stretches by the limitation you put on the maximum non-collinear distance between vertices to straighten.

 

I used it on their sample drawing, using 0.1 as the maximum distance to straighten and keeping the default 15-degree-bend limitation, and it reduced the number of vertices from 4025 to 1175.  Using 0.25 for the maximum distance to straighten reduced it to 476, and using 0.5 to 326, but at that point it's starting to look noticeably kinked.  @Anonymous, you can experiment with different bend-angle limitations as well as different maximum distances, to get the best result for your purposes.

Kent Cooper, AIA
Message 7 of 12
Anonymous
in reply to: Anonymous

Perhaps check our app CLEANVECT we posted on the Autodesk Exchange App Store. It /may be of use for this. Also we have some Join and some Boundary apps to convert to outlines to make more compatible with manufacturing.

 

Link: https://apps.autodesk.com/ACD/en/Detail/Index?id=4697472511467238968&appLang=en&os=Win32_64

 

-CDS

 

 

 

Message 8 of 12
Anonymous
in reply to: Anonymous

couldn't get the cleanvect to install on my machine. I have w10.

Message 9 of 12
Anonymous
in reply to: R.Gerritsen4967

Hi R.Gerritsen4967,

 

I have recently made a .net program to simplify polylines with many points by setting a maximum deviation from the original polyline. I have used this to simplify your polyline.

 

Could you please share .Net code? I'm looking for exact realization and for the moment found only Lisp realization for such functionality.

 

Regards,

Roman

Message 10 of 12
R.Gerritsen4967
in reply to: Anonymous

Hello @Anonymous ,

I used this link as a starting point:

https://forums.autodesk.com/t5/net/simplify-polyline/m-p/6218460/highlight/true?nobounce#M47907

 

For my own program I modified this a bit, but the most important part was found in the above link.

Message 11 of 12
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

Check out PLDIET.lsp.....


... updated >here<.

Kent Cooper, AIA
Message 12 of 12
Anonymous
in reply to: Kent1Cooper

Greetings,

 

We have a few Apps that will do this plus more but one in particular is our CLEANVECT app. See the app program here -> https://apps.autodesk.com/ACD/en/Detail/Index?id=4697472511467238968&appLang=en&os=Win32_64

 

Geoff Sylvester

CAD Design Software

San Jose, CA 95132

Tags (1)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta