| 222 | |
| 223 | = Primer: Polyline = |
| 224 | |
| 225 | |
| 226 | {{{ |
| 227 | #!python |
| 228 | |
| 229 | # Uvoz potrebnih knjižnice |
| 230 | from salome.shaper import model |
| 231 | |
| 232 | # Kreiranje modela |
| 233 | model.begin() |
| 234 | partSet = model.moduleDocument() |
| 235 | |
| 236 | # Kreiranje parta |
| 237 | Part_1 = model.addPart(partSet) |
| 238 | Part_1_doc = Part_1.document() |
| 239 | |
| 240 | # Definiranje tock |
| 241 | Point_1 = model.addPoint(Part_1_doc, 10, 10, -10) |
| 242 | Point_2 = model.addPoint(Part_1_doc, 70, 70, 50) |
| 243 | Point_3 = model.addPoint(Part_1_doc, 100, 120, 100) |
| 244 | |
| 245 | # Definiranje linije, sestavljene iz treh točk |
| 246 | Polyline_1 = model.addPolyline3D(Part_1_doc, [model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Point_2"), model.selection("VERTEX", "Point_3")], False) |
| 247 | |
| 248 | # Prikaži dopolnjen model |
| 249 | model.do() |
| 250 | |
| 251 | }}} |