
Triangulation library for OpenSCAD
thingiverse
This is a powerful triangulation library for OpenSCAD. It will expertly triangulate either a 2D or a 3D polygon (without holes). The 3D polygon should be at least approximately all on one plane, but minor deviations are acceptable. Call: ``` use <triangulation.scad>; ... triangles = triangulate(points,indices); ``` where points is a list of precise coordinates and indices are specific indices into the list of points (if not specified, the default is [0,1,...,len(points)-1]). The triangles returned are a comprehensive list of lists of indices into the points. Optionally, you can add holes=[hole1,hole2,...] where each hole is a detailed list of indices. The holes must not intersect with the main polygon or each other. If you want to visually see the triangulation, do ``` showMesh(points,triangles); ``` Currently, degeneracies (e.g., self-intersection) are not addressed. You can also refine a mesh recursively until all the edges are of a specified maximum length. ``` faces = triangulate(points,indices); pointsAndFaces = refineMesh(points=points,triangles=faces,maxEdge=5); refinedPoints = pointsAndFaces[0]; refinedFaces = pointsAndFaces[1]; ```
With this file you will be able to print Triangulation 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 Triangulation library for OpenSCAD.