Linetype "anomaly" with splines

@dale, @lowell, @pascal, @Helvetosaur,

i’ve encountered the same and need to convert linetypes into curve segments using python with Rhino 5 and 6. While i’ve looked at the script Mitch posted, i’ve found cases where i am lost to understand the logic using pattern length, line type scale, segment length etc. to reconstruct the split parameters required to get the proper curve segments.

Would it be possible to share the logic how line type patterns are applied or provide an example how to compute the split parameters ? I’ll attach a 3dm file where i thought i understood the logic partially.

DefaultLineTypes.3dm (66.7 KB)

In this file each default line type is assigned to a green line. If the pattern overshoots the line length at a segment (red arrow), it seems it sets back the whole pattern by half it’s total length (shown in blue) and then assigns it to the curve. So the pattern is overlayed somehow from the midpoint of the curve or curve segment. The points in the file mark the pattern length.

However, if i look at the line type named “Border”, this rule does not apply. It has a segment at start which does not match its definition which is:

4.00, 1.00, 4.00, 1.00, 1.00, 1.00

The first segment of the pattern in Rhino’s display has a length of 7. Is there a logic behind which you could post to enlighten me ?

thanks,
c.