DesignScript

## DesignScript

Member
Posts: 5
Registered: ‎10-20-2012
Message 1 of 5 (848 Views)

# Create Catenary Curves with DesignScript?

848 Views, 4 Replies
10-20-2012 01:16 PM

I have a funicular fireplace design that I created using Rhino Grasshopper.

The design and the Grasshopper definition screen capture are attached. Grasshopper has a catenary curve component that creates a spline curve in Rhino. All you need is two points and a number slider to drive the length of the curve.

The baked geometry that I created in Rhino was subsequently imported into AutoCAD where I solid modeled the fireplace and rendered it.

How would you tackle this same design problem with DesignScript?

Thanks.

*Expert Elite*
Posts: 1,981
Registered: ‎04-29-2006
Message 2 of 5 (816 Views)

# Re : Create Catenary Curves with DesignScript?

10-21-2012 05:57 AM in reply to: mark

Hi,

I do not know Grasshopper, but may be this to start with DesignScript:

```import("ProtoGeometry.dll");

numPts = 17;

def parabola(width : double, height : double)
{
a = -4 * height / (width * width);
x = width / -2..width / 2..#numPts;
y = 0;
z = a * x * x + height;
return = BSplineCurve.ByPoints(Point.ByCoordinates(x, y, z));
}

spl1 = parabola(10, 6);
spl2 = parabola(12, 8);```

Gilles Chanteau
Member
Posts: 5
Registered: ‎10-20-2012
Message 3 of 5 (791 Views)

# Re : Create Catenary Curves with DesignScript?

10-22-2012 10:47 AM in reply to: _gile

Hi _gile,

Thank you for your quick response!

I ran your script and the results are attached. This is a very nice approximation of my fireplace geometry.

The reason I say approximation is because a parabola is visually very similar to a catenary but mathematically very different. The catenary also has a very important structural attribute in that it creates a compression only arch that is structurally stable. This is not true of a parabola. Here's more information about the differences.

http://mathforum.org/library/drmath/view/65729.html

http://en.wikipedia.org/wiki/Catenary

Please add the catenary curve to the geometry library so that you can use DesignScript for funicular form finding.

Thanks.

*Expert Elite*
Posts: 1,981
Registered: ‎04-29-2006
Message 4 of 5 (777 Views)

# Re : Re : Create Catenary Curves with DesignScript?

10-22-2012 01:48 PM in reply to: mark

This one  draws a true catenary curve.

You'd have to play with the param argument to find the height that suits you according to a given width.

```import("ProtoGeometry.dll");
import("Math.dll");

def catenary(width : double, param : double)
{
height = param * Math.Cosh(width / (2 * param));
x = width / -2..width / 2..#17;
y = 0;
z = param * Math.Cosh(x / param) - height;
return = BSplineCurve.ByPoints(Point.ByCoordinates(x, y, z));
}

cat1 = catenary(100, -28);
cat2 = catenary(120, -30);```

Gilles Chanteau
Member
Posts: 5
Registered: ‎10-20-2012
Message 5 of 5 (773 Views)

# Re : Re : Create Catenary Curves with DesignScript?

10-22-2012 02:59 PM in reply to: _gile

Thanks, that was fast!

Please see the attached 2 page PDF for a comparison of the parabola and the catenary definitions. I have a question about how you wrote the numPts variable in both definitions.

Otherwise, I consider this problem solved.

Thanks again!

### You are not logged in.

Announcements
Visit Autodesk Labs
Autodesk Labs is home for new prototypes, experiments, applications, and technologies.