# How to model a curve with a constantly changing curvature

Hi guys,

I would like to model a curve which has a constant change of radius over a certain arc
length.

The idea would be to have the “motion path” of a car driving at a constant speed and the
driver changing the steering wheel from “straight” to fully turned. (turning
the wheel at a constant rate).

I tried to create it through a python script by letting it grow through connecting arc
segments, but the result is not a constant curve – it has radi jumps all over
the place.

I’m trying to solve this in code, because I would need to check several variations.

Does anyone have an idea how to model this kind of curve in Rhino Manually / and or create it
through code?

Thanks,
Karl

Does the “_Spiral” command give you what you want?

an ellipse?

i’m 100% sure there’s a better approach to this than the following but…
your question made me want to script a method which i’ve used to draw this type of curve onsite before…

that being… put a circular object (bucket) on the ground… hold a pencil at desired length along a string (electrical cord) then draw the curve… as the string goes around the bucket, the radius constantly shortens…

(well the centerpoint shifts too… so not what your asking it to do anyway)

``````import rhinoscriptsyntax as rs
import math

def bucket_and_string():

inner = rs.GetReal('Radius of inner circle', 10)
if not inner: return

if not start: return

line = rs.AddLine((inner, 0, 0), (inner, start, 0))
startlength = rs.CurveLength(line)
points = [(inner, start, 0)]

for i in range(1, 72):

arclength = inner * angle

if startlength - arclength < 0:
break

rotatedline = rs.RotateObject(line, (0, 0, 0), i * 5, None, True)
rs.ExtendCurveLength(rotatedline, 0, 1, -arclength)
pt = rs.CurveEndPoint(rotatedline)
points.append(pt)

bucket_and_string()
``````

EDIT:

here’s one which will rotate a radius 5º and shorten it each time.

``````import rhinoscriptsyntax as rs

# parameters
a = 50  # starting radius
b = -1  # increment in which the radius will shrink (or grow) per rotation

line = rs.AddLine((0, 0, 0), (0, a, 0))

points = [rs.CurveEndPoint(line)]

for i in range(1, 50):
line = rs.RotateObject(line, (0, 0, 0), 5, None, True)
rs.ExtendCurveLength(line, 0, 1, b)
if rs.CurveLength(line) < 0:
break

points.append(rs.CurveEndPoint(line))