soiposervices/laravel-assimp2amc

dev-master 2021-03-24 22:05 UTC

This package is auto-updated.

Last update: 2024-04-25 06:14:50 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package can be used to verify that in a given folder, the .obj has all the required files to be run as a binary 3d model.

Compile

docker run -v "$PWD/vendor/artglass/assimp2amc/assimp2amc:/home" -w "/home" -i -t mcr.microsoft.com/dotnet/sdk:5.0-alpine dotnet publish -r linux-x64 -p:PublishSingleFile=true --self-contained true

The compiled file will be stored in /vendor/artglass/assimp2amc/assimp2amc/bin/Debug/netcoreapp3.1/linux-x64/publish

cp $PWD/vendor/artglass/assimp2amc/assimp2amc/bin/Debug/netcoreapp3.1/linux-x64/publish/assimp2amc .

or simply run:

composer compile

Run assimp2amc on obj

docker run -v "$PWD:/home" -w "/home" -i -t alpine ./assimp2amc -c src/ExampleModelData/851e122f30504b90ae495fe567342936.obj

Installation

You can install the package via composer:

composer require soiposervices/assimp2amc

You can publish and run the migrations with:

php artisan vendor:publish --provider="SoipoServices\Assimp2AmcServiceProvider" --tag="assimp2amc-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="SoipoServices\Assimp2AmcServiceProvider" --tag="assimp2amc-config"

This is the contents of the published config file:

return [
    'bash_script' => './',
    'path_to_executable' => 'src/assimp2amcosx'
];

Usage

$laravel-assimp2amc = new SoipoServices\Assimp2Amc();
echo $laravel-assimp2amc->run('src/ExampleModelData/851e122f30504b90ae495fe567342936.obj');
Assimp2Amc::run('src/ExampleModelData/851e122f30504b90ae495fe567342936.obj');

Testing

Make sure you compile first in order to have the excutable in the src folder

composer compile

or for mac:

composer compile-osx

You should also have a folder containing 3d model .obj file with its assets in a folder called ExampleModelData in the src folder.

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.