|
Posted by Puybaret
at Sep 1, 2018, 5:11:56 PM
|
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 creator
|