building a 3d file import service for a three.js web application

16
Building a 3D file import service for a three.js web application Sander Schaminée

Upload: safe-software

Post on 21-Jan-2018

329 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Building a 3D File Import Service for a Three.js Web Application

Building a 3D file import service for a three.js web application

Sander Schaminée

Page 2: Building a 3D File Import Service for a Three.js Web Application

CloudCities An intuitive online tool to view, combine and discuss your 3D plans and models.

Page 4: Building a 3D File Import Service for a Three.js Web Application

‣ Import 3WS initially, later SketchUp & Google Earth ‣ Easily add new formats in the future ‣ Ability to deal with most coordinate systems ‣ Cloud-based service ‣ Write to files and NoSQL database ‣ Web-ready 3D output ‣ Quick first release

Requirements (2015)

Page 5: Building a 3D File Import Service for a Three.js Web Application

System Architecture

Backend (Amazon Web Services)

EC2 Windows Instances

Node.js Backend (Heroku)

FME ServerCore

Frontend

CloudWatch

SQS

Auto Scaling Subnets

Engines

completed job IDcompleted job ID

job submit

read/write

https job submit and status

write

notification

S3 Storage

distribute

read

MongoDB (mLab)

r/wread/write

REST API

Lambda

status polling

CDN77

Page 6: Building a 3D File Import Service for a Three.js Web Application

‣ Job tags for each tier ‣ Not “portable” ‣ Configuration limitations

System Architecture

FME ServerCore

Development

Engine(s)

FME ServerCore

Stage

Engine(s)

FME ServerCore

Production

Engine(s)

Development

Engine(s)

Stage

Engine(s)

FME ServerCore

Production

Engine(s)

Ideal SituationImplemented

‣ No job tags required ‣ Truly scalable ‣ Requires more licenses

Page 7: Building a 3D File Import Service for a Three.js Web Application

‣ Esri 3D Web Scene (.3ws) ‣ Google Earth (.kmz) ‣ Trimble SketchUp (.skp) ‣ Wavefront OBJ (.obj) ‣ COLLADA (.dae) ‣ Autodesk FBX (.fbx) ‣ Industry Foundation Classes (.ifc)

Inputs

© 3D Library / Studio Graphy

Page 8: Building a 3D File Import Service for a Three.js Web Application

‣ Objects stored as JSON ‣ Loose specification ‣ Indexed buffer geometries ‣ Square textures (power of 2) ‣ No spatial reference‣ Image files and JSON

objects stored separately

Output: Three.js

Page 9: Building a 3D File Import Service for a Three.js Web Application

‣ Objects stored as JSON ‣ Loose specification ‣ Indexed buffer geometries ‣ Square textures (power of 2) ‣ No spatial reference‣ Image files and JSON

objects stored separately

Output: Three.js

Page 10: Building a 3D File Import Service for a Three.js Web Application

‣ MEAN stack ‣ NoSQL, schemaless (JSON) ‣ Limited spatial capabilities ‣ R/W support since FME 2016: ‣ Replica sets not supported ‣ No validation options ‣ Python to the rescue: ‣ MongoEngine

Output: MongoDB

© MongoDB

Page 11: Building a 3D File Import Service for a Three.js Web Application

‣ Global Python class for logging ‣ StatusReporter custom transformer in workspace ‣ Class called directly by PythonCaller scripts ‣ Reporter.py: ‣ Logs issues in FME log file ‣ Adds issue to dictionary (type, count) ‣ Writes errors and warnings to DB on shutdown

‣ Severe errors sent to

Logging

Page 12: Building a 3D File Import Service for a Three.js Web Application

‣ Agile development (Bitbucket, JIRA) ‣ Python unit tests (Nose, Jenkins) ‣ No integration tests FME + Python 2.7 ☹ ‣ Very hard to test all problems related to 3D, character

encoding, etc.: ‣ Hotfixes when customer reported issue ‣ Pull requests for logged issues

Development & Testing

Page 13: Building a 3D File Import Service for a Three.js Web Application

Workspace

Page 14: Building a 3D File Import Service for a Three.js Web Application

Workspace

‣ Data preparation per format

Page 15: Building a 3D File Import Service for a Three.js Web Application

Workspace

‣ Generic parts (R/W)

Page 16: Building a 3D File Import Service for a Three.js Web Application

Thank youlinkedin.com/in/sanderschaminee