|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 2, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [ |
| 8 | + { |
| 9 | + "name": "stdout", |
| 10 | + "output_type": "stream", |
| 11 | + "text": [ |
| 12 | + "1 0\n", |
| 13 | + "4 5\n", |
| 14 | + "9 8\n", |
| 15 | + "10 1\n" |
| 16 | + ] |
| 17 | + } |
| 18 | + ], |
| 19 | + "source": [ |
| 20 | + "from CGAL.CGAL_Kernel import Point_2\n", |
| 21 | + "from CGAL.CGAL_Triangulation_2 import Triangulation_2\n", |
| 22 | + "from CGAL.CGAL_Triangulation_2 import Triangulation_2_Vertex_circulator\n", |
| 23 | + "from CGAL.CGAL_Triangulation_2 import Triangulation_2_Vertex_handle\n", |
| 24 | + "\n", |
| 25 | + "points=[]\n", |
| 26 | + "points.append( Point_2(1,0) )\n", |
| 27 | + "points.append( Point_2(3,2) )\n", |
| 28 | + "points.append( Point_2(4,5) )\n", |
| 29 | + "points.append( Point_2(9,8) )\n", |
| 30 | + "points.append( Point_2(7,4) )\n", |
| 31 | + "points.append( Point_2(5,2) )\n", |
| 32 | + "points.append( Point_2(6,3) )\n", |
| 33 | + "points.append( Point_2(10,1) )\n", |
| 34 | + " \n", |
| 35 | + "t=Triangulation_2()\n", |
| 36 | + "t.insert(points)\n", |
| 37 | + "\n", |
| 38 | + "vc = t.incident_vertices(t.infinite_vertex())\n", |
| 39 | + "\n", |
| 40 | + "if vc.hasNext():\n", |
| 41 | + " done = vc.next();\n", |
| 42 | + " iter=Triangulation_2_Vertex_handle()\n", |
| 43 | + " while(1):\n", |
| 44 | + " iter=vc.next()\n", |
| 45 | + " print (iter.point())\n", |
| 46 | + " if iter == done:\n", |
| 47 | + " break\n" |
| 48 | + ] |
| 49 | + }, |
| 50 | + { |
| 51 | + "cell_type": "code", |
| 52 | + "execution_count": null, |
| 53 | + "metadata": {}, |
| 54 | + "outputs": [], |
| 55 | + "source": [] |
| 56 | + } |
| 57 | + ], |
| 58 | + "metadata": { |
| 59 | + "kernelspec": { |
| 60 | + "display_name": "base", |
| 61 | + "language": "python", |
| 62 | + "name": "python3" |
| 63 | + }, |
| 64 | + "language_info": { |
| 65 | + "codemirror_mode": { |
| 66 | + "name": "ipython", |
| 67 | + "version": 3 |
| 68 | + }, |
| 69 | + "file_extension": ".py", |
| 70 | + "mimetype": "text/x-python", |
| 71 | + "name": "python", |
| 72 | + "nbconvert_exporter": "python", |
| 73 | + "pygments_lexer": "ipython3", |
| 74 | + "version": "3.11.7" |
| 75 | + } |
| 76 | + }, |
| 77 | + "nbformat": 4, |
| 78 | + "nbformat_minor": 2 |
| 79 | +} |
0 commit comments