Go to file
buttle 04d04ea4ba fixed path 2021-06-20 19:58:21 +02:00
objects adds preview image to gltf 2021-06-20 16:18:51 +02:00
static moved hiden div to inline css 2021-06-20 17:53:15 +02:00
utils fixed path 2021-06-20 19:58:21 +02:00
views fixed path 2021-06-20 19:58:21 +02:00
.gitignore first commit 2021-06-05 18:59:19 +02:00
LICENSE first commit 2021-06-05 18:59:19 +02:00
README.md adds equirectangular background to glft models 2021-06-20 13:56:30 +02:00
app.py fixes path 2021-06-20 19:34:18 +02:00
run.sh first commit 2021-06-05 18:59:19 +02:00

README.md

3D tester

A utility to test 3D models.

Install on your PC

First make sure you have python3 installed

Then..

git clone https://git.hangar.org/arcHIVE-tech/3D-tester.git 3Dtester
cd 3D-tester
python3 -m venv ./venv
source ./venv/bin/activate
pip install bottle
chmod +x run.sh

Usage

cd 3D-tester
./run.sh

Now you can browse to http://localhost:8080

Adding 3D models

Add your 3D models to the ./objects folder. Create subdirectories as needed.

Install on a server

git clone https://git.hangar.org/arcHIVE-tech/3D-tester.git /opt/3Dtester
cd /opt/3Dtester
python3 -m venv ./venv
source ./venv/bin/activate
pip install bottle
pip install gunicorn

Gunicorn

Gunicorn will server the python app

Create and edit the file ./3Dtester/gunicorn.py

pythonpath = '/opt/3Dtester'
command = './venv/bin/gunicorn'
bind = '127.0.0.1:8080'
workers = 3
user = 'www-data'

You can test the installation

gunicorn -c ./gunicorn.py app:app

Supervisor

We need something to keep Gunicorn going on system reboots, start, stop, etc.

Instead of systemd ...

apt-get install supervisor

Edit /etc/supervisor/conf.d/3Dtester.conf

[program:3Dtester]
command = /opt/3Dtester/venv/bin/gunicorn -c /opt/3Dtester/gunicorn.py app:app
directory = /opt/3Dtester
user = www-data

Restart supervisor

systemctl restart supervisor

Now you can do things like

supervisorctl status 3Dtester
supervisorctl stop 3Dtester
supervisorctl start 3Dtester
supervisorctl restart 3Dtester

Check that we are listening on the port 8080

netstat -tunpla | grep 8080

apache2

<VirtualHost *:80>
    ServerName my.domain.com
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
</VirtualHost>

Updating

cd 3D-tester
git pull origin main

nextcloud

We upload the 3D models to our nextcloud server. That server is on the same machine as 3Dtester.

To make the uploaded files available we bind the nextcloud directory with a mount point

mkdir /opt/3Dtester/objects/cloud

Edit /etc/fstab

/var/www/nextcloud/data/a_user/files/path/to/3D/samples /opt/3Dtester/objects/cloud/ none bind,ro,0 0

Now we can mount it

mount /opt/3Dtester/objects/cloud