Spaces:
Runtime error
Runtime error
new deploy
Browse files
app.py
CHANGED
@@ -1,6 +1,40 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit_sweethome3d import streamlit_sweethome3d
|
3 |
|
|
|
|
|
4 |
st.header("Sweet Home 3D")
|
5 |
st.markdown("This is an example of [streamlit_sweethome3d](https://gitlab.com/nicolalandro/streamlit-sweethome3d) plugin.")
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit_sweethome3d import streamlit_sweethome3d
|
3 |
|
4 |
+
import json
|
5 |
+
|
6 |
st.header("Sweet Home 3D")
|
7 |
st.markdown("This is an example of [streamlit_sweethome3d](https://gitlab.com/nicolalandro/streamlit-sweethome3d) plugin.")
|
8 |
+
|
9 |
+
in_state = {
|
10 |
+
"homes": [
|
11 |
+
{
|
12 |
+
"walls": [
|
13 |
+
[0, 180, 0, 400, 20, 250], # params: x1, y1 x2, y2, spessore, altezza
|
14 |
+
[350, 180, 350, 400, 20, 250],
|
15 |
+
[0-10, 180, 350+10, 180, 20, 250]
|
16 |
+
],
|
17 |
+
"rooms": [
|
18 |
+
[[0,180], [350, 180], [350, 400], [0, 400]] # points
|
19 |
+
],
|
20 |
+
"furnitures": [
|
21 |
+
{
|
22 |
+
"id": "eTeks#shower",
|
23 |
+
"x": 50,
|
24 |
+
"y": 230,
|
25 |
+
"elevation": 0,
|
26 |
+
}
|
27 |
+
]
|
28 |
+
}
|
29 |
+
]
|
30 |
+
}
|
31 |
+
|
32 |
+
out_state = streamlit_sweethome3d(state = in_state)
|
33 |
+
|
34 |
+
col1, col2 = st.columns(2)
|
35 |
+
with col1:
|
36 |
+
st.text('in state')
|
37 |
+
st.code(json.dumps(in_state, indent=2))
|
38 |
+
with col2:
|
39 |
+
st.text('out state')
|
40 |
+
st.code(out_state)
|