From a no-Arc, segmented, SHP polyline, to a new polyline with curves

When importing Shapefiles to C3D there are no Arcs in Polylines. Arcs, don’t work in SHP files, SHP was not made for it. But, when working with alignments, cable-lines and more, we like to have them in our drawings.

Polylines with segmented arcs:

  • Have segments with the same lengths (with some tolerance) and their angle different.
  • When S shaped (2 arcs), the start segment of the 2nd and the end segment of the 1st arc have the same length and angle.
  • Sometimes the centerline comes through DWG and there might be some arcs in it.

With this information I created this probably way to big script. It doesn’t always work, specially with rly small arcs and lengths (overkill or weed might be needed). But it creates new lines for me in most cases.

It can be made smaller, combine certain node-groups, but this gives me the power to check certain steps a little easier.

Todays polyline (coming from SHP) started out with 963 vertices,we ended up with 324 and it generated 112 arcs. Yes, there is a small change in the length, always check and re-check (!).

Anyway, wanted to share. Enjoy.

line to arc V1_tolerance on length.dyn (286.3 KB)

2 Likes

I’m probably missing something but have you tried this with MAPCLEAN?

You can convert straight lines in polylines to arcs by adding ‘Simplify Objects’ action with the required tolerance and ‘Create arcs’ ticked

1 Like

Oh no, the Simplify Objects is there and can be quite helpful. Just not in all cases. I run in to multiple missing arcs, arcs still split up in several arcs, or to much deviation from the original line. So, I started creating something working for me.

2 Likes

Ah OK. Nice work, thanks for sharing it.