22 "cells" : [
33 {
44 "cell_type" : " code" ,
5- "execution_count" : 2 ,
5+ "execution_count" : 1 ,
66 "metadata" : {},
77 "outputs" : [],
88 "source" : [
1818 " from compas.geometry import Vector\n " ,
1919 " from compas.geometry import SphericalSurface\n " ,
2020 " from compas.geometry import CylindricalSurface\n " ,
21+ " from compas_notebook.geometry import Dot\n " ,
2122 " from compas_notebook.viewer import Viewer"
2223 ]
2324 },
2425 {
2526 "cell_type" : " code" ,
26- "execution_count" : 5 ,
27+ "execution_count" : null ,
2728 "metadata" : {},
2829 "outputs" : [],
29- "source" : [
30- " point = Point(-1, 2, 3)\n " ,
31- " vector = Vector(1, 1, 2)\n " ,
32- " plane = Plane([0, 0, -1], [0, 0, 1])\n " ,
33- " frame = Frame(point, [1, 0, 0], [0, 1, 0])\n " ,
34- " \n " ,
35- " line = Line([0, 0, 0], point)\n " ,
36- " cloud = Pointcloud.from_bounds(x=8, y=5, z=3, n=13)\n " ,
37- " polyline = Polyline(cloud.points)\n " ,
38- " \n " ,
39- " # quadric curves\n " ,
40- " circle = Circle(radius=1.5, frame=Frame([2, 0, 0], [0, 1, 0], [0, 0, 1]))\n " ,
41- " ellipse = Ellipse(major=2.0, minor=1.0, frame=Frame([5, 0, 0], [0, 1, 0], [0, 0, 1]))\n " ,
42- " \n " ,
43- " # Create analytical surfaces\n " ,
44- " sphere_surface = SphericalSurface(radius=1.5, frame=Frame([0, 0, 0], [1, 0, 0], [0, 1, 0]))\n " ,
45- " cylinder_surface = CylindricalSurface(radius=0.8, frame=Frame([3, 0, 0], [1, 0, 0], [0, 1, 0]))"
46- ]
30+ "source" : " point = Point(-1, 2, 3)\n vector = Vector(1, 1, 2)\n plane = Plane([0, 0, -1], [0, 0, 1])\n frame = Frame(point, [1, 0, 0], [0, 1, 0])\n\n line = Line([0, 0, 0], point)\n cloud = Pointcloud.from_bounds(x=8, y=5, z=3, n=13)\n polyline = Polyline(cloud.points)\n\n # quadric curves\n circle = Circle(radius=1.5, frame=Frame([2, 0, 0], [0, 1, 0], [0, 0, 1]))\n ellipse = Ellipse(major=2.0, minor=1.0, frame=Frame([5, 0, 0], [0, 1, 0], [0, 0, 1]))\n\n # Create analytical surfaces\n sphere_surface = SphericalSurface(radius=1.5, frame=Frame([0, 0, 0], [1, 0, 0], [0, 1, 0]))\n cylinder_surface = CylindricalSurface(radius=0.8, frame=Frame([3, 0, 0], [1, 0, 0], [0, 1, 0]))\n\n # Dot: text label at a point (constant screen size)\n dot = Dot([8, 5, 3], \" Corner\" )"
4731 },
4832 {
4933 "cell_type" : " code" ,
50- "execution_count" : 7 ,
34+ "execution_count" : null ,
5135 "metadata" : {},
52- "outputs" : [
53- {
54- "data" : {
55- "application/vnd.jupyter.widget-view+json" : {
56- "model_id" : " d32833ac778148c0920dfa0e9b672076" ,
57- "version_major" : 2 ,
58- "version_minor" : 0
59- },
60- "text/plain" : [
61- " VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
62- ]
63- },
64- "metadata" : {},
65- "output_type" : " display_data"
66- }
67- ],
68- "source" : [
69- " viewer = Viewer()\n " ,
70- " \n " ,
71- " viewer.scene.add(point, color=Color.red(), pointsize=0.3)\n " ,
72- " viewer.scene.add(line)\n " ,
73- " viewer.scene.add(frame)\n " ,
74- " viewer.scene.add(polyline, color=Color.blue())\n " ,
75- " viewer.scene.add(cloud, color=Color.green(), pointsize=0.3)\n " ,
76- " viewer.scene.add(circle, color=Color.red())\n " ,
77- " viewer.scene.add(ellipse, color=Color.green())\n " ,
78- " viewer.scene.add(vector)\n " ,
79- " viewer.scene.add(plane)\n " ,
80- " viewer.scene.add(sphere_surface, color=Color.cyan())\n " ,
81- " viewer.scene.add(cylinder_surface, color=Color.magenta())\n " ,
82- " \n " ,
83- " viewer.show()"
84- ]
36+ "outputs" : [],
37+ "source" : " viewer = Viewer()\n\n viewer.scene.add(point, color=Color.red(), pointsize=0.3)\n viewer.scene.add(line)\n viewer.scene.add(frame)\n viewer.scene.add(polyline, color=Color.blue())\n viewer.scene.add(cloud, color=Color.green(), pointsize=0.3)\n viewer.scene.add(circle, color=Color.red())\n viewer.scene.add(ellipse, color=Color.green())\n viewer.scene.add(vector)\n viewer.scene.add(plane)\n viewer.scene.add(sphere_surface, color=Color.cyan())\n viewer.scene.add(cylinder_surface, color=Color.magenta())\n viewer.scene.add(dot, color=Color.black())\n\n viewer.show()"
8538 }
8639 ],
8740 "metadata" : {
10558 },
10659 "nbformat" : 4 ,
10760 "nbformat_minor" : 4
108- }
61+ }
0 commit comments