I want to split a closed polyline into two random part, with 15m distance. But the polyline imported from CAD isn’t working. However when i draw a polyline in RHINO it is working. Could anybody tell me why would this happen?

test-001.3dm (135.4 KB)

test-001.gh (13.5 KB)

i’m not exactly sure what’s supposed to be happening here but if you do this:

Explode the polyline then re-Join the segments prior to simplifying:

…it will then look like it’s doing something similar as the other polyline

1 Like

Wow! this works, thank you. I have tried SIMPLIFY before, but not with EXPLODE & JOIN.

i didn’t really check it out… the imported curve might have something slightly out of whack which is preventing Simplify from working on it without needing to do this explode/join workaround…

Using the Rhino _What command, you can see the following details:

  Geometry:
Valid curve.
Closed polyline with 16 points.
(2329.96,-9.47,0.00), (2336.96,-9.47,0.00), ..., (2329.96,-9.47,0.00)
domain = 0.00 to 16.00
Geometry UserData:
UserData ID: 3B7FB506-437C-431e-B1D7-93C4CBFF417F
Plug-in: Rhino
description: Gumball grip frame
saved in file: yes
copy count: 2


I think it’s only supposed to have 8 points. Digging deeper using the _List command we can see the following:

  Rhino object: curve
DEVELOPER DEBUGGING INFORMATION ONLY
Use the Rhino "What" command.
name: ""
id: D7A58418-3FB5-4f76-B590-7928299E8900
layer index: 9
render material index: -1 (from layer)
ON_PolylineCurve:  domain = [0,16]
point[ 0] = (2329.9633778843008, -9.4706503791327918, 0), 0
point[ 1] = (2336.9633778843008, -9.4706503791327918, 0), 1
point[ 2] = (2349.9633778843008, 3.5293496208672082, 0), 2
point[ 3] = (2349.9633778843008, 10.529349620867208, 0), 3
point[ 4] = (2349.9633778843008, 740.52934962086715, 0), 4
point[ 5] = (2349.9633778843008, 747.52934962086715, 0), 5
point[ 6] = (2336.9633778843008, 760.52934962086715, 0), 6
point[ 7] = (2329.9633778843008, 760.52934962086715, 0), 7
point[ 8] = (648.52030232315462, 760.52934962086715, 0), 8
point[ 9] = (641.52030232315451, 760.52934962086715, 0), 9
point[10] = (628.52030232315462, 747.52934962086715, 0), 10
point[11] = (628.52030232315462, 740.52934962086715, 0), 11
point[12] = (628.5203023231544, 10.529349620867208, 0), 12
point[13] = (628.5203023231544, 3.5293496208672082, 0), 13
point[14] = (641.52030232315451, -9.4706503791327918, 0), 14
point[15] = (648.5203023231544, -9.4706503791327918, 0), 15
point[16] = (2329.9633778843008, -9.4706503791327918, 0), 16


There’s little additional points next to all chamfered corners. You can also see that if you turn on control-points. This however should not have been a problem and it is fixed with the _SimplifyCrv command, as indeed does the Simplify component. One of the extra points is not removed, because it is also the curve seam point, i.e. it’s where the curve starts and ends and simplify doesn’t change that.

I think the problem is something else entirely. You are using numbers in your file that look like distances. Specifically you use the constant 15 twice. But then you use these numbers as curve parameters to shatter the curve. Parameters and lengths are not the same. Note that the What output above shows that your polyline has a domain from (0.0 \rightarrow 16.0). That is your parameter range. If you want to convert between parameters and lengths, you need to use the Evaluate Length component.

The reason Explode and Join have an effect is because you’re creating a brand new curve, and when Rhino creates new curves it will try and make the parameter domain and the curve length roughly the same. No guarantees though on them being exactly the same, and definitely no guarantees about the parameters increasing in a linear fashion along the curve. Never use parameters when you mean lengths.

1 Like

Thank you! Checking it out… seems I have a lot more to learn