building a 3d file import service for a three.js web application
TRANSCRIPT
Building a 3D file import service for a three.js web application
Sander Schaminée
CloudCities An intuitive online tool to view, combine and discuss your 3D plans and models.
‣ 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)
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
‣ 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
‣ 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
‣ 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
‣ 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
‣ 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
‣ 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
‣ 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
Workspace
Workspace
‣ Data preparation per format
Workspace
‣ Generic parts (R/W)
Thank youlinkedin.com/in/sanderschaminee