{"id":20630678,"url":"https://github.com/openscad/openscad-wasm","last_synced_at":"2025-04-12T18:44:14.215Z","repository":{"id":37530334,"uuid":"460258619","full_name":"openscad/openscad-wasm","owner":"openscad","description":"Webassembly port of OpenSCAD","archived":false,"fork":false,"pushed_at":"2025-01-06T18:10:40.000Z","size":159,"stargazers_count":251,"open_issues_count":6,"forks_count":29,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-04T00:03:16.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openscad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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}},"created_at":"2022-02-17T02:51:18.000Z","updated_at":"2025-03-27T20:42:17.000Z","dependencies_parsed_at":"2025-02-27T09:21:09.808Z","dependency_job_id":"cf9d5da2-6ef9-440c-8459-71828f745f8e","html_url":"https://github.com/openscad/openscad-wasm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscad%2Fopenscad-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscad%2Fopenscad-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscad%2Fopenscad-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscad%2Fopenscad-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openscad","download_url":"https://codeload.github.com/openscad/openscad-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248617199,"owners_count":21134190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-16T14:09:15.489Z","updated_at":"2025-04-12T18:44:14.185Z","avatar_url":"https://github.com/openscad.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSCAD WASM Port\n\nA full port of OpenSCAD to WASM. \n\nThis project cross compiles all of the project dependencies and created a headless OpenSCAD WASM module.\n\n## Setup\n\nMake sure that you have the following installed:\n\n- Make\n- Docker\n- Deno\n\nTo build the project:\n\n```\nmake all\n```\n\nOr for specific steps:\n\n```\n# Generate the library files\nmake libs \n\n# Build the project\nmake build\n\n# Build the project in debug mode\nmake ENV=Debug build\n```\n\n## Usage\n\nThere is an example project in the example folder. Run it using:\n\n```\ncd example\ndeno run --allow-net --allow-read server.ts\n\n# or\n\nmake example\n```\n\nThere are also automated tests that can be run using:\n\n```\ncd tests\ndeno test --allow-read --allow-write\n\n# or\n\nmake test\n```\n\n## API\n\nThe project is an ES6 module. Simply import the module:\n\n```ts\n\u003chtml\u003e\n\u003chead\u003e\u003c/head\u003e\n\u003cbody\u003e\n\n\u003cscript type=\"module\"\u003e\n\nimport OpenSCAD from \"./openscad.js\";\n\n// OPTIONAL: add fonts to the FS\nimport { addFonts } from \"./openscad.fonts.js\";\n\n// OPTIONAL: add MCAD library to the FS\nimport { addMCAD } from \"./openscad.mcad.js\";\n\nconst filename = \"cube.stl\";\n\n// Instantiate the application\nconst instance = await OpenSCAD({noInitialRun: true});\n\n// Write a file to the filesystem\ninstance.FS.writeFile(\"/input.scad\", `cube(10);`); // OpenSCAD script to generate a 10mm cube\n\n// Run like a command-line program with arguments\ninstance.callMain([\"/input.scad\", \"--enable=manifold\", \"-o\", filename]); // manifold is faster at rendering\n\n// Read the output 3D-model into a JS byte-array\nconst output = instance.FS.readFile(\"/\"+filename);\n\n// Generate a link to output 3D-model and download the output STL file\nconst link = document.createElement(\"a\");\nlink.href = URL.createObjectURL(\nnew Blob([output], { type: \"application/octet-stream\" }), null);\nlink.download = filename;\ndocument.body.append(link);\nlink.click();\nlink.remove();\n\n\u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nFor more information on reading and writing files check out the [Emscripten File System API](https://emscripten.org/docs/api_reference/Filesystem-API.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscad%2Fopenscad-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenscad%2Fopenscad-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscad%2Fopenscad-wasm/lists"}