OpenScad Revolids version 0.5 (Q48063)

From Library of Open Source Hardware
Jump to navigation Jump to search
No description defined
Language Label Description Also known as
English
OpenScad Revolids version 0.5
No description defined

    Statements

    WilliamAAdams
    0 references
    0 references
    www.thingiverse.com
    0 references
    1.0.0
    0 references
    thingiverse.com
    0 references
    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).
    0 references
    https://spdx.org/licenses/CC-BY-4.0
    0 references
    auto
    0 references
    en
    0 references