Changes between Version 4 and Version 5 of salome_shaper


Ignore:
Timestamp:
Oct 8, 2019, 5:32:27 PM (5 years ago)
Author:
dpenko
Comment:

Add polyline example.

Legend:

Unmodified
Added
Removed
Modified
  • salome_shaper

    v4 v5  
    220220mylength = sketch_base.setDistance(l1.startPoint(), l3.endPoint(), 50)
    221221}}}
     222
     223= Primer: Polyline =
     224
     225 
     226{{{
     227#!python
     228
     229# Uvoz potrebnih knjižnice
     230from salome.shaper import model
     231
     232# Kreiranje modela
     233model.begin()
     234partSet = model.moduleDocument()
     235
     236# Kreiranje parta
     237Part_1 = model.addPart(partSet)
     238Part_1_doc = Part_1.document()
     239
     240# Definiranje tock
     241Point_1 = model.addPoint(Part_1_doc, 10, 10, -10)
     242Point_2 = model.addPoint(Part_1_doc, 70, 70, 50)
     243Point_3 = model.addPoint(Part_1_doc, 100, 120, 100)
     244
     245# Definiranje linije, sestavljene iz treh točk
     246Polyline_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
     249model.do()
     250
     251}}}