Tube mesh extrusion library for OpenSCAD

Tube mesh extrusion library for OpenSCAD

thingiverse

This is a library for generating "tube-like" meshes that join several cross-sections. For instance, one could use this to create a wing profile or a sphere. The cross-sections don't have to be planar, nor do they have to have the same number of points, but self-intersection of the resulting tube is likely to cause problems. There has been some optimization done to make triangles in the meshes closer to equilateral. One of the cool things one can do with this is "morph" between two plane shapes. For example, morphExtrude(ngonPoints(30,d=6), ngonPoints(2,d=4), height=10); produces a wedge whose bottom is a circle of radius 3, and whose top is a line of length 4, while morphExtrude([ [0,0], [20,0], [20,10], [0,10] ], [ [ 5,10 ] ], height=20 ); makes a pyramid with a rectangular base. The main low-level API is the module tubeMesh(sections,startCap=true,endCap=true,optimize=1) which takes a vector of three-dimensional counterclockwise cross-sections and generates a polyhedron. The `optimize` parameter controls triangle optimization. For smooth twisty things, you might want to increase it to 4 or 5, but for less smooth things, it may screw things up. If you are having problems, set it to 0 or 1. There is also the higher-level module morphExtrude(section1,section2=undef,height=undef,numSlices=10,startCap=true,endCap=true,optimize=1,twist=0,curve="t") This has two modes of operation. If `height` is undefined, you feed it two three-dimensional sections (if you omit section2, it is the same as section1), and it interpolates between them to generate `numSlices` layers. If `height` is defined, you feed it two two-dimensional sections, and interpolation between the two sections separated by the specified `height` is generated. The `twist` is mainly for fun. If you specify the `curve` parameter, and `height` is defined, then the interpolation parameter, which normally linearly changes from 0 to 1 with the z coordinate, is transformed according to the function specified by `curve`. For instance, the pointy pyramid in the demo is done with: morphExtrude([ [0,0], [20,0], [20,10], [0,10] ], [ [ 10,5 ] ], height=20, curve="sin(90*t)" ); You can use most of the standard OpenSCAD functions and operations for specifying the curve. See here for details. If you want to reference some parameters in your formula, you can add a `curveParams=[["paramA",valueA],["paramB",valueB],...]` argument to `morphExtrude()`. There are also some useful utility functions: * `ngonPoints(n=4,r=10,d=undef,rotate=0,z=undef)`: generate the points of a regular n-gon; 2D unless z is specified * `starPoints(n=10,r1=5,r2=10,rotate=0,z=undef)`: generate the points of a star; 2D unless z is specified * `roundedSquarePoints(size=[10,10],radius=2,z=undef)`: generate the points of a rounded square; 2D unless z is specified * `sectionZ(section,z)`: takes a list of 2D points and add a z-coordinate to them all * `shiftSection(section,delta)`: adds delta to every point in the section list. **Updates:** March 13, 2019: Better mesh optimization for smooth twisting things; `twist` parameter reversed in direction to match `linear_extrude()` March 11, 2019: Can omit section2 parameter to `morphExtrude()` January 14, 2019: Works without the `eval.scad` library if you don't use the curve parameter. There will be some warnings, but they can be ignored. November 18, 2018: Added `curve` parameter to `morphExtrude()` November 21, 2017: Added `roundedSquarePoints()`, `sectionZ()` and `shiftSection()` September 17, 2017: Added `tubeMesh()` module for convenience

Download Model from thingiverse

With this file you will be able to print Tube mesh extrusion library for OpenSCAD with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Tube mesh extrusion library for OpenSCAD.