Loading

OpenScad Revolids version 0.5

by WilliamAAdams, published

OpenScad Revolids version 0.5 by WilliamAAdams Jun 20, 2011

Description

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).

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

1) Download all the .scad files
2) Fiddle about with the test_revolids.scad to make pretty pictures
3) Rejoice!

Comments

You must be logged in to post a comment.

Top