pyrech/gcode-estimator
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.
pyrech/gcode-estimator 适用场景与选型建议
pyrech/gcode-estimator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 669 次下载、GitHub Stars 达 15, 最近一次更新时间为 2020 年 02 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「3d」 「cost」 「printer」 「length」 「height」 「estimate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pyrech/gcode-estimator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pyrech/gcode-estimator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pyrech/gcode-estimator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHPUnit result printer, variant of the TestDoxCli Printer, that reduces the test failure message size for better readability
Displays cost/size of each composer package installed.
A collection of helpers to handle SMS messages used in several projects around SMSO
query cloud cost information
Customize discussion title length.
The universal PHP library to convert any values and measures
统计信息
- 总下载量: 669
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-20