Skip to content

Commit 3aff457

Browse files
committed
add surface examples using analytical surfaces
spherical and cylindrical surfaces work without plugin
1 parent 192c10a commit 3aff457

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

notebooks/20_geometry.ipynb

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,10 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
8-
"source": [
9-
"from compas.colors import Color\n",
10-
"from compas.geometry import Circle\n",
11-
"from compas.geometry import Ellipse\n",
12-
"from compas.geometry import Frame\n",
13-
"from compas.geometry import Line\n",
14-
"from compas.geometry import Plane\n",
15-
"from compas.geometry import Point\n",
16-
"from compas.geometry import Pointcloud\n",
17-
"from compas.geometry import Polyline\n",
18-
"from compas.geometry import Vector\n",
19-
"from compas_notebook.viewer import Viewer"
20-
]
8+
"source": "from compas.colors import Color\nfrom compas.geometry import Circle\nfrom compas.geometry import Ellipse\nfrom compas.geometry import Frame\nfrom compas.geometry import Line\nfrom compas.geometry import Plane\nfrom compas.geometry import Point\nfrom compas.geometry import Pointcloud\nfrom compas.geometry import Polyline\nfrom compas.geometry import Vector\nfrom compas.geometry import SphericalSurface\nfrom compas.geometry import CylindricalSurface\nfrom compas_notebook.viewer import Viewer"
219
},
2210
{
2311
"cell_type": "code",
@@ -139,6 +127,25 @@
139127
"metadata": {},
140128
"outputs": [],
141129
"source": []
130+
},
131+
{
132+
"cell_type": "markdown",
133+
"source": "# Surfaces\n\nAnalytical surfaces work out of the box.",
134+
"metadata": {}
135+
},
136+
{
137+
"cell_type": "code",
138+
"source": "# Create analytical surfaces\nsphere_surface = SphericalSurface(radius=1.5, frame=Frame([0, 0, 0], [1, 0, 0], [0, 1, 0]))\ncylinder_surface = CylindricalSurface(radius=0.8, frame=Frame([3, 0, 0], [1, 0, 0], [0, 1, 0]))",
139+
"metadata": {},
140+
"execution_count": null,
141+
"outputs": []
142+
},
143+
{
144+
"cell_type": "code",
145+
"source": "viewer3 = Viewer()\n\nviewer3.scene.add(sphere_surface, color=Color.cyan())\nviewer3.scene.add(cylinder_surface, color=Color.magenta())\n\nviewer3.show()",
146+
"metadata": {},
147+
"execution_count": null,
148+
"outputs": []
142149
}
143150
],
144151
"metadata": {
@@ -162,4 +169,4 @@
162169
},
163170
"nbformat": 4,
164171
"nbformat_minor": 4
165-
}
172+
}

0 commit comments

Comments
 (0)