| | 1158 | === Prikaz torus modela v brskalniku === |
| | 1159 | [[Image(edge_primer.PNG, width=480px, right)]] |
| | 1160 | {{{ |
| | 1161 | #!/usr/bin/env python |
| | 1162 | |
| | 1163 | ##Copyright 2009-2014 Thomas Paviot (tpaviot@gmail.com) |
| | 1164 | ## |
| | 1165 | ##This file is part of pythonOCC. |
| | 1166 | ## |
| | 1167 | ##pythonOCC is free software: you can redistribute it and/or modify |
| | 1168 | ##it under the terms of the GNU Lesser General Public License as published by |
| | 1169 | ##the Free Software Foundation, either version 3 of the License, or |
| | 1170 | ##(at your option) any later version. |
| | 1171 | ## |
| | 1172 | ##pythonOCC is distributed in the hope that it will be useful, |
| | 1173 | ##but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | 1174 | ##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | 1175 | ##GNU Lesser General Public License for more details. |
| | 1176 | ## |
| | 1177 | ##You should have received a copy of the GNU Lesser General Public License |
| | 1178 | ##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>. |
| | 1179 | |
| | 1180 | from OCC.Display.WebGl import threejs_renderer |
| | 1181 | from OCC.BRepPrimAPI import BRepPrimAPI_MakeTorus |
| | 1182 | |
| | 1183 | torus_shp = BRepPrimAPI_MakeTorus(20., 10.).Shape() |
| | 1184 | my_renderer = threejs_renderer.ThreejsRenderer(background_color="#123345") |
| | 1185 | my_renderer.DisplayShape(torus_shp) |
| | 1186 | |
| | 1187 | |
| | 1188 | }}} |
| | 1189 | |