I created a customizable funnel to refill my peppercorn grinder without spilling everywhere, but the model may be tweaked for many other purposes.

The curved profile of the funnel is modeled using a Bezier curve, generated with ckirby's Bezier Library for OpenScad.

Just tried nice library for openscad) and the chellenge is now, so...

Easy Bez-curve generator

Most obvious problem is the artifacts from gimbal lock

Yet another customizable vase thing. The basic profile is generated by a Bezier curve while the ripples in the surface are generated by three trigonometric functions (one, applied to the radius at each angle to generate ridges; two, optionally applied to the orientation of each layer to generate twists; and three, optionally applied to the first to periodically smooth out the ridges).

Produces solid models intended to be printed with no infill or top layers. All 10 sample models were generated with this script. To experiment with values outside the Customizer control range, download the `.scad`

script to compile with the desktop version of OpenSCAD. (You may need to increase cache size in OpenSCAD preferences if you want to significantly increase resolution.)

Part of my Customizable Containers series.

If your locker or refrigerator needs a little freshening up, try out this vase. It prints a half vase with cutouts to hold magnets. The design is based on anoved's excellent Customizable Bezier Vase script. The included STL is for a 10 cm vase using four 1/4 x 1/16 inch neodymium magnets. If you want a different shape or have different magnets, use the customer. See the instructions for full details on printing and assembly.

.

September 29, 2014: Fixed a problem with the OpenScad. Magnet holes should be the right size now. Customizer didn't like the diameter property I was using.

Customized version of http://www.thingiverse.com/thing:462478

Created with Customizer! http://www.thingiverse.com/apps/customizer/run?thing_id=462478

Create smoothly curved vessels by interactively adjusting the size and position of constraints on the container's diameter. A Bezier curve is fit to pass through these key points, forming the object's profile. The profile is rotated around the central axis to form the vase.

You can adjust the resolution for a smooth or polygonal appearance. You can also select whether to generate a solid object suitable for printing in "spiral vase" mode or a hollow object with set wall thickness.

For a different approach to creating smoothly curved objects in Customizer, check out my previous Bezier vase thing (it uses the polygon drawing widget as a crude control point input method).

Part of my Customizable Containers collection.

Create smoothly curved containers such as bowls, urns, or vases with this customizable design. Beginning with a side view, you draw Bezier curve control points in a polygon widget; the resulting curve is turned into a cross section that is spun as if on a lathe or potter's wheel to produce the final model.

Here is a brief screencast demonstrating how to draw Bezier curve control points with this customizer: https://www.youtube.com/watch?v=hVwQY6czCPw The attached screenshot overlays a frame from the screencast with additional details.

Produces solid models intended to be printed with zero infill and zero top layers. (Alternatively, stop your printer around 90% to prevent top layers from being printed.)

Part of my Customizable Containers series.

(Does Thingiverse garble UTF? Let's look at the accented "e" in the word that follows to find out: *BÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ©zier*. Not initially, but after passing through the Edit Thing page again, it appears so.)

This is a personalised version of WilliamAAdams' bezier boat. Text added with HarlanDMii's write.scad library.

To put your name on the boat edit the OpenSCAD file to add your name. You may need to position it manually but it should be OK as it is for short names.

OpenScad library for creating solid objects based based on bezier curves.

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.

If you draw or are into drafting, then you know the value of having a set of French Curves!

These print at 3mm thick.

** UPDATED** Added a zipped folder of .DWG files so you can laser cut these.

This is perfect for your keychain, if you simply love your university! (Can be used as a bottleopener, too!)

A video of it printing: https://www.youtube.com/watch?v=fc-qKmykjaI

Made by a student of Aerospaceengineering.

Heart Crown

For those of us with a Princess in our lives, and the need to be forgiven for the state of the living-room-slash-mad-scientist-laboratory and the ABS fumes... the ability to print a crown made of hearts can go a long way to securing continued forbearance. ;-)

Thank you MakeALot for the original of which this is just a quick hack.

Not being able to leave well enough alone, I found that I needed to have partial surfaces of revolution.

This thing adds the ability to specify starting and ending angles for the revolution (defaults to 0 to 360).

That's kind of nice because for the simple cases where you are not intersecting with something at odd angles, you can simply generate the exact surface that you need, and call it a day.

Included in this revision is an experiment to see if the built-in 'rotate_extrude' could do a better job of things. Although it does play nicely with the CSG operations while viewing, it does not generate 2-manifold structures (and thus, no .stl files). I'm thinking maybe I need to overlap surfaces or something, rather than calculating exact vertices.

At any rate, I thought of adding rotation about an arbitrary line, as a final step, but really, that's easily achieved in OpenScad, so this might be the end of the line for these routines.

Isn't it amazing what can be done with OpenScad!!

Blog Entry: http://williamaadams.wordpress.com/2011/07/01/revolutionary-surfaces-with-openscad/

Inching closer to perfection.

This thing is an update to the revoloids library.

This time around, I've gotten the normals calculated correctly, so that a 'shell_extrude' can be performed. So, now there are two methods in the revoloids.scad file: linear_extrude_revoloid, shell_extrude_revoloid

The first one will 'intrude' towards the center of rotation. that's a nice valid way of doing things, but the ends must be relatively flat or things will get messed up.

The shell_extrude, which is new here, will 'do the needful' and extrude inward, or outward, based on the normals at the points on the curves (circule, and cubic curve). That's useful in some cases, and you'll get a uniform thickness across the piece.

There's some nice 'visual debug' support, so you can see fancy colors, wireframes, normals, and the like (exhibited in the attached pictures). And yes, it does in fact generate valid .stl files (exhibited in the attached .stl files).

What more can be done with this? Well, I took the opportunity to remove the implementation of the bezier surface of revolution, because it is now redundant. I would like to do piecewise curves with C0/C1 continuity. It's just a matter of stitching them together. That will allow for more complex shapes. Other than that, not much other than some more simplifications, and rotation around an arbitrary axis. But, perhaps that can wait for a 2.0 version.

Still need to work on convenient end caps

Ultimately I'll merge this into the Renderer.scad file

BEWARE:

Your ends should NOT be totally vertical

Hermite curves still don't come out quite correctly

UPDATE: 270611

I figured out my Hermite problem. The actual problem relates to the cheap way in which I am still calculating the normal to the circle. You absolutely MUST create your curve in the x-y plane. It will be interesting at some point to add the ability to do it more free form, but for now, it's best if your curve is planar in the x-y

Well, revoloids (slight change in name) are really nifty cool, easy to generate surfaces in a mathematical sense, but for them to be relevant to 3D printing, they need some volume.

This thing adds the ability to specify a thickness on your revoloid so that you can actually export as a .stl and print it.

I whimped out (and thus still not 1.0) and just used the normal of the circle to calculate the second quad. The actual normal is a cross between the tangent of the circle, and the tangent of the curve at that point. Next version.

I also want to come up with a nice scheme for printing flats for 'bottoms' and 'tops'.

There are lots of interesting cubic curves in the world. They're interesting because with just 4 points, you can describe very interesting shapes. These curves make for nice revolutionary solids, but with OpenScad, it's kind of a challenge.

This thing generalizes the surface of revolution based on a cubic curve.

How simple is it?

The following will generate that bell shaped picture based on a Catmull-Rom cubic curve.

surface_rotationx_cubic(anglesteps = 36, stacksteps = 12,

umult = 0.5, A = cubic_catmullrom_M(),

cps = [[0, 1, 0],[2,3,0], [4,1,0],[5,2,0]]);

And this one will do the same for a standard Bezier curve based on the same control points

surface_rotationx_cubic(anglesteps = 24, stacksteps = 12,

umult = 1, A = cubic_bezier_M(),

cps = [[0, 1, 0],[2,3,0], [4,1,0],[5,2,0]]);

And the same can be done for a Hermite, or any other 'cubic' curve you can think of. The two key components are the blending function 'A', which is a 4x4 matrix, and the control points 'cps', which are simply the geometry of your control points.

The routine, found in the revolids.scad file, will take care of all the dirty work.

I marked this as version '0.5' because although it will show pretty pictures, right now it's not doing the surface normal calculations, or anything else really necessary to make solids, so a couple more iterations. But, it's fun to play with.

I've really been wracking my brain on the lack of function pointers in OpenScad, but this essentially provides the same capability, utilizing the matrices, which are the essence of these things anyway.

At any rate, something to play with.

UPDATE: 220611

Added a picture of a Hermite revolid with debugging normals (showing the circular normals to be incorrect).

I've wanted to see how much can be done with OpenScad to generate more basic solids. Now that I've gotten my 100th design out of the way, here's more OpenScad mayhem.

This thing is a little library of 'Solids of Revolution' (revolids).

It's simple stuff that you can easily do with OpenScad (torus, ellipsoid, bezier curves rotated. In this case, I'm doing my own math though, and utilizing the Renderer that I did for the Bezier surface stuff.

This library allows me to play with different methods of rendering different shapes, to see what I can make 2-manifold, what will still work as a CSG form when combined with other primitives, and whatnot. These closed polyhedra will work standalone, but to combine them with other things in a CSG way would require some more work.

One goal I have is to get more solids integrated into a tool like RapCAD. And ultimately, I'd like to get a machine to be able to read .scad files directly, rather than slicing .stl files. But that's another story, these are just raw bits.

At any rate, if you're at all curious about how these various forms are put together from scratch, here's a library for you.

UPDATE: The blog posting to go with it

http://williamaadams.wordpress.com/2011/06/11/reconsidering-openscad-extensions/

I saw the original Patron one piece chair, and I thought 'that would be a perfect thing to try and model with a Bezier surface'.

This thing is an attempt to model the patron chair it derives from using the Bezier surface library.

It's just fun to play with. You can fiddle about with the vertices of the curves, and see how the curve reacts. It would probably be much easier to model with a different type of curve, but here it is.

The previous incarnations of the library have been good for laying down generic Bezier surfaces, but it was very picky when it came to actually turning them into .stl files that are printable.

This thing will more readily turn your surfaces into .stl files. It makes a modification to the Renderer.scad file. Specifically, the DisplayQuadShards() routine. It now takes an array which tells it which of the 'edge' faces to generate.

Thus, instead of generating all the triangles as polyhedra, it will actually generate a full 'shell'. The 'top' is complete, and the 'bottom' is complete, but only the outside edges of the entire surface are complete. So, there are no interior walls, which end up causing problems for the shape being 2-manifold.

What this means is there is essentially one giant solid to process rather than a whole bunch of little ones. This makes CGAL much happier, and pieces that would not be printable before are now printable, as evidenced by the included .stl files here.

A couple more 'debugging' improvements. You can now specify your own opacity when you utilize the shell_extrude_bezier() module. You can also specify whether you want to see the curve frame, instead of looking at the actual polyhedron rendering. This is useful so you can just look at the true surface, without the walls getting in the way.

The picture is an optical illusion. I'm using an opacity of 0.75 to see the interior. Those internal 'walls' aren't actually there.

There are still issues with compound objects. That fancy shoe for instance: http://www.thingiverse.com/thing:8937

This renderer is now capable of dealing with the individual parts, but if you try to put them all together as a single object, it will not be able to generate a .stl. This is progress as you could glue the individual parts together at least.

At any rate, one more step along the path...

Conic BÃ©zier Curve for OpenSCAD

also known as Quadratic Bezier Curve

also known as Bezier Curve with 3 control points

also known as 'Conic Arcs' or 'Parabolic Segments'

By Don B, 2011, released into the Public Domain

**What's it for**

Bezier curves allow you to pick a small number of 'control points', then let the computer fill in a pretty curve between them. In this thing, 3 control points are used.

**Notes**

This is for 3-point bezier curves; there is another popular type, the 4-point 'Cubic', that this code doesn't do.

This is inspired by William Adam's cubic bezier Thingiverse OpenSCAD code. His code now also handles Conics; I guess I will leave this thing here as a sort of 'super simple' 'for dummies' version.

The first sample image shows a simple 3 control-point curved polygon, and a rod around which it can be rotated. The result of this rotation is shown in the big smooth object.

The next sample image shows the code itself; the module is only about 10 lines long thanks to OpenSCAD's built-in vector math.

**Please see also**

http://www.thingiverse.com/thing:8443 by William A Adams (Cubic Beziers)

http://en.wikipedia.org/wiki/File:Bezier_2_big.gif by Phil Tregoning

http://en.wikipedia.org/wiki/B%C3%A9zier_curve by Wikipedia editors

http://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html David Turner + Freetype team

**Using the code**

- download the .scad file, below
- copy/paste the BezConic module to your own code
- call it like this:

p0=[15,0];

p1=[1,14];

p2=[7,30];

linear_extrude() BezConic(p0,p1,p2,steps=20);

**Fun Facts**

BÃ©zier are named after Pierre BÃ©zier, who used the work of Paul de Casteljau to make curves on car bodies. Casteljau worked at Citroen and Bezier worked at Renault.

They are named 'conic' because 3-point Bezier's are basically parabolas. A parabola is basically the intersection of a cone with a plane (i.e. a conic section). Please see wikipedia for more info.

Conic Arc BÃ©zier Curves (3 control points) are used by TrueType fonts.

The 1.0 version of the Bezier library included a simple linear extrusion of the bezier surface. The things this derives from added a quick and easy 'shell extrusion', which took into account the normals on the quads to create true 'inner' and 'outer' quads.

This thing makes a few improvements to both the normal calculations, and rearranges the libraries slightly to accomodate for future curved surface/solid things.

As a bonus, the hermite.scad file is thrown in. At the moment, it only has basic Hermite calculations. It even has a surface thing. So, if you want to play with that, here it is.

Also, in terms of library function naming, I've switched to being more explicit and rational.

linear_extrude_bezier - extrusion in the z-axis

shell_extrude_bezier - extrusion along the normals

So, for Hermite, it would be linear_extrude_hermite, shell_extrude_hermite

One of the cool features is the ability to show the normals, per vertex. This is extremely handy for debugging purposes. This, combined with being able to show the control mesh, makes for some nice visualization. I was actually able to spot a bug in my derivatives calculations by looking at which way a couple of normals were pointing.

Also, I've combined the bezier functions into the maths.scad library, so there is just one fewer files to download.

UPDATE: One more change I forgot to mention. I introduced the terms 'berp' and 'berpm'. Bezier Interpolation (berp - formerly PtOnBez). Bezier Interpolation of Mesh (berpm). I thought they would be fun names, and in line with the classic Linear Interpolation (lerp).

So, what are Bezier curves good for if you're not going to do much with them?

This thing is a simple boat created out of Bezier surfaces. I define a bow, and a midship section, and a stern, then just stitch a few of them together. In the picture can be seen how the control mesh looks.

This particular one shows how you have to print in a couple of halves and bring them together. This is an artifact of the linear extrusion offered by the OpenScad bezier library.

This model takes about 3 minutes to generate the .stl from the .scad. Not too bad.

Well, I started out wanting to do some nicer fillets on my OpenScad designs, and suddenly, I have a full blown Bezier surface/solids library!

This thing is the Version 1.0 for this stuff. I think it's actually good enough to produce some nice looking objects.

The technique used here is a linear extrusion of a bezier surface. The surface itself is described by 16 control points in a mesh. The machinery then takes care of rendering that to the thickness that you want.

The workhorse module can be found in the Renderer.scad file: DisplaySurfaceMesh()

This will generate a surface, according to your mesh, and extruded to the thickness that you specify (default 1mm). It is a solid, so it will play nicely with the other CSG functions in OpenScad.

There are a few demo/test/samples provided in the .scad files, so it should be fairly easy to make up your own examples.

I use colors in the examples because it makes for some pretty pictures. They don't affect the rendering process at all. If you don't like the color ramps, you can select your own.

Although this version provides only one mechanism for doing solids from the Bezier surface mesh, it has all the fundamentals for you to do other forms as well. you don't even have to use the Bezier functions for bezier surfaces, you can use them for anything where you'd like something to vary in a parametric sort of way in your designs. The color ramps are another example of how the Bezier curves can be used.

At any rate, there are other forms of curves, and more rendering methods to be pursued. RapCAD is doing some interesting work, and hopefully Bezier shows up as a core feature of these various text based tools.

But, until that day... enjoy!

UPDATE: Blog entry to go with it:

http://williamaadams.wordpress.com/2011/05/26/linear-extrusion-of-bezier-surfaces/

One step closer to the world. The virtuous cycle of innovation is a very good thing. I have received much support and ideas from syvwlch http://www.thingiverse.com/syvwlch I have been inspired by the printable clock, and his recent curvy work. Doing free form solids in OpenScad has been a challenging endeavor. There is some math involved, and a lot of head scratching.

This thing is one step closer to providing Bezier surfaces that are actually printable.

In the last iteration, I had the Bezier surface rendering, but it was a pure graphic construct, which was not printable. Now that I've discovered fire (polyhedron), I have been able to get one step closer to making the thing actually solid. In this particular case, you can now specify the thickness of your surface, and the routine will 'do the needful'.

I haven't done any experimentation with polyhedra and CSG commands in OpenScad, so I don't know what happens when you cut out a cylinder from the thing, for example. but, again, one step closer.

The way this thing is done is to use the normals at each vertex, and project 'inward' in the opposite direction for the length of 'thickness' to get a new set of vertices. This new set represents a triangle which is inward from the 'outer' surface. From there, it's a matter of constructing a new surface, and the interjoining quads to seal the edges.

The approach is right for a triangle in isolation, but as can be seen from the image, leaves a lot of gaps. The final solution there is to actually calculate a new surface inward from the original control points, and calculate the appropriate points between the surfaces directly. But, that will be the final step.

Blah, blah, blah

At any rate, solid Bezier surfaces are one step closer.

UPDATE: Added a .stl file: bezier_surface_polyhedra1

This file represents using the polyhedron technique to its fullest. So, it shows that you can in fact generate manifold solids from closed polyhedra.

You know in those Japanese anime movies where the character gets question marks above their head, and their cheeks go red when they're embarrassed? I had a smack your head moment as I realized that OpenScad has a polyhedron object!

This thing is a very slight modification to the test_bezier.scad file. It includes a DisplayBezSurface(mesh) routine which will actually draw the surface using polyhedron to place the triangle patches.

That makes the final stage a whole lot easier. Now, instead of trying to use the polygon, and project it into position, I can simply use the polyhedron, and construct an appropriately shaped polyhedron to get the patches at the desired thickness!

So, once I do that, I'll go to version 0.9, and 1.0 will be when it's all nicely packaged up into a couple of clean library files.

One more step, one more pretty picture.

With this technique, now any parametric surface is possible, including b-spline and the like.

The best thing about development tools is they usually get better as you discover what's really useful to you. In the last iteration of this stuff, a 'debugger' showed up, which allowed you to visualize the Bezier mesh. That thing was a good step forward, but very rudimentary, still relying on 'granules' of a sort to do the drawing.

This thing makes the drawing process a bazillion (officially measured scale) times faster. I finally pulled enough graphics books off the shelf to figure out my vector rotation problem. It's much easier if you think in terms of polar coordinates. (shy grin)

At any rate, the primary changes are in the maths, bezier, and test_maths files, so those are uploaded here.

Now the drawing of wireframes comes from placing cylinders in the positions of lines. The benefit here is that you can dial in both the radius, and the number of faces, to reduce the amount of drawing time. A bonus benefit is that if you make the lines thick enough, and use enough of them, you might actually be able to print a surface directly from the wireframe.

On the other hand, what this also does is make things fast enough that you can actually rapidly visualize how your bezier is turning out. You can see both the control points, and the wireframe of the map in short order, and easily rotate and move it around.

I tell you, this is pretty exciting even for me.

With figuring out the math for the cylinder placement, I have a new lease on life, and have figured out the placement for the quad patches as well. So, I'd say one more experimental session away from actually producing the surfaces.

Final note. If you want to play around with the line drawing, it's in the test_bezier.scad file. It's the 'PlaceLine()' module. There is also a nifty little thing called a segment parser. It takes the endpoints for a line, and returns an 'array' which is essentially a data structure, containing, origin, rotations, length. That's all you need for the line placer to do its thing.

phew...

As the Bezier functions are essentially a development tool, I find myself in need of a 'debugger'.

This 'thing' is an update of the Bezier library. The primary additions are a couple of debugging aids. Specifically, the ability to draw the control points as a wireframe, and the ability to do the same with the quad lines that make up the actual surface.

I have also refactored the various files. The maths.scad files contains some additional functions that were useful, including some more matrix routines (determinant).

This release does not require the granules functions at all. So, there is a new file "Renderer.scad", which is meant to encapsulate whatever rendering routines you're going to do.

I've also started moving down a path whereby parameters to functions and modules are provided as arrays, rather than as individual parameters. I'm doing this because OpenScad reads like a functional language. As such, I assume that every function returns a meaningful value which can then be used directly by another function. This makes tying things together very much simpler.

And finally, in the bezier and maths and Renderer files, you will find things like being able to get a quad by simply calling a function and passing in the mesh control points, and your 'u' and 'v' values.

I still have not solved the normals pointing in the wrong direction for all cases, nor the short leg syndrome on the triangles, but one step closer now.

The ultimate in Bezier curviness in OpenScad is to have thickness of surface, without having to use a bazillion granules to render an object.

This thing is some updating of the bezier functions to deal with the mesh better. Specifically, you can hand the BezierMesh() module a set of 4 Bezier curves, and it will do the surface interpolation/tesselation, and generate a mesh of triangle patches that will represent the surface.

I labelled this as version '0.5' because there are some pretty horrible bugs. As can be seen in the first picture, those blue dots are the calculated surface normals for each of the quad faces. There is a flaw in the rotation angle calculations such that there is a bias, which causes the normals to point off axis in the wrong direction depending on this and that. On more interesting meshes, this will show up even worse.

Also, there are still cracks between the 'rows' as I am not properly calculating the lengths of the sides to match up properly. I know what needs to be done, but I was trying to get the normals right first.

I'm releasing this now, even though it's not quite functional, because I want other people to take a look and possibly do the math better than I am. It's all really straight forward actually. Nothing too harry other than getting some trig right. The rest is just multiplication and addition. Easy optimizations abound, particularly in the BezierMesh() module. The first, to speed up processing, would be to separate the Bezier coefficient calculations from the general 'pointoncurve' calculation. That would be way efficient.

There are some updated functions in the 'maths.scad' file, as well as the 'Render2D.scad' file.

For the final, I'll separate out the "render" stuff for granules from the core drawing. The ideal would be that you could drop in your own renderer, and get totally different behavior. I think that's a fairly easy way to extend OpenScad.

At any rate, just a step along the path...

UPDATE: Here's a blog entry to go with it...

http://williamaadams.wordpress.com/2011/05/19/mr-beziers-new-perspective/