<div dir="ltr">Graphics.OpenSCAD provides an algebraic data type for creating OpenSCAD 3d models, as well a a function to generate an OpenSCAD program from a data structure.<div><br></div><div>OpenSCAD is a "programmers" CAD tool. It provides a declarative language for 3d models with a primitive functional language for doing computation. The Graphics.OpenSCAD module tries to preserve the declarative parts by providing tools for building data structures that match the OpenSCAD declarative models, then embedding that in a powerful, modern functional language.</div>
<div><br></div><div>The critical problem with OpenSCAD is the error handling. At it's best, it will say "syntax error" and provide sufficient location information to easily find the error. At times, the location information points outside the file. Errors in dealing with variables may have no error messages, or messages that are easy to overlook, resulting in models that are radically different from what was expected with no way to determine the problem except searching the complete program text.</div>
<div><br></div><div>Graphics.OpenSCAD attempts to solve that by leveraging Haskell's type system as far as possible. While not every run-time OpenSCAD error can be detected in Haskell, as many as possible are. </div><div>
<br></div><div>Hackage page with pointers to source and documentation:</div><div><a href="http://hackage.haskell.org/package/OpenSCAD">http://hackage.haskell.org/package/OpenSCAD</a><br></div></div>