Skip to content

Bezier Library for OpenScad

Advertising
Advertising
?
Creation quality: 0.0/5 (0 votes)
Evaluation of members on the printability, utility, level of detail, etc.

  • 347 views
  • 4 downloads

License
3D design format
Folder details Close
  • BezierArcTest.scad
  • BezierArcTest.stl
  • BezierArcTest.stl
  • BezierScad.scad
  • BezierTest.scad
  • BezierTest.stl

Learn more about the formats

Publication date 2023-10-15 at 21:14
?
Published to Thingiverse on: 2013-05-10 at 06:29
Design number 1516335

3D printer file info

3D model description

See http://github.com/uplake/BezierScad

Updated 5/10/13--fixed triangle winding in centered BezWall; use polyhedron for variable-height BezArc.

I wanted a bezier library that could handle an arbitrary number of control points. When working on thingiverse.com/thing:77586, I also wanted to rotate extrude a "wall" defined by a bezier path and a width.

BezWall is the workhorse function. The "ctlPts" parameter accepts between 1-8 bezier control points.

The parameters "width" and "height" accept static values (e.g., 5) specifying the width and height of the wall. If height is 0, it will generate a 2d object you can extrude yourself.

The alternate parameters "widthCtls" and "heightCtls" accept an array of values that will be bezier-interpolated along the length of the wall.

If the "centered" parameter is "true", the wall is centered on the path defined by "ctlPts". Otherwise, one edge of the wall is defined by "ctlPts".

At the moment, there is no documentation! But there is a test file that runs through most of the available features.

3D printing settings

I'd previously done some work writing coffeescript code to generate bezier interpolation functions that accept an arbitrary number of control points, and I'd written some coffeescript to generate openscad code. It occurred to me that I could use coffeescript to automate a lot of the tedium in writing openscad functions. So, the coffeescript file in this thing will generate openscad functions to handle bezier interpolation with a varying number of control points. The attached BezierScad.scad file can deal with up to 8 control points, but you can easily modify orderMax in the coffeescript file to have it generate functions that can deal with higher or lower orders.

The BezLine function is simpler than BezWall and offers a subset of the BezWall functionality.

BezLine takes an array of 1-8 control points and an array of 1-8 width values, which will be bezier interpolated as widths for the resulting line.

BezLine doesn't accept a "steps" parameter. Rather, it takes a "resolution" parameter of between 2-6. The resulting line will have (2**resolution) segments.

BezArc returns a shape similar to that generated by WilliamAAdams' BezQuadCurve function.

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.