728x90
FreeCAD로 작성된 조립품의 조립 과정을 작업자에게 그래픽하게 보여주는 기능을 시험 중이다. FreeCAD의 매크로 기능을 이용하면 비교적 쉽게 조립 과정을 보여줄 수 있을 것으로 예측된다. 현재는 수작업으로 작성한 매크로를 이용해서 과정을 생성해 보았다.
#hide column, shaft
Gui.Selection.addSelection('asmD','Part','Part__Feature001.')
Gui.Selection.addSelection('asmD','Part','Part__Feature002.')
Gui.runCommand('Std_ToggleVisibility',0)
Gui.Selection.clearSelection()
#1 move base to start p
App.getDocument("asmD").Part__Feature.Placement=App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(1,0,0),0),App.Vector(0,0,0))
# move base to base p
App.getDocument("asmD").Part__Feature.Placement=App.Placement(App.Vector(30,30,0),App.Rotation(App.Vector(1,0,0),0),App.Vector(0,0,0))
#show column
Gui.Selection.addSelection('asmD','Part','Part__Feature001.')
Gui.runCommand('Std_ToggleVisibility',0)
Gui.Selection.clearSelection()
#2 move column to start p
App.getDocument("asmD").Part__Feature001.Placement=App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(1,0,0),0),App.Vector(0,0,0))
# move column to base p
App.getDocument("asmD").Part__Feature001.Placement=App.Placement(App.Vector(30,30,2),App.Rotation(App.Vector(1,0,0),0),App.Vector(0,0,0))
#show shaft
Gui.Selection.addSelection('asmD','Part','Part__Feature002.')
Gui.runCommand('Std_ToggleVisibility',0)
Gui.Selection.clearSelection()
#3 move shaft to start p
App.getDocument("asmD").Part__Feature002.Placement=App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(1,0,0),0),App.Vector(0,0,0))
#3 rotate shaft at start p
App.getDocument("asmD").Part__Feature002.Placement=App.Placement(App.Vector(0,0,7.5),App.Rotation(App.Vector(1,0,0),90),App.Vector(0,0,0))
# move shaft to base p
App.getDocument("asmD").Part__Feature002.Placement=App.Placement(App.Vector(30,38,27),App.Rotation(App.Vector(1,0,0),90),App.Vector(0,0,0))
다음은 수작업으로 매크로를 실행한 결과이다.
2023 EDBLab
'3D CAD' 카테고리의 다른 글
FreeCAD 파이썬 프로그램에서 사용자 Gui 만들기 (0) | 2023.05.02 |
---|---|
FreeCAD에서 두가지 방법으로 부품 만들기 (0) | 2023.05.02 |
무료로 사용할 수 있는 전문가급 3D CAD, FreeCAD (0) | 2023.04.24 |
파이썬으로 FreeCAD CAD 프로그램을 작성하는 방법 소개 (0) | 2023.04.23 |