Power users hub/zh-tw: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
 
(55 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
{{TOCright}}
[[Image:Power_user_hub.png|64px]]
----


<div class="mw-translate-fuzzy">
[[Image:Crystal_Clear_app_terminal.png|right|150]]
這是一個讓你更加深入了解FreeCAD的地方。在這裡你可以學習如何為你的需求客製化FreeCAD。

</div>
這是一個讓你更加深入了解FreeCAD的地方。在這裡你可以學習如何為你的需求客製化FreeCAD。

這個頁面還在早期開發階段。如果你找不到你所需要的資訊,或是你在其他地方找到有用的資訊,請在[http://forum.freecadweb.org/ 論壇]上留言,或者何不[[Help_FreeCAD| 直接由你來幫忙增加本頁面的內容!]]


<div class="mw-translate-fuzzy">
FreeCAD有一個最棒的特色就是你可以藉由腳本來擴充功能並且幾乎沒有限制,而且你並不需要接觸到FreeCAD本身的原始碼或是編譯任何東西。所有的腳本都是由[http://en.wikipedia.org/wiki/Python_(programming_language) Python]這個簡單但是強大的程式語言寫成的。藉由Python你幾乎可以使用FreeCAD的各種功能。舉例來說,你可以:
FreeCAD有一個最棒的特色就是你可以藉由腳本來擴充功能並且幾乎沒有限制,而且你並不需要接觸到FreeCAD本身的原始碼或是編譯任何東西。所有的腳本都是由[http://en.wikipedia.org/wiki/Python_(programming_language) Python]這個簡單但是強大的程式語言寫成的。藉由Python你幾乎可以使用FreeCAD的各種功能。舉例來說,你可以:
* '''創造和修改模型''':你有一些特殊的模型是FreeCAD的預設安裝中沒有的嗎?
* '''創造和修改模型''':你有一些特殊的模型是FreeCAD的預設安裝中沒有的嗎?你可以容易地創造出一個物件型態,不論是從scratch 或是藉由adapting an existing type。
你可以容易地創造出一個物件型態,不論是從scratch 或是藉由adapting an existing type。


* '''製作客製化工具以及命令''': 目前為止FreeCAD已經擁有許多功能,但還沒有足夠多方便的功能給終端使用者。不過他已經可以容易的製作出你自己的工具組。
One of the nicest features of FreeCAD is that you can script and extend it extremely far without the need to compile anything or touch the source code. All the scripting part is done in [http://en.wikipedia.org/wiki/Python_(programming_language) Python], a very powerful but simple programming language. With simple Python scripts, you have total access to about any part of FreeCAD. For example, you can:
* '''修改介面''': FreeCAD的使用者介面現階段依然十分的基本。不過你可以擴展任何你需要的東西。例如,創建一個工具列並將你的工具放入,建立特別的控制面板來和你的工具互動等等。
* '''Create and modify geometry''': Is there a special object you need that's not present in the default FreeCAD installation? You can easily create a new object type, either from scratch or by adapting an existing type.
*'''修改場景表現''': FreeCAD有separate processes 來建立與計算幾何模型,並且將它顯示在你的螢幕。你可以全方位的控制展現在你螢幕上的東西,因此你可以改變他的展現方式,與場景互動或是增加各種客製化的動作和螢幕小工具,例如顯示目前資訊、拖拉圖案、anchors 、或者暫時的實體。
* '''Create custom tools and commands''': At the moment, FreeCAD already has extensive functionality, but there aren't many convenient tools and commands for the final user yet. But it is already easy to create your own sets of tools.
</div>
* '''Modify the interface''': The FreeCAD user interface is still very basic at this stage. But everything is there for you to extend it to your needs. You can, for example, create toolbars to put your own tools, create special panels for interacting with your tools, etc.
*'''Modify the scene representation''': FreeCAD has separate processes for building up and computing the geometry and displaying that geometry on your screen. You have full access to the way the scene contents are displayed on screen, therefore you can modify that representation, interact with it, or add all kinds of custom behaviours and screen widgets, like information, draggers, anchors or temporary entities.


<div class="mw-translate-fuzzy">
== Customizing FreeCAD ==
這個頁面還在早期開發階段。如果你找不到你所需要的資訊,或是你在其他地方找到有用的資訊,請在[http://forum.freecadweb.org/ 論壇]上留言,或者何不[[Help_FreeCAD| 直接由你來幫忙增加本頁面的內容!]]
</div>


<span id="Customizing_FreeCAD"></span>
* [[Interface Customization]]: Starting with the beginning: Toolbars and shortcuts
== 客製化 FreeCAD ==
* [[Macros|Working with Macros]]: Easily record often repeated tasks or Python code

* [[Macros_recipes|Macros recipes]]
<div class="mw-translate-fuzzy">
* [[Customize_ToolsBar|Customize ToolsBar]]
* [[Interface Customization|客製化介面]]: Starting with the beginning: Toolbars and shortcuts
* [[Installing_more_workbenches|Installing more workbenches]]
* [[Macros|使用Marco]]: Easily record often repeated tasks or Python code
* [http://forum.freecadweb.org/viewtopic.php?t=10556 Plugin Loader]
* [[Macros_recipes|Macros 範例]]
* [[Customize_Toolbars|客製化工具列]]
* [[Installing_more_workbenches|安裝更多的workbench]]
* [http://forum.freecadweb.org/viewtopic.php?t=10556 外掛程式載入器]
* [https://github.com/FreeCAD/FreeCAD-addons Addons installer.FCMacro]
* [https://github.com/FreeCAD/FreeCAD-addons Addons installer.FCMacro]
</div>


<span id="Scripting_in_FreeCAD"></span>
== Scripting in FreeCAD ==
在FreeCAD撰寫腳本


===General===
===General===

* [[Introduction to Python]] - See also other Python tutorials at the bottom of this page
<div class="mw-translate-fuzzy">
* [[Python scripting tutorial|FreeCAD scripting tutorial]] - A general look at python scripting in FreeCAD
===一般主題===
* [[FreeCAD Scripting Basics]]: Well, the basics...
* [[Introduction to Python| 介紹 Python]] - See also other Python tutorials at the bottom of this page
* [[Gui Command]] : Adding custom commands to the GUI
* [[Python scripting tutorial|FreeCAD 腳本撰寫教學]] - A general look at python scripting in FreeCAD
* [[FreeCAD Scripting Basics |FreeCAD腳本基礎篇]]: Well, the basics...
* [[Gui Command |人機介面命令]] : Adding custom commands to the GUI
* Using mixed [[Units]] in FreeCAD
* Using mixed [[Units]] in FreeCAD
</div>


=== Modules ===
<span id="Modules"></span>
=== 模組 ===


As the functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.
The functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.


<div class="mw-translate-fuzzy">
* The [[Builtin modules]] are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
* The [[Builtin modules|內建模組]] are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
* [[Workbench creation]] shows you how to create your own workbench
* [[Workbench creation| 創造Workbench]] shows you how to create your own workbench
</div>


===Working with Meshes===
====Working with Meshes====
* [[Mesh Scripting]]: How to interact with the [[Mesh Module]]


* [[Mesh Scripting|Mesh Scripting]]: How to interact with the [[Mesh_Workbench|Mesh Workbench]]

====Working with Parts====

<div class="mw-translate-fuzzy">
===Working with Parts===
===Working with Parts===
* [[Part Module|The Part Module]]: How [http://en.wikipedia.org/wiki/Open_CASCADE Open CASCADE Technology] tools and structure is used in FreeCAD
* [[Part_Workbench|零件模組]]: How [http://en.wikipedia.org/wiki/Open_CASCADE Open CASCADE Technology] tools and structure is used in FreeCAD
* [[Topological data scripting]]: How to interact with the Part Module
* [[Topological data scripting |寫腳本來操作拓樸資料]]: How to interact with the Part Workbench
* [[PythonOCC]]: How to unleash the whole Open CASCADE power
* [[PythonOCC]]: How to unleash the whole Open CASCADE power
* [[Mesh to Part]]: Converting between object types
* [[Mesh to Part|從mesh檔到零件檔]]: Converting between object types
</div>

====Accessing the Coin scenegraph====


===Accessing the Coin scenegraph===
* [[Scenegraph|The Coin/Inventor scenegraph]]: How the FreeCAD scene representation works
* [[Scenegraph|The Coin/Inventor scenegraph]]: How the FreeCAD scene representation works
* [[Pivy]]: How to access and modify the scenegraph
* [[Pivy|Pivy]]: How to access and modify the scenegraph


===Controlling the Qt interface===
===Controlling the Qt interface===

<div class="mw-translate-fuzzy">
===控制Qt介面===
* [[PySide]]: How to access the interface, and modify its contents
* [[PySide]]: How to access the interface, and modify its contents
* [[Embedding FreeCADGui|Using the FreeCAD GUI]] in another Qt application with PyQt
* [[Embedding FreeCADGui|Using the FreeCAD GUI]] in another Qt application with PyQt
</div>


<span id="Working_with_parametric_objects"></span>
<div class="mw-translate-fuzzy">
===Working with parametric objects===
===Working with parametric objects===
* [[Scripted objects]]: How to make 100% Python-scripted objects in FreeCAD
* [[Scripted objects]]: How to make 100% Python-scripted objects in FreeCAD
* [[Drawing Module]]: Automating the 3D-to-2D process
* [[Drawing Workbench |工程圖模組]]: Automating the 3D-to-2D process
</div>


* [[Scripted_objects|Scripted objects]]: how to make 100% Python-scripted objects.
** [[Scripted_objects_with_attachment|Scripted objects with attachment]]: how to make scripted objects attachable to other objects.
** [[Scripted_objects_saving_attributes|Scripted objects saving attributes]]: how to save and restore attributes of the proxy class with {{incode|dumps}} and {{incode|loads}}.
** [[Scripted_objects_migration|Scripted objects migration]]: how to migrate old scripted objects to a new class.

===Examples===

<div class="mw-translate-fuzzy">
===Examples===
===Examples===
* [[Code snippets]] : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
* [[Code snippets |範例小程式]] : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
* [[Line drawing function]]: How to build a simple tool to draw lines
* [[Line drawing function]]: How to build a simple tool to draw lines
* [[Dialog creation]]: How to construct dialogs with Qt designer, and use them in FreeCAD
* [[Dialog creation]]: How to construct dialogs with Qt designer, and use them in FreeCAD
* [[Embedding FreeCAD]]: How to import FreeCAD as a Python module in other applications
* [[Embedding FreeCAD]]: How to import FreeCAD as a Python module in other applications
* The [[Draft Module]] adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
* The [[Draft Workbench]] adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
* [[FreeCAD vector math library]] : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.
* [[FreeCAD vector math library]] : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.
</div>


== API Functions ==
== API Functions ==


The complete API description can be found [[:Category:API|here]]. Note that it can be incomplete, since we still didn't find a way to include it automatically on this wiki. For more accurate information, browse the modules directly from FreeCAD.
The complete API documentation of FreeCAD is located at http://www.freecadweb.org/api/ . It contains both C++ and Python APIs, and is not totally well formatted yet, which can be confusing when looking for python-only code. An easier to browse version can be found [[:Category:API|here]]. Note that it can be incomplete, since it is updated manually. For more accurate information, browse the modules directly from FreeCAD's Python console.

Related: [[Exposing_C%2B%2B_to_Python|Exposing C++ to Python]]


== Advanced modification ==
== Advanced modification ==


* [[Start up and Configuration]]: Startup and command line options
* [[Start_up_and_Configuration|Start up and Configuration]]: Startup and command line options
* [[Install on Windows]]: Using the windows installer
* [[Installing_on_Windows|Installing on Windows]]: Using the windows installer
* [[CompileOnWindows|Compiling FreeCAD on Windows]] and [[CompileOnUnix|Compiling FreeCAD on Unix]]
* [[Compile_on_Windows|Compiling FreeCAD on Windows]] and [[Compile_on_Linux|Compiling FreeCAD on Linux]]
* [[Branding]]: Simple modifications you can do to the source code to change some aspects of FreeCAD
* [[Branding|Branding]]: Simple modifications you can do to the source code to change some aspects of FreeCAD
* [[Extra python modules]] : Extend the FreeCAD python interpreter with these powerful modules!
* [[Extra_python_modules|Extra python modules]] : Extend the FreeCAD python interpreter with these powerful modules!


== Python tutorials ==
== Python tutorials ==
Line 88: Line 128:


'''Python'''
'''Python'''
* [https://docs.python.org/2.7/tutorial/index.html Official python tutorial] - A very complete tutorial for discovering python
* [https://docs.python.org/3/tutorial/index.html Official python tutorial] - A very complete tutorial for discovering python
* [http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python Non-programmer tutorial for python] - an excellent wikibook
* [https://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_3 Non-programmer tutorial for python] - an excellent wikibook
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python for newbies] - one big tutorial covering all the basics
* [http://npt.cc.rsu.ru/user/wanderer/ODP/Python_for_Newbies.htm Python for newbies] - one big tutorial covering all the basics


Line 102: Line 142:
The following two references are PyQt specific (not PySide) but may offer some information of use:
The following two references are PyQt specific (not PySide) but may offer some information of use:
* [http://www.cs.usfca.edu/~afedosov/qttut/ Basic PyQt tutorial] : A simple and short linux-based tutorial that will explain how to work with PyQt and Qt Designer
* [http://www.cs.usfca.edu/~afedosov/qttut/ Basic PyQt tutorial] : A simple and short linux-based tutorial that will explain how to work with PyQt and Qt Designer
* [http://vizzzion.org/?id=pyqt Programming Qt applications in python] : A more in-depth tutorial covering all the process of working with qt and python.
* [http://vizzzion.org/?id=pyqt Programming Qt applications in python] : A more in-depth tutorial covering all the process of working with qt and python


'''Pivy''' - How to interact with FreeCAD's 3D scenes
'''Pivy''' - How to interact with FreeCAD's 3D scenes
* [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.108.947&rep=rep1&type=pdf Pivy - Embedding a Dynamic Scripting Language into a Scene Graph Library] : Thesis that explains Pivy in detail
* [http://pivy.coin3d.org/documentation/pycon Basic Pivy tutorial] : A very simple tutorial form the official Pivy site
* [http://ftp.ntua.gr/mirror/python/pycon/dc2004/papers/47/ High Level 3D Graphics Programming in Python] : Pivy example from Pycon 2004
* [http://www.google.com.br/url?sa=U&start=3&q=http://studierstube.icg.tu-graz.ac.at/doc/pdf/PivyStudierstubeTutorial.pdf&ei=XyC1Sc2wOeCKmQem_eHnBQ&usg=AFQjCNEYhb-0DcUc6OxFVijAe1epBb-4aA Introducing Pivy into studierstube] : A document that is not really a tutorial, but that illustrates well how Pivy works
* [https://www.semanticscholar.org/paper/Integrating-Pivy-into-Studierstube-4.2-Gruber/08c9a89c8326c87f81c2d83428029fbfb6c2ae64 Introducing Pivy into studierstube] [https://www.researchgate.net/publication/228737136_Integrating_Pivy_into_Studierstube_42 (Mirror)] : A paper that is not really a tutorial, but that illustrates well how Pivy works (requires an academic account)


== Community projects ==
== Community projects ==


On the [[FreeCAD Community Portal|Community portal]], you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to [[Help FreeCAD]].
On the [[FreeCAD Community Portal|Community portal]], you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to [[Help FreeCAD|Help FreeCAD]].


* [[Scientific_literature|Scientific literature]]: articles that reference or use the FreeCAD system in different ways.
[[Category:Hubs/zh-tw]]
[[Category:Poweruser Documentation/zh-tw]]




{{Powerdocnavi{{#translation:}}}}
<languages/>
[[Category:Hubs{{#translation:}}]]

Latest revision as of 09:01, 27 January 2024


這是一個讓你更加深入了解FreeCAD的地方。在這裡你可以學習如何為你的需求客製化FreeCAD。

FreeCAD有一個最棒的特色就是你可以藉由腳本來擴充功能並且幾乎沒有限制,而且你並不需要接觸到FreeCAD本身的原始碼或是編譯任何東西。所有的腳本都是由Python這個簡單但是強大的程式語言寫成的。藉由Python你幾乎可以使用FreeCAD的各種功能。舉例來說,你可以:

  • 創造和修改模型:你有一些特殊的模型是FreeCAD的預設安裝中沒有的嗎?你可以容易地創造出一個物件型態,不論是從scratch 或是藉由adapting an existing type。
  • 製作客製化工具以及命令: 目前為止FreeCAD已經擁有許多功能,但還沒有足夠多方便的功能給終端使用者。不過他已經可以容易的製作出你自己的工具組。
  • 修改介面: FreeCAD的使用者介面現階段依然十分的基本。不過你可以擴展任何你需要的東西。例如,創建一個工具列並將你的工具放入,建立特別的控制面板來和你的工具互動等等。
  • 修改場景表現: FreeCAD有separate processes 來建立與計算幾何模型,並且將它顯示在你的螢幕。你可以全方位的控制展現在你螢幕上的東西,因此你可以改變他的展現方式,與場景互動或是增加各種客製化的動作和螢幕小工具,例如顯示目前資訊、拖拉圖案、anchors 、或者暫時的實體。

這個頁面還在早期開發階段。如果你找不到你所需要的資訊,或是你在其他地方找到有用的資訊,請在論壇上留言,或者何不 直接由你來幫忙增加本頁面的內容!

客製化 FreeCAD

在FreeCAD撰寫腳本

General

一般主題

模組

The functionality of FreeCAD is separated in Modules which deal with special data types and applications. FreeCAD has built-in modules and Extension Modules (plug-ins). Once plugin modules are installed, they become availible to you as easily as the built-in modules. The modules described below are the default modules, includeed in every FreeCAD installation.

  • The 內建模組 are the principal FreeCAD modules. They contain tools for manipulating general FreeCAD configurations, documents and their contents.
  • 創造Workbench shows you how to create your own workbench

Working with Meshes

Working with Parts

Working with Parts

Accessing the Coin scenegraph

Controlling the Qt interface

控制Qt介面

Working with parametric objects

Examples

Examples

  • 範例小程式 : A collection of pieces of FreeCAD Python code, to serve as ingredients in your scripts...
  • Line drawing function: How to build a simple tool to draw lines
  • Dialog creation: How to construct dialogs with Qt designer, and use them in FreeCAD
  • Embedding FreeCAD: How to import FreeCAD as a Python module in other applications
  • The Draft Workbench adds basic 2d drawing functions to freecad. It is written entirely in Python, so it can be a good example if you want to write your own modules.
  • FreeCAD vector math library : A couple of handy functions to manipulate FreeCAD vectors. This library is also included in the Draft module.

API Functions

The complete API documentation of FreeCAD is located at http://www.freecadweb.org/api/ . It contains both C++ and Python APIs, and is not totally well formatted yet, which can be confusing when looking for python-only code. An easier to browse version can be found here. Note that it can be incomplete, since it is updated manually. For more accurate information, browse the modules directly from FreeCAD's Python console.

Related: Exposing C++ to Python

Advanced modification

Python tutorials

These are good generic tutorials, not specific to FreeCAD, that might interest you if you are totally new to python.

Python

PySide - How to create and manage FreeCAD's Qt UI interface from python

The following two references are PyQt specific (not PySide) but may offer some information of use:

Pivy - How to interact with FreeCAD's 3D scenes

Community projects

On the Community portal, you can find other FreeCAD-based projects run by the FreeCAD users community. If you are starting a new FreeCAD project, be sure to list it there! We also have a page with things you can do if you would like to Help FreeCAD.