Garbage cleaning

Hi all,

see attached 3dm file.
The curves look fine, but they are all degree 1 and much too many:
Garbage.3dm (492.1 KB)

The only chance I see is a manual selecting, joining, degree changing, rebuilding.
As with the red egg-shaped contour.

This is very cumbersome.
Is there a smarter way?

It would help if there were a selection tool which traces such contours with respecting an angle deviation to the next element, similar to the selection chain.

Thanks,
-C-H-A-R-L-E-S-

Hey Charles,

I think FitCrv will do this, you can put in a break angle setting… Join everything and try an angle of 25 or so…

–Mitch

Hi Charles - you need each roundy part separately from the sort of base curve, I guess you can work with SelChain, Direction=Both, Continuity=Tangency AngleTolerance=5, then Join, Rebuild. I don’t see any need for ChangeDegree, if I follow. e.g.

_SelChain _Direction=_Both _Continuity=_Tangency _AngleTolerance=20 _Pause _Enter
_Join _-Rebuild _PointCount=21 _Degree=3 _DeleteInput=Yes _Enter

But there are some ugly overlapping near duplicate segments in this mess so it may not always work with the chain selection without some user input.

-Pascal

Hi Mitch,
I forgot about _FitCrv, it never worked as expected for me.
Same in this case, it results in some fever curves, regardless what parameters.

Hi Pascal,
right, _ChangeDegree is superflous.
The SelChain works pretty good, and even better when I scale the geometry by 10 before.

I guess there is no way to clean such a mess fully automatic, or?

Thanks to both of you for the advice.

-C-H-A-R-L-E-S-

Yeah, it never worked very well on polylines…

I found an old script that rebuilds polylines but keeps corners sharper than a certain angle. You have to play with it a bit - in the attached I first made a copy of the original for comparison, and made the red segment back into a polyline and joined everything into one (the script only works on polylines). Then I ran the script a few times and found that it works OK with an angle of 25 and a point reduction factor of 0.25. There are still a couple of spots to adjust after.

Anyway, FWIW…

–Mitch

GIGO-1.3dm (139.8 KB)

RebuildPLBetweenCorners.rvb (3.7 KB)

Hi Mitch,

wow, that works surpring well!
It is nearly fully automatic, far better than the knot reduction tools in illustration programs.

Sure, there will be no way around it.

Many thanks, this helps a lot.

-C-H-A-R-L-E-S-