Print at Apr 18, 2019 10:08:15 PM
Posted by hansmex at Feb 15, 2010 4:17:40 PM
Export OBJ without floor
Emmanuel:

Is it possible to add a (small?) feature?

When exporting a model with walls, SH3D automatically includes the floor. Is it possible to add a check box in the export window so that the floor is not included?

The advantages are:
- Avoid "floor collisions" when importing a model with a floor. (see example)
- It would make it easier to build models consisting of more than one floor.
- It would make it easier to build custom furniture using SH3D (which probably many people do).

Hans
----------------------------------------
Attachment spiral staircase.sh3d (142447 bytes) (Download count: 1263)


Posted by Puybaret at Feb 22, 2010 10:40:44 PM
Re: Export OBJ without floor
Reading version history again, I see that I programed Export to OBJ (version 1.4) before room's floor (version 1.5).
Then, as users can now create surfaces at floor level in Sweet Home 3D, I would suggest to simply remove this automatically computed floor in export to OBJ, instead of adding an option. What do you think?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Feb 23, 2010 12:13:43 AM
Re: Export OBJ without floor
Emmanuel:

Floors can only be applied to the ground level. So I think I would like to be able to export my "second floor object" WITH a floor texture. But what I don't like is that SH3D automatically inserts a rectangular floor that has the size of the largest objects. So, if a house has a bay window, not only does the bay window have a floor, but the entire side of the house gets an "external" floor that has the depth of the bay window and the length of the largest wall.

Using a textured box instead is not an option, I think: floor textures repeat, but object textures do not repeat.

Ideally, only user defined floors (meaning: rooms) should be included in the exported object.

By the way, thank you for the stream of new features. Not a day passes or you have a new version with new features! Applause!!

Hans

Posted by Puybaret at Feb 23, 2010 8:56:07 AM
Re: Export OBJ without floor
Hans,
Here is a simple tip to remove this rectangular floor in the current version:
1. Edit the generated OBJ file with any text editor
2. Search the first line starting by "g wall"
3. Remove all the lines that precede that line and start by a f letter
4. Save and import your edited OBJ file.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Feb 23, 2010 9:44:41 AM
Re: Export OBJ without floor
Emmanuel:

Thank you!
So, if I find "g wall" twenty times, only the first time I delete it, together with the preceding f-lines?

g wall_5_185; g wall_6_201; etc etc

The first instance has approx. 44 f-lines before it; the other ones only two f-lines.

Hans

Posted by Puybaret at Feb 23, 2010 10:05:48 AM
Re: Export OBJ without floor
Don't remove the line starting with "g wall", remove only the ones starting with a "f" and preceding that line.
A f-line defines a face and the number of f-lines to delete depends on the shape of the rooms you created. The simplest ground is a rectangle made of two triangles i.e. only two f-lines.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Feb 23, 2010 11:53:13 AM
Re: Export OBJ without floor
Emmanuel:

Let us assume that I delete ALL the f-lines from the OBJ-file. That means I would create an object that has no "bottom" faces, and therefore also doesn't have the unwanted "extra" floor.

The price is that I also lose those floors that I DO want to have.

If I were to create an in-between layer that consists only of the textured floors, then again I have the problem of the extra floor that follows the extreme points in the design. The only advantage would then be, that there are less floors, and it might be easier to find out which floor is the unwanted one.

I shall keep this in mind, and maybe experiment a bit.

Hans

Posted by Puybaret at Feb 23, 2010 1:16:10 PM
Re: Export OBJ without floor
I you remove all the f-lines from an OBJ file, you create an empty model! laughing
"f" means face not floor.
If you removed the f-lines I indicated to you, you won't remove the floor of the rooms you created with Create rooms tool.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Feb 23, 2010 2:43:42 PM
Re: Export OBJ without floor
Emmanuel:

I'm afraid I can't follow your explanation :-(

When I open a file, I find many-many lines that start with "g wall_xx_xx" where xx_xx are numbers. In that particular file the first "g wall" is preceded by 44 lines that start with "f". I assume those are the faces of the walls I have drawn at the start of the project.

All the other occurences of "g wall" are preceded by only 2 lines that start with "f".

So, how can I determine which f-lines to delete?
Should there be one (and one only) wall that starts with "g wall" and has no numbers following?

I don't have the patience to use the trial-and-error method and delete each (pair of) f-line(s) to find out which line is the unwanted floor. Sorry for that.

Hans

Posted by Puybaret at Feb 23, 2010 4:38:16 PM
Re: Export OBJ without floor
As I wrote before, remove only the f-lines before before the first "g wall" line.
For example, the file:

#
# Generated by Sweet Home 3D - mar. feb. 23 17:34:33 CET 2010
# http://www.sweethome3d.eu/
#
mtllib test.mtl
g ground_1
usemtl ground_1
v 0.0 0.0 -3.9999998
v 0.0 0.0 3.9999998
v 200.0 0.0 3.9999998
v 200.0 0.0 -3.9999998
f 1 2 3
f 1 3 4
g wall_1_5
usemtl wall_1_5
v 0.0 0.0 -3.9999998
v 0.0 0.0 0.0
v 0.0 250.0 0.0
v 0.0 250.0 -3.9999998
v 200.0 0.0 0.0
v 200.0 250.0 0.0
v 200.0 0.0 -3.9999998
v 200.0 250.0 -3.9999998
vn -1.0 0.0 0.0
vn 0.0 0.0 1.0
vn 1.0 0.0 0.0
vn 0.0 0.0 -1.0
vn 0.0 0.0 0.0
f 5//1 6//1 7//1 8//1
f 6//2 9//2 10//2 7//2
f 9//3 11//3 12//3 10//3
f 11//4 5//4 8//4 12//4
v 0.0 0.0 -3.9999998
v 0.0 0.0 0.0
v 200.0 0.0 0.0
v 200.0 0.0 -3.9999998
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 13//6 14//6 15//6
f 13//6 15//6 16//6
v 0.0 250.0 -3.9999998
v 0.0 250.0 0.0
v 200.0 250.0 0.0
v 200.0 250.0 -3.9999998
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 17//8 18//8 19//8
f 17//8 19//8 20//8
g wall_1_21
usemtl wall_1_5
v 0.0 0.0 0.0
v 0.0 0.0 3.9999998
v 0.0 250.0 3.9999998
v 0.0 250.0 0.0
v 200.0 0.0 3.9999998
v 200.0 250.0 3.9999998
v 200.0 0.0 0.0
v 200.0 250.0 0.0
vn -1.0 0.0 0.0
vn 0.0 0.0 1.0
vn 1.0 0.0 0.0
vn 0.0 0.0 -1.0
vn 0.0 0.0 0.0
f 21//10 22//10 23//10 24//10
f 22//11 25//11 26//11 23//11
f 25//12 27//12 28//12 26//12
f 27//13 21//13 24//13 28//13
v 0.0 0.0 0.0
v 0.0 0.0 3.9999998
v 200.0 0.0 3.9999998
v 200.0 0.0 0.0
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 29//15 30//15 31//15
f 29//15 31//15 32//15
v 0.0 250.0 0.0
v 0.0 250.0 3.9999998
v 200.0 250.0 3.9999998
v 200.0 250.0 0.0
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 33//17 34//17 35//17
f 33//17 35//17 36//17

should become:

#
# Generated by Sweet Home 3D - mar. feb. 23 17:34:33 CET 2010
# http://www.sweethome3d.eu/
#
mtllib test.mtl
g ground_1
usemtl ground_1
v 0.0 0.0 -3.9999998
v 0.0 0.0 3.9999998
v 200.0 0.0 3.9999998
v 200.0 0.0 -3.9999998
g wall_1_5
usemtl wall_1_5
v 0.0 0.0 -3.9999998
v 0.0 0.0 0.0
v 0.0 250.0 0.0
v 0.0 250.0 -3.9999998
v 200.0 0.0 0.0
v 200.0 250.0 0.0
v 200.0 0.0 -3.9999998
v 200.0 250.0 -3.9999998
vn -1.0 0.0 0.0
vn 0.0 0.0 1.0
vn 1.0 0.0 0.0
vn 0.0 0.0 -1.0
vn 0.0 0.0 0.0
f 5//1 6//1 7//1 8//1
f 6//2 9//2 10//2 7//2
f 9//3 11//3 12//3 10//3
f 11//4 5//4 8//4 12//4
v 0.0 0.0 -3.9999998
v 0.0 0.0 0.0
v 200.0 0.0 0.0
v 200.0 0.0 -3.9999998
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 13//6 14//6 15//6
f 13//6 15//6 16//6
v 0.0 250.0 -3.9999998
v 0.0 250.0 0.0
v 200.0 250.0 0.0
v 200.0 250.0 -3.9999998
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 17//8 18//8 19//8
f 17//8 19//8 20//8
g wall_1_21
usemtl wall_1_5
v 0.0 0.0 0.0
v 0.0 0.0 3.9999998
v 0.0 250.0 3.9999998
v 0.0 250.0 0.0
v 200.0 0.0 3.9999998
v 200.0 250.0 3.9999998
v 200.0 0.0 0.0
v 200.0 250.0 0.0
vn -1.0 0.0 0.0
vn 0.0 0.0 1.0
vn 1.0 0.0 0.0
vn 0.0 0.0 -1.0
vn 0.0 0.0 0.0
f 21//10 22//10 23//10 24//10
f 22//11 25//11 26//11 23//11
f 25//12 27//12 28//12 26//12
f 27//13 21//13 24//13 28//13
v 0.0 0.0 0.0
v 0.0 0.0 3.9999998
v 200.0 0.0 3.9999998
v 200.0 0.0 0.0
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 29//15 30//15 31//15
f 29//15 31//15 32//15
v 0.0 250.0 0.0
v 0.0 250.0 3.9999998
v 200.0 250.0 3.9999998
v 200.0 250.0 0.0
vn 0.0 1.0 0.0
vn 0.0 0.0 0.0
f 33//17 34//17 35//17
f 33//17 35//17 36//17

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Feb 24, 2010 2:33:06 PM
Re: Export OBJ without floor
Emmanuel:

I created a completely new design part and exported it as OBJ. Immediately I edited it and indeed (to my surprise) there were only TWO f-lines before the first g-wall. I deleted those and I now have an imported object without a floor.

Thank you for your patience.

Hans

Posted by Puybaret at Apr 16, 2010 9:37:30 PM
Re: Export OBJ without floor
I just released a new plug-in that allows to copy the selection as a new piece of furniture into clipboard.
This plug-in is available at http://www.sweethome3d.eu/plugins/CopyAsNewFurniturePlugin-1.0.sh3p

Quick user guide:
- Install plug-in,
- Select in the plan the walls, rooms and furniture you want to group as a new piece of furniture,
- Choose Tools > Copy as new furniture,
- Choose Edit > Paste to paste the new piece of furniture in the existing home or an other home.

I hope it will satisfy your needs. smile

Note:
This plug-in was updated to version 1.1 on December 30, 2010
This plug-in was updated to version 1.2 on February 4, 2015
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by hansmex at Apr 17, 2010 2:35:07 PM
Re: Export OBJ without floor
Emmanuel:

Nice feature, thanks a lot.

It's very nice to be able to export/use a model without the extra floor. However... it's still a bit buggy.

(1) It doesn't work correctly with the sh3d.jnlp version. First time I tried it asked for a browser location, the second time it dodn't work at all.

(2) The installed version of SH3D works correctly. However, it seems you changed something in the coding of the Export to OBJ format routine. The quality of the rendering of the exported object is much lower than the quality of the original. And the applied texture isn't correct on at least one side of the combined object. It doesn't matter whether you use Tools --> Copy or 3D View --> Export , both give exactly the same result.




Hans

Posted by Puybaret at Apr 17, 2010 3:03:37 PM
Re: Export OBJ without floor
Thank you for your tests. smile

(1) It doesn't work correctly with the sh3d.jnlp version. First time I tried it asked for a browser location, the second time it dodn't work at all.
This plug-in can't work with Java Web Start (JNLP) version of Sweet Home 3D. Normally, a message explaining this is supposed to appear, but I forgot to test that. I fixed it.


(2) it seems you changed something in the coding of the Export to OBJ format routine.
This bug already existed when you exported/imported manually (this new plug-in just automates this process).
It's the same bug as the one Yafeng reported.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by Puybaret at May 26, 2010 4:24:39 PM
Re: Export OBJ without floor
The bug about textures change mentioned above was fixed in the version 2.4.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer