How does RemoveShortSegments() work?

rhinocommon
unhandled

(shwdehaan) #1

I’m trying to remove short segments in a curve using rhinocommon’s RemoveShortSegements method.

This works well for some situations, but not for all, see attached example.

Can anyone explain how the method works, and why it is able to remove some short segments, and misses others?

RemoveShortSegments().gh (37.6 KB)


#2

forum_removeshort.gh (35.0 KB)

try dialing the slider in this.
just had to look out for what is returned from RemoveShortSegment()


(shwdehaan) #3

Thanks, but I don’t see what dialing the slider changes. If I set it to 6 for example, it neatly removes all segments shorter than 6mm, but I want to remove segments of 2mm.


#4

that’s because segments are defined a little differently
if you turn the recursive parameter to false on the explode component, you’ll see that some segments are actually two “segments”


not sure why but this is visually two segments but it is recognized as one by the RemoveShortSegments()
kinda makes sense. it looks like a generative error and should really be like the one to its left…


(shwdehaan) #5

Thanks again, but the part that you highlighted isn’t actually one exceeding the 2mm threshold. The part on the curve right below there is, and is not removed by RemoveShortSegments(). I wonder why!


#6

same. that short segment isn’t really a segment
image image
image
image


(shwdehaan) #7

In what way is it not? With recursive exploding set to true you still end up with that segment right?

Also, if you take the segment that you get with recursive exploding set to False, and remove short segments from thát segment, you still end up with the same short segment.