Converting curves to straight line segments

how to convert a closed curve into equal length straight lines. the vertices between lines all to lie on the source curve. the angle between lines can vary, as can the actual length; but i’d like the length of each straight line segment to be identical. ideally i’d like to be able to vary the number of the straight lines, and see what different lengths resulted. the source closed curve is a fix. using the ‘points along a curve’ technique does not work as it yields different length straight line elements depending on the local radius of the source curve.

Hi Nic- if you use Convert, with min and max lengths set the same and Angle at zero, it will do pretty well at making same length segments.


1 Like

Hey Pascal,
I can’t get convert to do this for me, I still get big variations in segment length with min and max set the same.
This seems like something for grasshopper, as it would be easier to show results with instant feedback with sliders.
Kind of a tricky one to solve manually. Maybe this is a good one for ArrayCurvePlus but I can’t get that plug in to work for me currently.

hi pascal,

many thanks for your thoughts. unfortunately i’m getting quite large variations in line segment length. i’m trying to establish a curtain wall geometry with identical size glazed units.


hi carvecream,

i’m pretty new to rhino, having been using microstation for many years. i could solve manually by tracking round with fixed length lines from one point to another, pivoting as i go, but would be unlikely to meet up neatly at the start. grasshopper looks incredibly powerful; but a big step up in learning. guess i’ll have to take the plunge…


Nic, RhinoScript has a built in function for this - DivideCurveEquidistant . Should be easy enough to implement as a script. Hang on a bit…

Try this -
DivideCurveEquidistant (2).zip (522 Bytes)

it’s a RhinoScript, but this is probably perfectly possible in Python as well. To use this script, unzip, then drag and drop it onto an open V5 Rhino, then use the ‘command’ (actually an alias that runs the script)


Does that do what you need?

Here’s a Python version - (559 Bytes)


hi pascal,

very many thanks; that script worked perfectly. a couple of iterations of length, and the beginning and end met precisely.

thanks again.


Hi Nic
Try the below python script. The red curve has the same length of the start curve.o
Ciao Vittorio

import rhinoscriptsyntax as rs
import scriptcontext as sc
def DivideCurveEq():    
    if sc.sticky.has_key("OldCrvDivLength"):
        oldLength = sc.sticky["OldCrvDivLength"]
    else: oldLength = 1    
    crv = rs.GetObject("Select a curve.",4, True)
    if not crv: return
    length = rs.GetReal("Set segment length",oldLength)    
    if not length: return
    sc.sticky["OldCrvDivLength"] = length
    np= len(points)
    while dist>dmax:
if __name__ == '__main__':

hi vittorio,

many thanks for offering up a solution. i ended up using the .py file that pascal sent through. i tried using yours as well because i noticed your version of the script was longer and thought it might have additional features. tried pasting your text into an .rtf file and re-suffixing it as .py but rhino didn’t seem to like it.

but thanks for your help.


Hi nic- here’s a slightly friendlier py script (lets you set the length while curve selection is happening, instead of sequentially). I suppose multi curve selection would be the next thing, right? (1.5 KB)


Hi Nic
you must use the command EditPythonScript, copy and paste the file in the editor and save the file with a name
Ciao Vittorio

Thanks Pascal! Very handy.

hi vittorio

yes, that worked really well; and it adjusts the length to fit the source curve exactly, perfect.

very many thanks for your help.