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: 11
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6211 times and has 10 replies Next Thread
atinesh
Newbie



India
Joined: Aug 31, 2018
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
confused How to provide floor plan parameters in a file

Hello friends,

We are working on a project where we need to tune building parameters (mentioned below) by some algorithms and visualize it's CAD output. Building parameters will be defined in the file such as .txt, .csv, etc. we just need to import these parameters into CAD software and visualize it. We searched a lot and came across Sweet Home 3D , we tried exploring developers guide section but cannot decide whether it can be done or not. Can we achieve this task with Sweet Home 3D , If not then which other software will be helpful for this task. Any suggestion would be of great help, Thank you.

Building Parameters:

  • Floor Plan Area
  • Wall Position
  • Wall Thickness
  • Door & Window Size
  • Door & Window Position
  • etc.

Note: We are not concerned about furniture's
[Aug 31, 2018, 1:12:13 PM] 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: How to provide floor plan parameters in a file

You could create a XML file that respects Sweet Home 3D DTD, then open it with SweetHome3D.
Here's a simple file which describes 4 walls, a room, a door and a window:

<?xml version='1.0'?>
<home version='5500' name='Simple.sh3d'>
<doorOrWindow name='Door' catalogId='eTeks#door'
model='com/eteks/sweethome3d/io/resources/door.obj'
icon='com/eteks/sweethome3d/io/resources/door.png'
x='2.5' y='75.3' angle='4.712389' width='91.5' depth='14.5' height='208.5'
modelMirrored='true' movable='false' cutOutShape='M0,0 v1 h1 v-1 z' wallCutOutOnBothSides='true'>
<sash xAxis='0.05464481' yAxis='0.5862069' width='0.89071035' startAngle='0.0' endAngle='-1.5707964'/>
</doorOrWindow>
<doorOrWindow name='Window' catalogId='eTeks#window85x163'
model='com/eteks/sweethome3d/io/resources/window85x163.obj'
icon='com/eteks/sweethome3d/io/resources/window85x163.png'
x='209.0' y='298.6' elevation='47.0' angle='3.1415927' width='91.0' depth='10.2' height='174.0'
movable='false' cutOutShape='M0,0 v1 h1 v-1 z' wallCutOutOnBothSides='true'>
<sash xAxis='0.021978023' yAxis='0.7352941' width='0.94505495' startAngle='0.0' endAngle='-1.5707964'/>
</doorOrWindow>
<wall id='wall0' wallAtStart='wall3' wallAtEnd='wall1'
xStart='0.0' yStart='0.0' xEnd='300.0' yEnd='0.0' height='250.0' thickness='7.5'/>
<wall id='wall1' wallAtStart='wall0' wallAtEnd='wall2'
xStart='300.0' yStart='0.0' xEnd='300.0' yEnd='300.0' height='250.0' thickness='7.5'/>
<wall id='wall2' wallAtStart='wall1' wallAtEnd='wall3'
xStart='300.0' yStart='300.0' xEnd='0.0' yEnd='300.0' height='250.0' thickness='7.5'/>
<wall id='wall3' wallAtStart='wall2' wallAtEnd='wall0'
xStart='0.0' yStart='300.0' xEnd='0.0' yEnd='0.0' height='250.0' thickness='7.5'/>
<room areaVisible='true'>
<point x='296.25' y='3.75'/>
<point x='296.25' y='296.25'/>
<point x='3.75' y='296.25'/>
<point x='3.75' y='3.75'/>
</room>
</home>

Don't forget that the coordinates of a wall or a door/window are measured in their middle.
For doors and windows, you can reference files available in the program and listed here.
Looking at demos and files generated by Sweet Home 3D (the XML is stored in the Home.xml entry of a SH3D zip file) will give you plenty of information if needed.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Sep 1, 2018, 5:11:56 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
atinesh
Newbie



India
Joined: Aug 31, 2018
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to provide floor plan parameters in a file

You could create a XML file that respects Sweet Home 3D DTD, then open it with SweetHome3D.
Here's a simple file which describes 4 walls, a room, a door and a window:

...


Don't forget that the coordinates of a wall or a door/window are measured in their middle.
For doors and windows, you can reference files available in the program and listed here.
Looking at demos and files generated by Sweet Home 3D (the XML is stored in the Home.xml entry of a SH3D zip file) will give you plenty of information if needed.


Hello Puybaret, Thanks for the response. How can I load this .xml in sweethome3D, I couldn't find any option in the menu.
[Sep 2, 2018, 5:08:50 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: How to provide floor plan parameters in a file

The simplest way is probably to use a .sh3d extension for your file instead .xml, so the open file dialog will let you select it. You can also use a command line tu run Sweet Home 3D application followed by -open parameter and the file you want:
path/to/SweetHome3D.exe -open path/to/project.sh3d

But caution, if you will save, the generated SH3D file will be at default file format, i.e. a zip file containing a Home.xml entry and other entries for images and 3D models.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Sep 2, 2018, 1:52:23 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
fritzz
Newbie



US
Joined: Feb 21, 2020
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to provide floor plan parameters in a file

Exactly the info I was seeking and works great...except for textures! Once added to an open file, textures are saved in Home.xml (of the .sh3d zip) perfectly. But the program seems unable to find even its own textures and refuses to open any xml that contains one.

Is there a trick to make this work?

To replicate, create a new file, add walls and rooms with colors only, save, open the .sh3d zip and extract Home.xml. See that the program opens the .xml as expected.

Now repeat the above steps but add just one texture before saving. The program will then throw an error instead of opening the .xml.

To verify the texture is the cause, manually edit the .xml to remove the texture and see the program return to opening the file normally.

I've done everything obvious to help the program find its own texture, but nothing has worked. This is the only obstacle blocking the usage of spreadsheets for composition.

Longtime sh3d tinkerer (and admirer), hope to be a hardcore user shortly.
[Feb 21, 2020, 9:30:23 PM] 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: How to provide floor plan parameters in a file

Welcome on the forum, Fritzz.

If you opened a .sh3d file with a zip utility, you may have noticed it contains a file named ContentDigests too. This text file helps to check the consistency of a .sh3d file at opening time. When you externally change the resources referenced by Home.xml contained in a .sh3d file, you should remove the existing ContentDigests. As it’s optional, you will just lose the consistency check at opening, that’s all!

If you want to directly open a XML file without its texture images stored in a .sh3d file, you’ll have to indicate the catalogId and image attributes of its textures from existing values found in the default catalog or in the PluginTexturesCatalog.properties file of other texture libraries. Just pay attention to avoid a leading slash / in the value of the image attribute (like I did in the model and icon attributes of the example I posted last time).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Feb 22, 2020, 8:15:34 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
fritzz
Newbie



US
Joined: Feb 21, 2020
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to provide floor plan parameters in a file

Thanks, great community here. And thanks for the guidance; here's what I've found:

Success opening the plain .xml, but only when 'image=' value matches the spec on the default catalog page you linked. Ex. "/com/eteks/sweethome3d/io/resources/textures/smallRedBricks.jpg"

Important to note: The leading slash has to be removed.

This makes it possible to read, modify and write XMLs using 'built-in' images, many thanks.

But still no joy using arbitrary images. Tried all kinds of things, from using fully-qualified filenames to playing with the ContentDigests and Home files -- just can't get the program to open the .xml when an arbitrary image is specified. Ex.:

Do as above w/ texture, save and close, extract Home.xml and file '0', rename '0' as arbtex.jpg (or anything), and manually edit the .xml to match. It will not open! Nor will it open using any other texture image. Please some more magic to make this work?
[Feb 22, 2020, 4:02:35 PM] 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: How to provide floor plan parameters in a file

Great you could make it work partly!

Here's a SH3D file where I replaced the image "2" by "sea.jpg", used as a texture of a simple box.
Then I removed the obsolete catalogId attribute, removed ContentDigests and Home files, saved the SH3D file and it worked like expected. You're probably very close to a working solution.

Maybe we could get more information about the opening error, if you shared the error logs: just run the program from a Terminal window to get it (under Windows, add 2>log.txt after SweetHome3D.exe to send error logs to the file log.txt).
----------------------------------------
Attachment BoxWithManuallySetTexture.sh3d (14395 bytes) (Download count: 105) (Box with a manually set texture)

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Feb 22, 2020, 5:41:21 PM] 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: How to provide floor plan parameters in a file

And here's a home XML file renamed with a SH3D extension, to be able to open it in Sweet Home 3D.
This file references a box of the default catalog and a pine texture found in Contributions.sh3t textures library imported in Sweet Home 3D. Contributions.sh3t is available in this ZIP file.
As explained previously, I set catalogId attribute with "Puybaret#pine" and image attribute with "contributions/pine.jpg", these values coming from the properties id#7 and image#7 in PluginTexturesCatalog.properties of Contributions.sh3t file.
----------------------------------------
Attachment BoxWithTextureSetFromContributionsLibrary.sh3d (1330 bytes) (Download count: 85) (Box with a texture set from Contributions.sh3t library)

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Feb 22, 2020, 5:58:36 PM] 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: How to provide floor plan parameters in a file

Finally, note that the image, icon, planIcon and model attributes can also be URLs, like in the attached example showing Sweet Home 3D logo on the texturable box referenced on sweethome3d.com server. When you want to reference an entry within a zip file, you can use jar: protocol with the syntax jar:urlZipFile!/entry

Please, don't abuse of URLs referencing sweethome3d.com!
----------------------------------------
Attachment BoxWithTextureSetFromImageURL.sh3d (1384 bytes) (Download count: 77) (Box with texture set from image URL)

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Feb 22, 2020, 6:42:54 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ 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