| | 896 | Q: Kako postavimo model v drugi položaj? |
| | 897 | |
| | 898 | A: Okoli osi v prostoru lahko rotirate: |
| | 899 | |
| | 900 | {{{ |
| | 901 | #!python |
| | 902 | LokacijaOsi1 = gp_Pnt(8, 45, -100) |
| | 903 | RotacijaOs1 = gp_Ax1(LokacijaOsi1, gp_Dir(0,0,1)) #Os rotacije |
| | 904 | TransfRot1 = gp_Trsf() |
| | 905 | TransfRot1.SetRotation(RotacijaOs1, t1) |
| | 906 | J19 = BRepBuilderAPI_Transform(J18, TransfRot1).Shape() |
| | 907 | }}} |
| | 908 | Translacija je še lažja: |
| | 909 | {{{ |
| | 910 | #!python |
| | 911 | Premik = gp_Vec(-130, -870, -2530) |
| | 912 | Translacija = gp_Trsf() |
| | 913 | Translacija.SetTranslation(Premik) |
| | 914 | rezultat = BRepBuilderAPI_Transform(J17, Translacija).Shape() |
| | 915 | }}} |
| | 916 | |
| | 917 | Ostale funkcije so opisane v http://api.pythonocc.org/OCC.gp.gp_Trsf-class.html |