Skip to content

Splines for OpenSCAD

Advertising
Advertising
?
Creation quality: 5.0/5 (1 vote)
Evaluation of members on the printability, utility, level of detail, etc.

  • 4.6k views
  • 2 likes
  • 77 downloads

License
3D design format
SCAD and ZIP Folder details Close
  • spline.scad
  • tjw-scad.zip
    • arrange.scad
    • dfm.scad
    • examples/candlestick.scad
    • examples/hose_bouquet.scad
    • examples/mask.scad
    • LICENSE
    • moves.scad
    • README.md
    • spline.scad

Learn more about the formats

Publication date 2021-06-03 at 23:11
?
Published to Thingiverse on: 2016-04-06 at 04:42
Design number 443512

3D printer file info

3D model description

I was working on a project in OpenSCAD that needed smooth curves. I was excited to find some Bezier curve libraries (http://www.thingiverse.com/thing:8443), but as I used them I remembered why awkward thing about Bezier curves: they're hard to design with if you want precise control. You move a control point, and it pulls the curve one way, but it also affects other areas of the curve, so you have to nudge adjacent control points the other way to compensate, and then repeat forever.

What I wanted was to tell OpenSCAD exactly where I wanted the curve to go, with a few points, and have it make a smooth curve passing between those points. That's a spline. I couldn't find any spline libraries for OpenSCAD. So I made this one.

The main module, spline.scad, is directly usable with no other dependencies. Grab the zip file instead if you want to look at the examples, as they're dependent on a couple of other modules.

Functionality included:

  • spline ribbons - a 2D splined line with a given width
  • spline walls - like a ribbon, but extruded to a given height
  • Several varieties of spline noodles - shapes extruded along a splined path, including ramen (circular cross-section), udon (square cross-section), and sausage (OK, that's not a noodle, but it's a ramen noodle with rounded ends), plus a hose which knocks out the center of a ramen noodle to a predefined width.
  • Both a regular lathed spline and a lathed pot, which is handy for making a thin-walled lathed object that must fit around something else (the initial motivation).
  • Open and closed versions of most things - for open-ended curvy lines or closed loops.
  • Several examples, pictured here.

Limitations

Sadly, the noodles look pretty great in the preview, much of the time, but the current OpenSCAD code chokes on them while rending with internal assertion failures, especially if you do Boolean operations with other shapes. The other shapes compile fine, though, and reasonably quickly.

Also, the approach to cross-section orientation I'm using in the lofting algorithm sometimes breaks at sharp transitions. Some of this could be fixable without changing the interface; some of it may require manually specifying normal vectors at each path point. I'll work more on that.

I welcome your input if you want to work on these problems. Feel free to fork the code from my GitHub.

Also: I developed this using OpenSCAD 2016.02.09 and it uses some recent features, so it won't be compatible with older versions. OpenSCAD has been backward-compatible in my experience; if anyone has a reason to prefer an older version, I'd like to hear about it.

3D printing settings

-

Advertising


Issue with this design? Report a problem.

Would you like to support Cults?

You like Cults and you want to help us continue the adventure independently? Please note that we are a small team of 3 people, therefore it is very simple to support us to maintain the activity and create future developments. Here are 4 solutions accessible to all:

  • ADVERTISING: Disable your banner blocker (AdBlock, …) and click on our banner ads.

  • AFFILIATION: Make your purchases online by clicking on our affiliate links here Amazon.

  • DONATE: If you want, you can make a donation via Ko-Fi πŸ’œ.

  • WORD OF MOUTH: Invite your friends to come, discover the platform and the magnificent 3D files shared by the community!


Sharing and downloading on Cults3D guarantees that designs remain in makers community hands! And not in the hands of the 3D printing or software giants who own the competing platforms and exploit the designs for their own commercial interests.

Cults3D is an independent, self-financed site that is not accountable to any investor or brand. Almost all of the site's revenues are paid back to the platform's makers. The content published on the site serves only the interests of its authors and not those of 3D printer brands who also wish to control the 3D modeling market.

100% secure payment by credit card, PayPal, Apple Pay, Google Pay, etc.
View all payment options.