Drawing footballs, tubes, pipes, pie segments, 'D' shafts and more in 1 line of OpenSCAD
====================================================================
OR Extending OpenSCAD 'sphere', 'cylinder' and 'circle' primitives
----------------------------------------------------------------------------------------
According to Plato "Necessity is the mother of invention" as so it was for me.
I needed a 'D' shaped hole to fit over the same shape on a motor shaft.
I also needed curved slots to allow mounting bolts, arranged in a cicle, to be adjusted by rotating them as a group.
Solution: Extend the 'circle' and 'cylinder' OpenSCAD primitives
In cylinder2.scad are 2 new functions 'cylinder2' and 'circle2'
'circle2' can do everything that 'circle' does given the same parameters and much MORE.
'cylinder2' can do everything that 'cylinder' does given the same parameters and much MORE all in one call.
Draw a tube or pipe is much easier (no need to use difference):
`cylinder2(h=20,d=20,ri=8); // A tube with Radius Inside = 8`
Draw a 'D' shaped cylinder:
`cylinder2(h=10,d=15,deg=280); // Cylinder with DEG = 280 rounded `
Draw a pie segment:
`cylinder2(h=20,d=20,deg=55,efn=2); // Half cylinder (from 0 to 55 DEGrees), End faces number = 2`
Draw a curved bar:
`cylinder2(h=20,d=20,ri=5,deg=80,sd=45,efn=0,$fn=7); // Tube 45-125, straight ends, 7 faces`
To use it:
Download cylinder2.scad and place it with your scad files or in your OpenSCAD library directory
Add the next line to you .scad file:
`use ;`
Then use 'sphere2', 'cylinder2' or 'circle2' instead of their original functions.
See the other examples and a large list in cylinder2-all
Update:
======
Extending 'cylinder2' to 'sphere2' has been the next step.
The additional features now include:
Spheres
-----------
* Stretched spheres (like a football)
* Partial spheres (% complete from bottom to top, 50% is a hemisphere)
* Hollow spheres
* Spheres from circle2 objects
Cylinders
-------------
* Extended cylinders (curved ends with 1 or 2 straight sides)
* Cylinder with concave circle cutout
* Optional rounded top and/or bottom edges
NB: There has been a change in the results for efn=1