/** * */ public function testAddObject() { $object = new AsciiSTL('./tests/test.stl'); $this->instance->addObject($object->asObject()); $this->instance->addObject($object->asObject()); $this->assertInstanceOf(Object::class, $this->instance->objects[1]); }
/** * */ public function testRenderObjects() { $object = new AsciiSTL('./tests/test.stl'); $this->scene->addObject($object->asObject()); $this->scene->addObject($object->asObject()); $this->scene->addObject($object->asObject()); $this->instance->render('./tests/test.png', $style = null, $exporter = null); $this->assertFileExists('./tests/test.png'); unlink('./tests/test.png'); }
/** * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $stl = new AsciiSTL($input->getArgument('stl')); $scene = new Scene(); $scene->addObject((new Grid())->asObject(new Color('#1F1F1F'))); $scene->addObject((new Axis())->asObject(new Color('#00FF00'))); $scene->addObject($stl->asObject()->position(0, 10000, 0)->rotate(0, 0, 180)); $scene->camera->position(0, 10000, -23000)->rotate(rand(-20, 20), rand(-20, 20), 0); (new Renderer($scene))->render($input->getArgument('output')); }