chubv / php-stl
Library to parse STL file and get some statistics of the model
Installs: 21 024
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 6
Forks: 8
Open Issues: 7
Requires
- php: ^7.3 || ^8.0
Requires (Dev)
- nexusphp/tachycardia: ^1.0
- php-coveralls/php-coveralls: ^2.4
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-09 23:06:25 UTC
README
This repository contains code for handling 3D models saved in STL format.
How to get it
The suggested installation method is via composer.
Add a dependency on chubv/php-stl
to your project's composer.json
file.
Usage
To get the model build the Reader
and read the model from file
$model = STLReader::forFile(__DIR__ . '/stls/text.stl')->readModel();
You can use VolumeHandler
to calculate volume of 3D model without STLModel
object construction
(memory consumption is proportional to model size)
or write your own handler by implementing HandlerInterface
and setting it to reader.
$reader = STLReader::forFile(__DIR__ . '/stls/text.stl'); $reader->setHandler(new VolumeHandler()); $volume = $reader->readModel();
Tests
The PHPUnit version to be used is the one installed as a dev- dependency via composer:
$ ./vendor/bin/phpunit
License
It's under MIT. Look at LICENSE file.
Contributing
Feel free to make pull requests or create issues. You can also contact me via e-mail v[at]chub.com.ua