How to Align length of single segments in polyline

Hello
My first time here.
I have a rather trivial problem, but still it is one that complicates things a lot :slight_smile:

Is there any way to Align lenghts of all single segments in drawn polyline, so i.e. they won’t be shorter than 0.8mm.
Much in the same way as AlignMeshVerticles works.

Thanks in advance.

Hi Michal - so, the goal is to take an existing polyline and change the vertex locations so that no segment is shorter than some number? Do you have an example?

-Pascal

Sorry for late response from my side, I’m quite busy at work right now. But also thank you very much for taking interest in my problem :slight_smile: I exacly want to achieve what you described :slight_smile:

000_2D.3dm (58.2 KB)

Above you can find my example file.
Thanks for help in advance.

Hi Michal - I do not see a good way to do this with any guarantee that the shape will not change too much if the points are to be moved but it seems reasonable to figure out a way to remove points to eliminate short segments - would that be OK?

@michal.sowa - see if this python helps at all -

CullShortSegments.py (1.2 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

That would be just the thing I need :slight_smile:

Hi @michal.sowa,

You only have five segments less than 0.8mm, so easily cleaned up manually.

To find the short lengths, copy the polylines to a new layer with a contrasting colour and explode it. Hide your original layer. Use @Helvetosaur’s SelCrvsByLength script from WISH: Select By Length to identify the short curves (invert the resulting selection and delete so you can see the wood for the trees).

Jeremy

p.s. You have a polyline that crosses itself near the top of your object.

For this you can also use Rhino’s native SelShortCrv command…

1 Like

Yet another command I didn’t know. So many commands, so little time… Thanks

Hi Michal - script, that might help, added above…

-Pascal

Thank you Pascal.

Python script works very well, and solves my issue.