Bezier library for OpenScad

IMPORTANT This library is not user friendly. It a lot easier to use with the SVG to OpenSCAD InkScape extension. See:…
4
79
0
471
updated August 22, 2022

Description

PDF

IMPORTANT This library is not user friendly. It a lot easier to use with the SVG to OpenSCAD InkScape extension.

See: https://www.thingiverse.com/thing:2805184

Another useful tool to create incredible models with OpenSCAD. I added a module to create a single polygon from a list of points and bezier handles.

The modules provided by the original version (http://www.thingiverse.com/thing:8483) are nice when we are trying to control how the polygon will be split into triangles, but they are not useful when trying to create a polygon to use with rotate_extrude.

The only modifications I made to the original library is to add the module bezier_polygon to create a single polygon from a list of point, and I fixed a few deprecated usages.

[2017-03-13] I updated the BezPolygon module. I added a boolean parameter to show the points and bezier handles. Those are quite useful when drawing a complex polygon manually, or when editing one. This feature is not intended to be used for render.

[2017-03-19] I changed the "drawHandle" parameter (boolean) for "handleOpacity" (value from 0 to 1, default 0). I found it more useful that way.

[2017-03-24] Added BezPolygonCoordinates function which returns an array of coordinates that can be used to create a polygon. I added this function because I could not find a way to send a polygon as a parameter to a module or another function. Polygons can't be stored in a variable, but an array of coordinates can.

NOTE: I just discover the children() function which does exactly what I wanted, thanks to Kintel (#openscad on irc.freenode.net). I don't need BezPolygonCoordinates anymore, but I will leave it there because it may become useful at some point.

[2018-02-25] Uploaded v2, with fixed module names and improved comments

[2019-07-20] Added bezier_stroke

Instructions

  1. Download bezier_v2.scad, put it in the same folder as your .scad file.
  2. Import the bezier library with include
  3. Create your polygon using bezier_polygon
  4. Extrude the polygon the same way you would do with a circle or a square.

Look at demo_v2.scad for a simple example.

Category: Other

Tags



Model origin

The author marked this model as their own original creation. Imported from Thingiverse.

License