{"id":28954426,"url":"https://github.com/ad-si/luacad","last_synced_at":"2026-06-08T12:01:37.515Z","repository":{"id":280289393,"uuid":"941519492","full_name":"ad-si/LuaCAD","owner":"ad-si","description":"Create CAD models with Lua and OpenSCAD","archived":false,"fork":false,"pushed_at":"2026-02-25T16:19:26.000Z","size":2560,"stargazers_count":28,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-25T18:23:03.194Z","etag":null,"topics":["2d","3d","3d-model","3d-printing","cad","cam","cnc","dxf","geometry","laser-cutting","lua","luacad","maker","modeling","obj","openscad","parametric","stl","svg","wrl"],"latest_commit_sha":null,"homepage":"https://ad-si.github.io/LuaCAD/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ad-si.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-02T13:45:04.000Z","updated_at":"2026-02-25T16:24:36.000Z","dependencies_parsed_at":"2025-03-14T20:36:36.700Z","dependency_job_id":"a4762062-85a8-47bb-bbbe-98eff91e63b1","html_url":"https://github.com/ad-si/LuaCAD","commit_stats":null,"previous_names":["ad-si/luascad","ad-si/luacad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ad-si/LuaCAD","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2FLuaCAD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2FLuaCAD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2FLuaCAD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2FLuaCAD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-si","download_url":"https://codeload.github.com/ad-si/LuaCAD/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2FLuaCAD/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34061123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","3d","3d-model","3d-printing","cad","cam","cnc","dxf","geometry","laser-cutting","lua","luacad","maker","modeling","obj","openscad","parametric","stl","svg","wrl"],"created_at":"2025-06-23T19:10:29.300Z","updated_at":"2026-06-08T12:01:37.509Z","avatar_url":"https://github.com/ad-si.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LuaCAD\n\nSolid 3D CAD modeling with Lua.\n\nWrite parametric 2D and 3D models in Lua\nand export them to 3MF, STL, OBJ, PLY, OFF, AMF, or SCAD.\n\n![Screenshot of LuaCAD Studio app](images/2026-02-25t1353_screenshot.png)\n\nLuaCAD embeds Lua 5.4 in a Rust engine\nthat evaluates CSG operations directly (via [Manifold])\nor generates [SCAD] code for external rendering.\n\n[Manifold]: https://github.com/elalish/manifold\n[SCAD]: https://openscad.org/documentation.html\n\n\n## Installation\n\n### Via Crates\n\n```sh\ncargo install luacad  # CLI for running and converting LuaCAD scripts\ncargo install luacad-studio  # GUI desktop app with live 3D preview\n```\n\n\n### From source\n\nRequires [Rust](https://www.rust-lang.org/tools/install).\n\n```sh\ngit clone https://github.com/ad-si/LuaCAD.git\ncd LuaCAD\nmake install\n```\n\n\n## Usage\n\n### CLI\n\n```sh\nluacad convert model.lua output.3mf   # Convert to 3MF\nluacad convert model.lua output.stl   # Convert to STL\nluacad convert model.lua output.scad  # Export as SCAD for OpenSCAD\nluacad watch model.lua output.3mf     # Rebuild on file changes\nluacad run model.lua                  # Execute (side-effects only)\n```\n\n\n### Studio\n\n```sh\nluacad-studio\n```\n\nDesktop app with a code editor and 3D viewport.\nEdit Lua code on the right, see the model update on the left.\n\n\n## Example\n\n```lua\nmy_cube = cube { size = { 1, 2, 3 } }\n\nfunction my_sphere(radius)\n  return sphere({ r = radius }):translate(5, 0, 0)\nend\n\nmodel = my_cube + my_sphere(2)\n\nrender(model)\n```\n\n**Equivalent OpenSCAD:**\n\n```openscad\nmodule my_cube() {\n  cube(size=[1,2,3]);\n}\n\nmodule my_sphere(radius) {\n  translate([5,0,0]) sphere(r = radius);\n}\n\nunion() {\n  my_cube();\n  my_sphere(2);\n}\n```\n\nMore examples in the [examples/](examples/) directory.\n\n[Check out the website](https://ad-si.github.io/LuaCAD/openscad-to-luacad.html)\nto see all supported features!\n\nFor easier usage, LuaCAD has full support for the\n[Belfry OpenSCAD Library v2][BOSL2].\nYou can use its functions like this:\n\n```lua\nbosl.cuboid { {40, 40, 40}, rounding = 2 }\nbosl.regular_prism { 5, r = 10, h = 25 }\nbosl.spur_gear { circ_pitch = 5, teeth = 20, thickness = 5 }\n```\n\n\n## Why Lua?\n\nThe OpenSCAD language is limited and has several issues:\n\n- Confusing functions vs modules\n- Weird variable scoping\n- Not a well establised programming language\n    - Bad editor support\n    - Limited documentation\n    - Limited libraries\n    - Bad error messages\n    - Bad performance\n\nTherefore, a *real* programming language should be used\nand it should ideally be interpreted and have good\n[operator overloading support](https://en.wikipedia.org/wiki/Operator_overloading)\n\n- Julia - Too complex\n- Python - Too slow and while easy to get started, hard to master\n\nLua is a better fit:\n\n- Well-established, embeddable language\n- Operator overloading for natural CSG syntax (`a + b`, `a - b`)\n- Consistent semantics and good performance\n- Similar syntax to OpenSCAD's language\n- Already used in other CAD software ([LibreCAD], [Autodesk Netfabb])\n\n[LibreCAD]: https://wiki.librecad.org/index.php/LibreCAD_3_-_Lua_Scripting\n[Autodesk Netfabb]:\n  https://help.autodesk.com/view/NETF/2025/ENU/?guid=GUID-93C06838-2623-4573-9BFB-B1EF4628AC4A\n\n\n## Supported Export Formats\n\n- [SCAD](https://en.wikipedia.org/wiki/OpenSCAD)\n- [3MF](https://en.wikipedia.org/wiki/3D_Manufacturing_Format)\n- [STL](https://en.wikipedia.org/wiki/STL_(file_format))\n- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)\n- [PLY](https://en.wikipedia.org/wiki/PLY_(file_format))\n- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))\n- [AMF](https://en.wikipedia.org/wiki/Additive_manufacturing_file_format)\n\n\n## Roadmap\n\n- [ ]\n[BOSL2]: https://github.com/BelfrySCAD/BOSL2/wiki\n\n\n## Related\n\nOther CAD software with programmatic model creation:\n\n- [BlocksCAD] - Blockly-based CAD\n- [Flowscad] - Rust interface to OpenSCAD\n- [FreeCAD] - Python scripting\n- [HelloTriangle] - 3D modeling with Python\n- [ImplicitCAD] - Haskell-based CAD\n- [LibreCAD] - Lua scripting\n- [Liquid CAD] - 2D constraint-solving CAD\n- [ManifoldCAD] - JavaScript-based online CAD\n- [OpenSCAD Rust] - Rust OpenSCAD VM\n- [openscad-rs] - OpenSCAD parser library for Rust\n- [OpenSCAD] - OpenSCAD language\n- [Rust Scad] - Generate OpenSCAD from Rust\n- [scad_tree] - Rust solid modeling via OpenSCAD\n- [ScalaCad] - CSG in Scala\n- [SolidRS] - Rust OpenSCAD model generation\n- [SynapsCAD] - AI-powered 3D CAD IDE\n\n[BlocksCAD]: https://www.blockscad3d.com/editor/\n[Flowscad]: https://github.com/SmoothDragon/flowscad\n[FreeCAD]: https://wiki.freecad.org/Python_scripting_tutorial\n[HelloTriangle]: https://www.hellotriangle.io/\n[ImplicitCAD]: https://implicitcad.org/\n[Liquid CAD]: https://github.com/twitchyliquid64/liquid-cad\n[ManifoldCAD]: https://manifoldcad.org/\n[OpenSCAD Rust]: https://github.com/Michael-F-Bryan/scad-rs\n[openscad-rs]: https://github.com/ierror/openscad-rs:\n[Rust Scad]: https://github.com/TheZoq2/Rust-Scad\n[scad_tree]: https://github.com/mrclean71774/scad_tree\n[ScalaCad]: https://github.com/joewing/ScalaCad\n[SolidRS]: https://github.com/MnlPhlp/solidrs\n[SynapsCAD]: https://github.com/ierror/synaps-cad\n\n\n## History\n\nThe initial Lua implementation was done by Michael Lutz at\n[thechillcode/Lua_CAD](https://github.com/thechillcode/Lua_CAD).\nThe project was later rewritten in Rust.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fluacad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-si%2Fluacad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fluacad/lists"}