1313IMPERIAL = 25.4
1414MODEL_SCALING = IMPERIAL
1515
16- # Used for tool cylinder
17- # it will be updated in shape and length by function below.
18- toolshape = CylinderZ (0 )
19- toolshape = Color ([1 , .5 , .5 , .5 ], [toolshape ])
20-
2116# -----------------------------------------------------------------------------------------------------------
2217# Concept of machine design
2318
171166# it creates cylinder then translates tooltip to end of it.
172167tool = Collection ([
173168 Translate ([HalTranslate ([tooltip ], None , "motion.tooloffset.z" , 0 , 0 , - MODEL_SCALING )], 0 , 0 , 0 ),
174- HalToolCylinder (toolshape )
169+ Color ([ 1 , .5 , .5 , .5 ], [ HalToolCylinder ()] )
175170])
176171
177172# Since tool is defined, lets attach it to cat30
214209model = Collection ([frame , yassembly , zassembly ])
215210
216211
212+ # build axes origin markers
213+ X = CylinderX (- 500 ,1 ,500 ,1 )
214+ X = Color ([1 , 0 , 0 , 1 ], [X ])
215+ Y = CylinderY (- 500 ,1 ,500 ,1 )
216+ Y = Color ([0 , 1 , 0 , 1 ], [Y ])
217+ Z = CylinderZ (- 100 ,1 ,100 ,1 )
218+ Z = Color ([0 , 0 , 1 , 1 ], [Z ])
219+ origin = Collection ([X ,Y ,Z ])
220+
217221# we want to embed with qtvcp so build a window to display
218222# the model
219223class Window (QWidget ):
@@ -230,7 +234,10 @@ def __init__(self):
230234
231235 world = Capture ()
232236
237+ # uncomment and re comment the nect line to se origin markers
238+ #v.model = Collection([origin, model, world])
233239 v .model = Collection ([model , world ])
240+
234241 size = 600
235242 v .distance = size * 3
236243 v .near = size * 0.01
@@ -249,7 +256,7 @@ def __init__(self):
249256# It just makes a qtvcp5 window that is defined in qt_vismach.py
250257# parameter list:
251258# final model name must include all parts you want to use
252- # tooltip (special for tool tip inclusuion )
259+ # tooltip (special for tool tip inclusion )
253260# work (special for work part inclusion)
254261# size of screen (bigger means more zoomed out to show more of machine)
255262# hud None if no hud
0 commit comments