使用composer安装chubv/php-stl包
<?php require_once 'vendor/autoload.php'; use PHPSTL\Handler\VolumeHandler; use PHPSTL\Handler\SurfaceHandler; use PHPSTL\Reader\STLReader; $reader = new STLReader(); $reader = $reader->forFile('./111.stl'); $handler = $reader->setHandler(new VolumeHandler()); $volume = $reader->readModel(); $handler = $reader->setHandler(new SurfaceHandler()); $area = $reader->readModel(); var_dump($area);die;
标签:readModel,area,stl,STL,reader,php,setHandler From: https://www.cnblogs.com/we-jack/p/17817674.html