3D House and Furniture creator with Streamlit

A simple guide to create a house and furniture creator software with Streamlit

Nicola Landro
2 min readMar 1, 2024

Recently SweetHome3D have a web version that we can read at Draw House and Plan Furnitures web with Open Source article. Thanks to that I will create a Streamlit liberary to use Sweet Home 3D.

It can be finded in that codbase.

In this article we will see how to use that library.

Start with install it

pip install streamlit-sweethome3d

Streamlit code main.py :

import streamlit as st
from streamlit_sweethome3d import streamlit_sweethome3d

# wide screen is preferable to see all button to edit the 3D
st.set_page_config(layout="wide")

import json

in_state = {
"homes": [
{
"walls": [
[0, 180, 0, 400, 20, 250], # params: x1, y1 x2, y2, spessore, altezza
[350, 180, 350, 400, 20, 250],
[0-10, 180, 350+10, 180, 20, 250]
],
"rooms": [
[[0,180], [350, 180], [350, 400], [0, 400]] # points
],
"furnitures": [
{
"id": "eTeks#shower", # https://gitlab.com/nicolalandro/streamlit-sweethome3d/-/blob/main/FURNITURE_DOC.md
"x": 50,
"y": 230,
"elevation": 0,
}
]
}
]
}

out_state = streamlit_sweethome3d(state = in_state, out_state=True)

col1, col2 = st.columns(2)
with col1:
st.text('in state')
st.code(json.dumps(in_state, indent=1))
with col2:
st.text('out state')
st.code(json.dumps(out_state, indent=1))

Run using streamlit run main.py

So you can get into the streamlit_sweethome3d command the json with walls, rooms and furniture information and receiving also a json with modification that appen from the GUI.

Conclusion

In that way is easy to add into streamlit an house creator to made prototipe with that features. For example it can give the tools to made a new AI chat that help to create house with sweethome3D that can enable to create reinforcement learning trough human feedback software.
Thanks to open source to get easly the creation of tools like that. Contribute!

--

--

Nicola Landro
Nicola Landro

Written by Nicola Landro

Linux user and Open Source fun. Deep learning PhD. , Full stack web developer, Mobile developer, cloud engineer and Musitian.

No responses yet