StandardCyborg / StandardCyborgCocoa

Everything you need for 3D scanning on iOS
https://www.standardcyborg.com
Other
143 stars 49 forks source link

Update SCNetworking to use ServerScene instead of ServerScan #12

Closed irtemed88 closed 4 years ago

irtemed88 commented 4 years ago

This is a conceptual update, but in a nutshell the transition from Scan => Scene is essentially a transition from .ply => .gltf file types. There are also some corresponding backend API changes that must be reflected in the SCNetworking related to sync and also how we store Scenes on the device.

The biggest change is in ServerSyncEngineLocalDataSource. All instances of ServerScan have been replaced with ServerScene. Take special note of the change func allServerScans() -> [ServerScan] which is now func localSceneFiles() -> [LocalSceneFile].

To avoid mapping the entirety of the backend’s data model in SCNetworking the concept of a LocalSceneFile has been introduced. LocalSceneFile represents the data necessary to upload a new scene to the server (think of it as a pared-down version of a ServerScene file). Any scene data collected on the device that has not yet been uploaded to the server should be represented as a local scene file. There’s no concept of versioning scenes locally which greatly simplifies the data model.

Automatic download of scene files (metadata is still downloaded) has also been removed from sync logic. Since these files can be ~30Mb the decision was made to defer the download of the files and save a user’s bandwidth.

ServerScene is also now stricter in the properties it requires. This decision was made after discussing the backend data model and should greatly simplify sync and app logic.