pyrech/gcode-estimator
最新稳定版本:v1.0.1
Composer 安装命令:
composer require pyrech/gcode-estimator
包简介
Calculate filament length/weight/cost used in gcode file
README 文档
README
GcodeEstimator is a PHP library to estimate the length/weight/cost of filament used for a 3D print through the corresponding gcode file.
Requires PHP >= 7.2.
Features
Unlike other implementations, this library supports most of g-code operations commonly used by 3d printers:
- all kind of moves (rapid, linear, clockwise arc, counter-clockwise arc)
- absolute and relative positionings
- switch between absolute/relative modes
- current position reset
- millimeter and inche units
Estimations should be quite realist whatever the slicer/printer you use.
Installation
Use Composer to install GcodeEstimator in your project:
composer require "pyrech/gcode-estimator"
Usage
Basic usage to get the length of filament used:
include __DIR__.'/vendor/autoload.php'; use Pyrech\GcodeEstimator\Estimator; $estimator = new Estimator(); $estimate = $estimator->estimate($absolutePathToGcode); $estimate->getLength(); // returns the length of filament used (in mm);
You can also estimate the weight and cost of your print by describing the properties of your filament spool:
include __DIR__.'/vendor/autoload.php'; use Pyrech\GcodeEstimator\Estimator; use Pyrech\GcodeEstimator\Filament; $filament = new Filament( 1.75, // filament diameter in mm 1.24, // filament density in g/cm³ 750, // weight of the spool in g 25.99 // price of the spool (whatever your currency) ); $estimator = new Estimator(); $estimate = $estimator->estimate($absolutePathToGcode, $filament); $estimate->getLength(); // returns the length of filament used (in mm); $estimate->getWeight(); // returns the weight of filament used (in g); $estimate->getCost(); // returns the cost of filament used (in whatever currency you specified);
Further documentation
You can see the current and past versions using one of the following:
- the
git tagcommand - the releases page on Github
- the file listing the changes between versions
And finally some meta documentation:
Credits
License
GcodeEstimator is licensed under the MIT License - see the LICENSE file for details.
统计信息
- 总下载量: 587
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-20