Changes between Version 31 and Version 32 of PythonOcc
- Timestamp:
- Oct 14, 2013, 10:36:51 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PythonOcc
v31 v32 39 39 40 40 41 41 42 Najprej kličemo knjižnico za enostaven uporabniški vmesnik SimpleGUI: 42 43 {{{ 43 #!python 44 #!python 45 # -*- coding: utf-8 -*- 44 46 from OCC.Display.SimpleGui import * 45 47 }}} … … 51 53 display, start_display, add_menu, add_function_to_menu = init_display() 52 54 }}} 53 55 [[Image(3Dprimitives.png, width=480px, right)]] 54 56 Let’s now define the two functions that create and display a box and a cylinder: 55 57 Nato definiramo dve funkciji, ki izdelata kocko in cilinder: … … 58 60 def kocka(event=None): 59 61 from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox 60 display.Erase .All()62 display.EraseAll() 61 63 my_box= BRepPrimAPI_MakeBox(10., 20., 30.) 62 64 display.DisplayShape(my_box.Shape()) … … 64 66 def valj(event=None): 65 67 from OCC.BRepPrimAPI import BRepPrimAPI_MakeCylinder 66 display.Erase .All()68 display.EraseAll() 67 69 my_cylinder = BRepPrimAPI_MakeCylinder(60, 200) 68 70 display.DisplayShape(my_cylinder.Shape()) … … 86 88 }}} 87 89 88 Posnetek programa v sliki: 89 [[BR]] 90 [[Image(3Dprimitives.png, width=480px)]] 91 [[BR]] 92 93 Primer kode 3D modela:[[BR]] 94 {{{ 95 #!python 90 Namesto uporabe klasičnih primitivov, lahko kocko zgradimo tudi z izvlekom žičnega modela. 91 {{{ 92 #!python 93 # -*- coding: utf-8 -*- 96 94 ## Izdelava kocke 97 95