Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2131 times and has 2 replies Next Thread
buzzz
Member



FR
Joined: Jun 25, 2017
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Build full JS version

Hi All,

So my objective is to create a full JS version of Sweethome.
Basically, my need corresponds to the demo version here :
https://www.sweethome3d.com/SweetHome3DJSOnline.jsp

plus 2 options to save and load project from my local disk.

From what I read, this option has not been considered at present time.
So, from what I see:
- first option is to start from the demo and try to add save/load fonctionalities
- second option : start from the war version and remove the call to the server.

Both sounds difficult, I really do not know what is the less risky option.

Thx for help
[Apr 16, 2023, 1:40:06 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9141
Status: Offline
Reply to this Post  Reply with Quote 
Re: Build full JS version

Doesn't these options already exist as the import and export features in the page https://www.sweethome3d.com/fr/SweetHome3DOnlineManager.jsp for identified users?

If you want to remove the use of a server, reading a file from the local disk can be done with HomeRecorder.readHome method with a BlobURLContent built from a file chosen by the user with an <input type="file"> HTML element (you'll find examples in JSViewFactory.js).
But saving is another story! Even if I recently added the DirectHomeRecorder class to generate a Home.xml entry in a ZIP file, there's still no method to generate a SH3X file containing all the resources it needs (images and 3D models), like DefaultHomeOutputStream Java class (a SH3X file is like a SH3D file bu without the old Home serialized entry).
By the way, as far as I know, there's no function in JavaScript to write in a local file from a browser. You can write only in local storage or indexedDB.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Apr 17, 2023, 6:48:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Member



FR
Joined: Jun 25, 2017
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Re: Build full JS version

I see the 9 example files on the demo. They contain http links to zipped .obj files on the server. Why not. It limits the size of the sh3x files !

There is no function in javascript to save to a specific folder on disk. But it is easy to save a file in the download directory. Just remain to move the saved file after that.
[Apr 17, 2023, 10:15:25 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved