Skip to content

Commit adbd276

Browse files
committed
add demo model
1 parent 5e34a7c commit adbd276

File tree

4 files changed

+69
-39
lines changed

4 files changed

+69
-39
lines changed

Readme.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,60 @@
1+
# Description
12

3+
Jupyter Forge is a library that allows you can explore 3d viewer from Autodesk Platform Services bring into interactive
4+
of Jupyter Notebook.
25

3-
# Description
6+
![](./docs/iShot_2025-01-01_00.28.48.gif)
7+
8+
## Installation
9+
10+
```bash
11+
pip install jupyter-forge
12+
```
413

5-
Jupyter
14+
## Usage
615

7-
## Developers
16+
```python
17+
from jupyter_forge import JupyterForge
18+
from aps_toolkit import Auth
19+
20+
urn = "dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLlFsa1ZtVU5RUmYtanMtd3dLQ2dLM1E_dmVyc2lvbj0x"
21+
token = Auth().auth2leg()
22+
forge_viewer = JupyterForge(urn, token)
23+
# object id from derivative api
24+
object_ids = [123, 456]
25+
# show 3d viewer
26+
forge_viewer.show(object_ids, width=800, height=600)
27+
```
28+
29+
## Developers
830

931
#### Test Data Readme
1032

1133
```python
12-
pip install -e .
34+
pip
35+
install - e.
1336
```
1437

1538
#### Fix server not starting
39+
1640
```bash
1741
# start a server with dir
1842
python -m http.server 54364 --directory D:\API\Forge\jupyter-forge\src\template
1943
```
2044

21-
#### Kill Port
45+
#### Kill Port
46+
2247
```bash
2348
netstat -ano | findstr :54364
2449
taskkill /F /PID 21008
2550
```
2651

2752
- Kill all port relate to 54364
53+
2854
```bash
2955
taskkill /F /PID 21008
3056
```
3157

32-
#### Start Debug
58+
#### Start Debug
3359

3460
http://localhost:54364/render.html

docs/demo.mp4

15.7 MB
Binary file not shown.

docs/iShot_2025-01-01_00.28.48.gif

58.9 MB
Loading

src/test-lib.ipynb

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 10,
66
"id": "initial_id",
77
"metadata": {
8-
"ExecuteTime": {
9-
"end_time": "2024-12-17T12:58:40.180757Z",
10-
"start_time": "2024-12-17T12:58:39.094690Z"
11-
},
12-
"collapsed": true
8+
"collapsed": true,
9+
"jupyter": {
10+
"is_executing": true
11+
}
1312
},
1413
"outputs": [],
1514
"source": [
@@ -19,35 +18,25 @@
1918
},
2019
{
2120
"cell_type": "code",
22-
"execution_count": 2,
21+
"execution_count": 11,
2322
"id": "ef968bc9afae7ded",
2423
"metadata": {
2524
"ExecuteTime": {
2625
"end_time": "2024-12-17T13:16:07.022957Z",
2726
"start_time": "2024-12-17T13:16:02.238686Z"
2827
}
2928
},
30-
"outputs": [
31-
{
32-
"name": "stdout",
33-
"output_type": "stream",
34-
"text": [
35-
"Port 62345 is not in use, start init server dir: /Users/chuongmep/PycharmProjects/jupyter-forge/src/template\n",
36-
"Server PID: 21719\n",
37-
"Server started successfully. Access: http://localhost:62345\n"
38-
]
39-
}
40-
],
29+
"outputs": [],
4130
"source": [
4231
"urn = \"dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLlFsa1ZtVU5RUmYtanMtd3dLQ2dLM1E_dmVyc2lvbj0x\"\n",
4332
"token = Auth().auth2leg()\n",
44-
"# forge_viewer = JupyterForge(urn,token,debug_mode=True,port=54364)\n",
45-
"forge_viewer = JupyterForge(urn,token,port=62345, debug_mode=True)"
33+
"forge_viewer = JupyterForge(urn,token,debug_mode=False,port=54364)\n",
34+
"# forge_viewer = JupyterForge(urn,token,port=62345, debug_mode=False)"
4635
]
4736
},
4837
{
4938
"cell_type": "code",
50-
"execution_count": 5,
39+
"execution_count": 12,
5140
"id": "b3f8b04d",
5241
"metadata": {
5342
"ExecuteTime": {
@@ -56,29 +45,22 @@
5645
}
5746
},
5847
"outputs": [
59-
{
60-
"name": "stdout",
61-
"output_type": "stream",
62-
"text": [
63-
"http://localhost:62345/rendered.html\n"
64-
]
65-
},
6648
{
6749
"data": {
6850
"text/html": [
6951
"\n",
7052
" <iframe\n",
7153
" width=\"800\"\n",
7254
" height=\"450\"\n",
73-
" src=\"http://localhost:62345/rendered.html\"\n",
55+
" src=\"http://localhost:54364/rendered.html\"\n",
7456
" frameborder=\"0\"\n",
7557
" allowfullscreen\n",
7658
" \n",
7759
" ></iframe>\n",
7860
" "
7961
],
8062
"text/plain": [
81-
"<IPython.lib.display.IFrame at 0x16759bf80>"
63+
"<IPython.lib.display.IFrame at 0x11fcc9dc0>"
8264
]
8365
},
8466
"metadata": {},
@@ -91,17 +73,39 @@
9173
},
9274
{
9375
"cell_type": "code",
94-
"execution_count": 4,
76+
"execution_count": 14,
9577
"id": "be64340ce7c7118a",
9678
"metadata": {
9779
"ExecuteTime": {
9880
"end_time": "2024-12-17T13:19:04.202210Z",
9981
"start_time": "2024-12-17T13:19:04.192611Z"
10082
}
10183
},
102-
"outputs": [],
84+
"outputs": [
85+
{
86+
"data": {
87+
"text/html": [
88+
"\n",
89+
" <iframe\n",
90+
" width=\"400\"\n",
91+
" height=\"450\"\n",
92+
" src=\"http://localhost:54364/rendered.html\"\n",
93+
" frameborder=\"0\"\n",
94+
" allowfullscreen\n",
95+
" \n",
96+
" ></iframe>\n",
97+
" "
98+
],
99+
"text/plain": [
100+
"<IPython.lib.display.IFrame at 0x11fcc9dc0>"
101+
]
102+
},
103+
"metadata": {},
104+
"output_type": "display_data"
105+
}
106+
],
103107
"source": [
104-
"# forge_viewer.show(object_ids=[450],width=700,height=450)"
108+
"forge_viewer.show(object_ids=[450],width=400,height=450)"
105109
]
106110
}
107111
],

0 commit comments

Comments
 (0)