哈利波特的C语言版魔盒工具台hpCBox

Chinese forum

Moderator: paullee

Forum rules
论坛规矩 / 論壇規矩 , 有用的资讯 / 有用的資訊
重要:寻求帮助之前,请先看看这里 /
重要:尋求幫助之前,請先看看這裡

另外,对论坛用户 友善!阅读FreeCAD 行为准则!
/ 另外,對論壇用戶 友善! 閱讀FreeCAD
行為準則
Post Reply
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

哈利波特的C语言版魔盒工具台hpCBox

Post by johnwang »

这个帖子提供了一个python版的工具台例子hpBox。https://forum.freecadweb.org/viewtopic.php?f=40&t=44893

这个帖子用C语言在工具台里添加了一个工具。https://forum.freecadweb.org/viewtopic.php?f=40&t=50934

现在来尝试一下用C语言写工具台hpCBox。

你需要能自己编译FreeCAD。

新的工具台的名字叫hpCBox, 即C语言版的Box工具台。我下载的FreeCAD源码解压在c:\FreeCAD-master目录里。首先把c:\FreeCAD-master\src\Mod\surface复制一份。把复制的目录改成c:\FreeCAD-master\src\Mod\hpCBox。我们在此基础上删减和修改。把其中叫做Surface的,都改成叫hpCBox。
Last edited by johnwang on Fri Oct 09, 2020 12:42 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: 开始写哈利波特的C语言版魔盒工具台hpCBox

Post by johnwang »

要编译这个项目,需要用文本编辑器打开C:\FreeCAD-master\src\Mod\CMakeLists.txt文件,加入hpCBox目录:

Code: Select all

if(BUILD_SURFACE)
  add_subdirectory(Surface)
endif(BUILD_SURFACE)

if(BUILD_HPCBOX)
  add_subdirectory(hpCBox)
endif(BUILD_HPCBOX)
这个BUILD_HPCBOX开关需要在C:\FreeCAD-master\cMake\FreeCAD_Helpers\InitializeFreeCADBuildOptions.cmake中加入:

Code: Select all

    option(BUILD_SURFACE "Build the FreeCAD surface module" ON)
    option(BUILD_HPCBOX "Build the FreeCAD hpCBox module" ON)
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1382
Joined: Sun Jan 27, 2019 12:41 am

Re: 哈利波特的C语言版魔盒工具台hpCBox

Post by johnwang »

下载后解压到src\Mod\hpCBox目录。然后编译。3个项目,右键点击,然后选Build.
solution.jpg
solution.jpg (14.25 KiB) Viewed 2700 times
hpCBox.jpg
hpCBox.jpg (28.49 KiB) Viewed 2700 times
hpCBox.zip
(12.24 KiB) Downloaded 246 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Post Reply