Skip to content

Commit d9df5ae

Browse files
committed
random graph example
1 parent 6db322c commit d9df5ae

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

content/random-graph.ipynb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%pip install -q pythreejs\n",
10+
"%pip install -q compas\n",
11+
"%pip install -q compas_notebook --no-deps"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": null,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"from compas.geometry import Pointcloud\n",
21+
"from compas.datastructures import Graph\n",
22+
"from compas_notebook import Viewer"
23+
]
24+
},
25+
{
26+
"cell_type": "code",
27+
"execution_count": null,
28+
"metadata": {},
29+
"outputs": [],
30+
"source": [
31+
"cloud = Pointcloud.from_bounds(8, 5, 3, 53)\n",
32+
"graph = Graph.from_pointcloud(cloud)"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"viewer = Viewer()\n",
42+
"viewer.scene.add(graph)\n",
43+
"viewer.show()"
44+
]
45+
}
46+
],
47+
"metadata": {
48+
"kernelspec": {
49+
"display_name": "compas-dev",
50+
"language": "python",
51+
"name": "python3"
52+
},
53+
"language_info": {
54+
"codemirror_mode": {
55+
"name": "ipython",
56+
"version": 3
57+
},
58+
"file_extension": ".py",
59+
"mimetype": "text/x-python",
60+
"name": "python",
61+
"nbconvert_exporter": "python",
62+
"pygments_lexer": "ipython3",
63+
"version": "3.12.9"
64+
}
65+
},
66+
"nbformat": 4,
67+
"nbformat_minor": 2
68+
}

0 commit comments

Comments
 (0)