{"id":23260568,"url":"https://github.com/nmasse-itix/openscad-pattern-filling","last_synced_at":"2026-02-20T00:32:00.236Z","repository":{"id":80605328,"uuid":"132342098","full_name":"nmasse-itix/OpenSCAD-Pattern-Filling","owner":"nmasse-itix","description":"This OpenSCAD module provides the required mechanisms to spray a pattern on a surface.","archived":false,"fork":false,"pushed_at":"2018-05-26T14:35:23.000Z","size":750,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-21T18:35:56.905Z","etag":null,"topics":["openscad","openscad-library","patterns"],"latest_commit_sha":null,"homepage":null,"language":"OpenSCAD","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nmasse-itix.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}},"created_at":"2018-05-06T13:42:06.000Z","updated_at":"2025-04-22T01:51:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"df26358b-7d9c-49c1-a4ee-d867cc3ce03d","html_url":"https://github.com/nmasse-itix/OpenSCAD-Pattern-Filling","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nmasse-itix/OpenSCAD-Pattern-Filling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2FOpenSCAD-Pattern-Filling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2FOpenSCAD-Pattern-Filling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2FOpenSCAD-Pattern-Filling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2FOpenSCAD-Pattern-Filling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmasse-itix","download_url":"https://codeload.github.com/nmasse-itix/OpenSCAD-Pattern-Filling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmasse-itix%2FOpenSCAD-Pattern-Filling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29637410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["openscad","openscad-library","patterns"],"created_at":"2024-12-19T13:17:19.764Z","updated_at":"2026-02-20T00:32:00.221Z","avatar_url":"https://github.com/nmasse-itix.png","language":"OpenSCAD","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pattern filling with OpenSCAD\n\nThis OpenSCAD module provides the required mechanisms to spray a pattern on a\nsurface.\n\n## Possible usages\n\nPatterns are widely used in common objects, and so are the possible usages of\nthis module:\n - [alveolar reinforcement](examples/reinforcement/)\n - [moucharabieh](examples/moucharabieh/)\n - [decorative patterns](examples/decorative/)\n - surface texturing\n\n## Examples\n\nIn the [examples](examples) folder, common examples are provided to illustrate\nwhat can be achieved and how to use this module.\n\n## How to use it\n\nFirst, you will need to get a copy of this module locally:\n```\ngit clone https://github.com/nmasse-itix/OpenSCAD-Pattern-Filling.git\n```\n\nIn your OpenSCAD file, include this module:\n```\nuse \u003cOpenSCAD-Pattern-Filling/pattern.scad\u003e\n```\n\nThen, build your base shape (in this example, an octogon and a square):\n```\nmodule mypattern(r) {\n  // The octogon\n  rotate([0,0,22.5])\n    circle(r=r, center=true, $fn=8);\n\n  // The square\n  l = 2 * r * sin(22.5);\n  translate([r,r,0])\n    rotate([0,0,45])\n      square([l,l], center=true);\n}\n```\n\nInstanciate it once, in order to check it matches your expectations:\n```\nr = 2;\nmypattern(r);\n```\n\n![our base shape](documentation/images/tutorial_base_shape.png?raw=true)\n\nThen, you need to define two things:\n - a bounding box (the area to spray)\n - the two moves defining how to spray our pattern\n\n```\nbounding_box = [\n  [0,0],     // Lower left corner\n  [20, 20]   // upper right corner\n];\nmoves = [\n  [ 2*r, 0], // For the first move, we will translate on x by two times the radius\n  [ 0, 2*r], // For the second move, we will translate on y by two times the radius\n];\n```\n\nFinally, the pattern can be sprayed:\n```\nspray_pattern(bounding_box, moves)\n  mypattern(r);\n```\n\n![the sprayed pattern](documentation/images/tutorial_sprayed_pattern.png?raw=true)\n\nIf you like clean edges, you can cut the sprayed pattern at bounding box size\nby intersecting the pattern with the bounding box:\n```\nintersection() {\n  spray_pattern(bounding_box, moves)\n    mypattern(r);\n  square(bounding_box[1] - bounding_box[0]);\n}\n```\n\n![a clean cut of our pattern](documentation/images/tutorial_clean_cut.png?raw=true)\n\nCheck [the complete source code](examples/tutorial/tutorial.scad) for more information.\n\n## Limitations\n\nCurrently, the first move needs to be exclusively on the x axis otherwise\nthe pattern may not be sprayed correctly, leaving blank area.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmasse-itix%2Fopenscad-pattern-filling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmasse-itix%2Fopenscad-pattern-filling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmasse-itix%2Fopenscad-pattern-filling/lists"}