Skip to content

Small http render sever : send a 3d (stl, ctm, obj), get a nice static render back !

License

Notifications You must be signed in to change notification settings

usco/thumbnail-render-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small http render sever : send a 3d (stl, ctm, obj), get a nice static render back !

GitHub version experimental Build Status

Table of Contents

Background

  • server to generate static images from a given 3d model

Note: currently you need to have an opengl capable (but it can be headless) machine to be able to generate the images : uses xvfb-run under the hood, when it is available, but can run without it

Installation

Not yet on NPM , will be soon

git clone [email protected]:usco/thumbnail-render-server.git

go into the clone folder and then

npm install

Usage

###Server:

Note : default port is 2210

Also: the npm start command will run the server wraped by the forever tool, to ensure continued uptime

for production environments

  npm start -- port=5252

You can stop the server at anytime using

  npm stop

if you only want to do small tests, you can launch the server without forever:

  node launch-server.js

managing existing running instances

List existing processes

  node_modules/forever/bin/forever list

Stop given process (with given ID)

  node_modules/forever/bin/forever stop ID

and then restart the correct one from the working directory using npm run start (see previous instructions)

###how to use as client:

  • do a POST request with following parameters
    • resolution : in the form WIDTHxHEIGHT (the x is important)
    • camera position : [x,y,z] this the basis position (orbit camera) , and then a 'zoom to fit' algorithm is applied to try to fit as much of the object on screen as possible
    • inputFile : your STL, OBJ, CTM file (3MF coming up next, GCODE in a few weeks)

IMPORTANT ! you MUST use form-data to send your data, and nothing else like x-www-form-urlencoded etc

IMPORTANT ! NO compression & NO caching for now , so it does NOT keep files around between requests, please experiment with smaller files first , even if it can handle quite big ones too,( I tried 80MB max , that does take a while), I'll try to add at least some form of uploaded file caching soon

For clarity I included a screenshot of the parameters & a result in postman very practical for testing your camera angles

Contribute

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

The MIT License (MIT) (unless specified otherwise)

About

Small http render sever : send a 3d (stl, ctm, obj), get a nice static render back !

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published