{"id":15527033,"url":"https://github.com/pyrech/gcode-estimator","last_synced_at":"2025-04-23T11:56:51.780Z","repository":{"id":53012567,"uuid":"242011829","full_name":"pyrech/gcode-estimator","owner":"pyrech","description":"Estimate the length/weight/cost of filament used for a 3D print by parsing the gcode file","archived":false,"fork":false,"pushed_at":"2023-09-01T09:07:48.000Z","size":9762,"stargazers_count":16,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T11:56:40.842Z","etag":null,"topics":["3d","3d-printing","cost","filament","gcode","length","weight"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/pyrech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-20T23:24:16.000Z","updated_at":"2025-01-16T14:53:00.000Z","dependencies_parsed_at":"2025-03-05T12:42:04.655Z","dependency_job_id":null,"html_url":"https://github.com/pyrech/gcode-estimator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrech%2Fgcode-estimator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrech%2Fgcode-estimator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrech%2Fgcode-estimator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrech%2Fgcode-estimator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrech","download_url":"https://codeload.github.com/pyrech/gcode-estimator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430589,"owners_count":21429323,"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":["3d","3d-printing","cost","filament","gcode","length","weight"],"created_at":"2024-10-02T11:03:57.454Z","updated_at":"2025-04-23T11:56:51.762Z","avatar_url":"https://github.com/pyrech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GcodeEstimator\n\nGcodeEstimator is a PHP library to estimate the length/weight/cost of filament\nused for a 3D print through the corresponding gcode file.\n\nRequires PHP \u003e= 7.2.\n\n## Features\n\nUnlike other implementations, this library supports most of g-code operations commonly used by 3d printers:\n\n- all kind of moves (rapid, linear, clockwise arc, counter-clockwise arc)\n- absolute and relative positionings\n- switch between absolute/relative modes\n- current position reset\n- millimeter and inche units\n\nEstimations should be quite realist whatever the slicer/printer you use.\n\n## Installation\n\nUse [Composer](http://getcomposer.org/) to install GcodeEstimator in your project:\n\n```shell\ncomposer require \"pyrech/gcode-estimator\"\n```\n\n## Usage\n\nBasic usage to get the length of filament used:\n\n```php\ninclude __DIR__.'/vendor/autoload.php';\n\nuse Pyrech\\GcodeEstimator\\Estimator;\n\n$estimator = new Estimator();\n$estimate = $estimator-\u003eestimate($absolutePathToGcode);\n\n$estimate-\u003egetLength(); // returns the length of filament used (in mm);\n```\n\nYou can also estimate the weight and cost of your print by describing the\nproperties of your filament spool:\n\n```php\ninclude __DIR__.'/vendor/autoload.php';\n\nuse Pyrech\\GcodeEstimator\\Estimator;\nuse Pyrech\\GcodeEstimator\\Filament;\n\n$filament = new Filament(\n    1.75, // filament diameter in mm\n    1.24, // filament density in g/cm³\n    750,  // weight of the spool in g\n    25.99 // price of the spool (whatever your currency)\n);\n\n$estimator = new Estimator();\n$estimate = $estimator-\u003eestimate($absolutePathToGcode, $filament);\n\n$estimate-\u003egetLength(); // returns the length of filament used (in mm);\n$estimate-\u003egetWeight(); // returns the weight of filament used (in g);\n$estimate-\u003egetCost();   // returns the cost of filament used (in whatever currency you specified);\n```\n\n## Further documentation\n\nYou can see the current and past versions using one of the following:\n\n* the `git tag` command\n* the [releases page on Github](https://github.com/pyrech/gcode-estimator/releases)\n* the file listing the [changes between versions](CHANGELOG.md)\n\nAnd finally some meta documentation:\n\n* [versioning and branching models](VERSIONING.md)\n* [contribution instructions](CONTRIBUTING.md)\n\n## Credits\n\n* [All contributors](https://github.com/pyrech/gcode-estimator/graphs/contributors)\n\n## License\n\nGcodeEstimator is licensed under the MIT License - see the [LICENSE](LICENSE)\nfile for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrech%2Fgcode-estimator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrech%2Fgcode-estimator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrech%2Fgcode-estimator/lists"}