建立方向盘项目初始版本
This commit is contained in:
17
scripts/render_open_encoder_option.py
Normal file
17
scripts/render_open_encoder_option.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pathlib import Path
|
||||
import time, traceback
|
||||
import FreeCAD as A, FreeCADGui as G
|
||||
from pivy import coin
|
||||
R=Path(__file__).resolve().parent.parent
|
||||
O=R/'models'/'profile_mount_check'
|
||||
try:
|
||||
doc=A.openDocument(str(O/'OpenSlot50.FCStd'))
|
||||
for o in doc.Objects:
|
||||
if hasattr(o,'Shape'): o.ViewObject.Visibility=(o.Name=='OpenBracket')
|
||||
view=G.activeDocument().activeView()
|
||||
view.viewTop();G.updateGui();time.sleep(.5);view.fitAll();G.updateGui();time.sleep(.5)
|
||||
view.saveImage(str(O/'OpenSlot50_支架开口.png'),1600,1200,'White')
|
||||
(O/'OPEN_RENDER_DONE.txt').write_text('ok\n',encoding='utf8')
|
||||
except Exception:
|
||||
(O/'OPEN_RENDER_ERROR.txt').write_text(traceback.format_exc(),encoding='utf8')
|
||||
raise
|
||||
Reference in New Issue
Block a user