WARP-LAB / files_3dmodelviewer

3D Model Viewer for Nextcloud
GNU Affero General Public License v3.0
31 stars 6 forks source link

Add support for sh3d (Sweet Home 3D) format #3

Closed justinlimbo closed 1 year ago

justinlimbo commented 1 year ago

Any chance to add support for the .sh3d format from the open source software Sweet Home 3D?

kroko commented 1 year ago

TL;DR

1) A better way to support sh3d IMHO is a separate application, that would mirror Sweet Home 3D Online Manager. 3D view panel, plan view panel, inventory etc. 2) In order to view sh3d 3D model in this app, three.js loader for sh3d is needed (either sh3d to raw three.js structures or middleware that converts sh3d to already supported format).


My two cents.

1) The first suggestion would be for you to approach devs (or maybe you are involved yourself) and ask, if they would be interested integrating it within Nextcloud. Nextcloud Draw.io / Diagrams.net integration app is a good example. The structure of such integration app is done by iframing existing Sweet Home 3D Online Manager and passing file URL (which would demand some coding) that has to be viewed/edited. If some backend is needed, it is theirs (and unless YOLO, then authorisation, rate limiting would be needed). There are some integrations apps such as CADViewer which even ship PHP + binary backend. I mean, it is a non issue, if Nextcloud admin needs the support, the app can be "more than one click to install away". Stuff in Nextcloud like Collabora, TURN also are not one click away, Sweet Home 3D might state Java as requirement on Nextcloud server, why not.

2) The second suggestion. I took a quick look at https://sourceforge.net/p/sweethome3d/code/HEAD/tree/trunk/SweetHome3DJS/. HTML5 frontend + Java backend. I did not dig that deep in order to check if sh3d file is parsed and fed to GL buffers only using frontend (JavaScript) or backend is involved (Java), but from what I saw IMHO frontend is custom rolled WebGL stuff. You could approach Sweet Home 3D devs and ask them to create three.js loader, that takes sh3d stream, parses it (they know the schema inside out) using JavaScript and represents it as three.js demands. That would make their file format accessible broadly including this app, as it uses three.js under the hood. Moreover, sh3d probably has exporters, that can be reworked to convert sh3d using JavaScript to any of already supported formats in three.js (i.e.,sh3d to obj+mtl), producing middleware, as the resulting buffer could be then fed to the existing importer of choice. Note, that the context here is sh3d viewer, which allows metadata loss.

kroko commented 1 year ago

@justinlimbo given no response, closing it.