Part Module/zh-cn: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(34 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
{{Docnav |
{{Docnav |
||
|[[ |
|[[OpenSCAD_Workbench|OpenSCAD Workbench]] |
||
|[[ |
|[[PartDesign_Workbench|PartDesign Workbench]] |
||
|IconL=Workbench_OpenSCAD.svg |
|IconL=Workbench_OpenSCAD.svg |
||
|IconR=Workbench_PartDesign.svg |
|IconR=Workbench_PartDesign.svg |
||
Line 8: | Line 9: | ||
[[Image:Workbench_Part.svg|thumb|128px|Part workbench icon]] |
[[Image:Workbench_Part.svg|thumb|128px|Part workbench icon]] |
||
{{TOCright}} |
{{TOCright}} |
||
== Introduction == |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
== 简介 == |
== 简介 == |
||
FreeCAD的实体建模能力都是基于 [http://en.wikipedia.org/wiki/Open_Cascade_Technology Open Cascade Technology] (OCCT)内核——一种具有创建与处理高级3D几何体等特性的专业级CAD系统。[[Part Workbench|零件工作台(Part Workbench)]]是一种建立于OCCT库之上的层级,为用户提供了访问OCCT几何图元与函数的功能。每种工作台(如[[Draft Workbench|底图]]工作台, [[Sketcher Workbench|草图]]工作台, [[PartDesign Workbench|零件设计]]工作台等等)的一切2D与3D绘制功能其实都是基于零件工作台暴露出的函数实现的。因此,可以认为零件工作台是FreeCAD建模功能的核心组件。 |
FreeCAD的实体建模能力都是基于 [http://en.wikipedia.org/wiki/Open_Cascade_Technology Open Cascade Technology] (OCCT)内核——一种具有创建与处理高级3D几何体等特性的专业级CAD系统。[[Part Workbench|零件工作台(Part Workbench)]]是一种建立于OCCT库之上的层级,为用户提供了访问OCCT几何图元与函数的功能。每种工作台(如[[Draft Workbench|底图]]工作台, [[Sketcher Workbench|草图]]工作台, [[PartDesign Workbench|零件设计]]工作台等等)的一切2D与3D绘制功能其实都是基于零件工作台暴露出的函数实现的。因此,可以认为零件工作台是FreeCAD建模功能的核心组件。 |
||
</div> |
</div> |
||
A more detailed discussion of Part workbench versus Part Design workbench can be found here: [[Part_and_PartDesign|Part and Part Design]]. |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
Line 18: | Line 25: | ||
</div> |
</div> |
||
<div class="mw-translate-fuzzy"> |
|||
零件对象比[[Mesh Workbench|网格工作台(Mesh Workbench)]]创建的网格对象更为复杂,因为用户可以对前者执行更为高级的操作,如连续的布尔运算、修改历史与参数化处理。 |
零件对象比[[Mesh Workbench|网格工作台(Mesh Workbench)]]创建的网格对象更为复杂,因为用户可以对前者执行更为高级的操作,如连续的布尔运算、修改历史与参数化处理。 |
||
</div> |
|||
[[Image:Part_Workbench_relationships.svg|600px]] |
[[Image:Part_Workbench_relationships.svg|600px]] |
||
<div class="mw-translate-fuzzy"> |
|||
{{Caption|零件工作台是最基础的层级,它为FreeCAD中的其他工作台暴露出OCCT的各种绘制函数}} |
{{Caption|零件工作台是最基础的层级,它为FreeCAD中的其他工作台暴露出OCCT的各种绘制函数}} |
||
</div> |
|||
<span id="Tools"></span> |
|||
== 工具 == |
== 工具 == |
||
<div class="mw-translate-fuzzy"> |
|||
这些工具皆位于{{MenuCommand|Part}}菜单。 |
这些工具皆位于{{MenuCommand|Part}}菜单。 |
||
</div> |
|||
<span id="Primitives"></span> |
|||
<div class="mw-translate-fuzzy"> |
|||
===图元=== |
===图元=== |
||
</div> |
|||
以下这些工具用于创建图元对象。 |
以下这些工具用于创建图元对象。 |
||
Line 42: | Line 59: | ||
</div> |
</div> |
||
* [[Image:Part_Cylinder.svg|32px]] [[Part_Cylinder|Cylinder]]: Creates a cylinder. |
|||
* [[Image:Part_Sphere.svg|32px]] [[Part_Sphere|Sphere]]: Creates a sphere. |
|||
* [[Image:Part_Cone.svg|32px]] [[Part_Cone|Cone]]: Creates a cone. |
|||
* [[Image:Part_Torus.svg|32px]] [[Part_Torus|Torus]]: Creates a torus. |
|||
* [[File:Part_Tube.svg|32px]] [[Part_Tube|Tube]]: Creates a tube. |
|||
* [[Image:Part_Primitives.svg|32px]] [[Part_Primitives|Create primitives...]]: A tool to create one of the following primitives: |
|||
**[[Image:Part_Plane.svg|32px]] [[Part_Plane|Plane]]: Creates a plane. |
|||
**[[Image:Tree_Part_Box_Parametric.svg|32px]] [[Part_Box|Box]]: Creates a box. This object can also be created with the [[Image:Part_Box.svg|32px]] [[Part_Box|Box]] tool. |
|||
**[[Image:Tree_Part_Cylinder_Parametric.svg|32px]] [[Part_Cylinder|Cylinder]]: Creates a cylinder. This object can also be created with the [[Image:Part_Cylinder.svg|32px]] [[Part_Cylinder|Cylinder]] tool. |
|||
**[[Image:Tree_Part_Cone_Parametric.svg|32px]] [[Part_Cone|Cone]]: Creates a cone. This object can also be created with the [[Image:Part_Cone.svg|32px]] [[Part_Cone|Cone]] tool. |
|||
**[[Image:Tree_Part_Sphere_Parametric.svg|32px]] [[Part_Sphere|Sphere]]: Creates a sphere. This object can also be created with the [[Image:Part_Sphere.svg|32px]] [[Part_Sphere|Sphere]] tool. |
|||
**[[Image:Part_Ellipsoid.svg|32px]] [[Part_Ellipsoid|Ellipsoid]]: Creates a ellipsoid. |
|||
**[[Image:Tree_Part_Torus_Parametric.svg|32px]] [[Part_Torus|Torus]]: Creates a torus. This object can also be created with the [[Image:Part_Torus.svg|32px]] [[Part_Torus|Torus]] tool. |
|||
**[[Image:Part_Prism.svg|32px]] [[Part_Prism|Prism]]: Creates a prism. |
|||
**[[Image:Part_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Creates a wedge. |
|||
**[[Image:Part_Helix.svg|32px]] [[Part_Helix|Helix]]: Creates a helix. |
|||
**[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Creates a spiral. |
|||
**[[Image:Part_Circle.svg|32px]] [[Part_Circle|Circle]]: Creates a circular arc. |
|||
**[[Image:Part_Ellipse.svg|32px]] [[Part_Ellipse|Ellipse]]: Creates an elliptical arc. |
|||
**[[Image:Part_Point.svg|32px]] [[Part_Point|Point]]: Creates a point. |
|||
**[[Image:Part_Line.svg|32px]] [[Part_Line|Line]]: Creates a line. |
|||
**[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular polygon]]: Creates a regular polygon. |
|||
* [[Image:Part_Builder.svg|32px]] [[Part_Builder|Shape builder...]]: Creates shapes from various primitives. |
|||
<span id="Creation_and_modification"></span> |
|||
<div class="mw-translate-fuzzy"> |
|||
==修改对象== |
==修改对象== |
||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
这些工具用于修改已存在的对象。通过它们即可选取待修改的对象。 |
这些工具用于修改已存在的对象。通过它们即可选取待修改的对象。 |
||
</div> |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
Line 57: | Line 109: | ||
</div> |
</div> |
||
* [[Image:Part_Revolve.svg|32px]] [[Part_Revolve|Revolve]]: Creates a solid by revolving an object (not a solid) around an axis. |
|||
<div class="mw-translate-fuzzy"> |
|||
* [[Image:Part_CompOffsetTools.png|48px]] [[Part_CompOffsetTools|Offset tools]]: |
|||
** [[Image:Part_Offset.png|32px]] [[Part_Offset|3D Offset]]: 根据原始几何形状在特定的距离处构建一个平行的副本。 |
|||
** [[Image:Part_Offset2D.png|32px]] [[Part_Offset2D|2D Offset]]: 根据原始连线在特定的距离处创建一个平行的副本,或者缩放一个平面端面。(v0.17) |
|||
</div> |
|||
* [[Image:Part_Mirror.svg|32px]] [[Part_Mirror|Mirror]]: Mirrors the selected object across a mirror plane. |
|||
<div class="mw-translate-fuzzy"> |
|||
* [[Image:Part_Thickness.png|32px]] [[Part_Thickness|Thickness]]: 镂空一个实体,在选中的面上留下开口。 |
|||
</div> |
|||
* [[Image:Part_Scale.svg|32px]] [[Part_Scale|Scale]]: Scales one or more shapes. {{Version|0.22}} |
|||
<div class="mw-translate-fuzzy"> |
|||
* [[Image:Part_ProjectionOnSurface.png|32px]] [[Part_ProjectionOnSurface|Projection on surface]]: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19) |
|||
</div> |
|||
* [[Image: |
* [[Image:Part_Fillet.svg|32px]] [[Part_Fillet|Fillet]]: Fillets (rounds) edges of an object. |
||
** [[Image:Part_Compound.svg|32px]] [[Part_Compound|Make compound]]: Creates a compound from the selected objects. |
|||
** [[Image:Part_ExplodeCompound.svg|32px]] [[Part_ExplodeCompound|Explode Compound]]: Tool to split up compounds of shapes |
|||
** [[Image:Part CompoundFilter.svg|32px]] [[Part CompoundFilter|Compound Filter]]: The CompoundFilter can be used to extract the individual pieces. |
|||
* [[Image:Part_Chamfer.svg|32px]] [[Part_Chamfer|Chamfer]]: Chamfers edges of an object. |
|||
<div class="mw-translate-fuzzy"> |
|||
* [[Image:Part_Booleans.png|32px]] [[Part_Booleans|Booleans]]: 在对象上执行布尔运算 |
|||
* [[Image:Part_Union.png|32px]] [[Part_Union|Union]]: 将两个对象融为一体 (并集) |
|||
* [[Image:Part_Common.png|32px]] [[Part_Common|Common]]: 提取出两个对象中的共有部分(交集) |
|||
* [[Image:Part_Cut.png|32px]] [[Part_Cut|Cut]]: 从一个对象中去掉另一个对象(差集) |
|||
</div> |
|||
* [[File:Part_MakeFace.svg|32px]] [[Part_MakeFace|Make face from wires]]: Makes a face from a set of wires (contours). |
|||
* [[Image:Part_CompJoinFeatures.png|48px]] [[Part CompJoinFeatures|Join features]]: smart booleans for walled objects (e.g., pipes) {{Version|0.16}} |
|||
** [[Image:Part_JoinConnect.svg|32px]] [[Part_JoinConnect|Connect]]: Connects interiors of objects {{Version|0.16}} |
|||
** [[Image:Part_JoinEmbed.svg|32px]] [[Part_JoinEmbed|Embed]]: Embeds a walled object into another walled object {{Version|0.16}} |
|||
** [[Image:Part_JoinCutout.svg|32px]] [[Part_JoinCutout|Cutout]]: Creates a cutout in a wall of an object for another walled object {{Version|0.16}} |
|||
* [[Image:Part_RuledSurface.svg|32px]] [[Part_RuledSurface|Ruled Surface]]: Creates a ruled surface. |
|||
* [[Image:Part_CompSplittingTools.png|48px]] [[Part CompSplittingTools|Splitting tools]]: {{Version|0.17}} |
|||
** [[Image:Part_BooleanFragments.svg|32px]] [[Part_BooleanFragments|Boolean fragments]]: makes all the pieces that can be obtained by Boolean operations between objects {{Version|0.17}} |
|||
** [[Image:Part SliceApart.svg|32px]] [[Part_SliceApart|Slice a part]]: tool to split shapes by intersection with other shapes |
|||
** [[Image:Part_Slice.svg|32px]] [[Part_Slice|Slice]]: Splits an object into pieces by intersections with another object {{Version|0.17}} |
|||
** [[Image:Part_XOR.svg|32px]] [[Part_XOR|XOR]]: removes space shared by even number of objects (symmetric version of [[Part_Cut|Cut]]) {{Version|0.17}} |
|||
* [[Image: |
* [[Image:Part_Loft.svg|32px]] [[Part_Loft|Loft]]: Lofts from one profile to another. |
||
* [[Image:Part_Section.svg|32px]] [[Part_Section|Section]]: Creates a section by intersecting an object with a section plane |
|||
* [[Image:Part_CrossSections.svg|32px]] [[Part_SectionCross|Cross sections...]]: Creates one or more cross-sections through a selected shape |
|||
* [[Image:Part Attachment.svg|32px]] [[Part Attachment|Attachment]]: attachment is a utility to attach an object to another one. |
|||
* [[Image:Part_Sweep.svg|32px]] [[Part_Sweep|Sweep]]: Sweeps one or more profiles along a path. |
|||
=== Measure === |
|||
* [[Image:Part_Section.svg|32px]] [[Part_Section|Section]]: Creates a section by intersecting an object with a section plane. |
|||
[[File:Std Measure Menu.png|64px]] [[Std Measure Menu|Measure]]: Allows linear and angular measurement between points, edges, and faces. |
|||
* [[Image: |
* [[Image:Part_CrossSections.svg|32px]] [[Part_CrossSections|Cross sections...]]: Creates one or more cross-sections through an object. |
||
* [[Image:Part_Measure_Angular.svg|32px]] [[Part_Measure_Angular|Measure Angular]] allows you to make angular measurements. |
|||
* [[Image:Part_Measure_Refresh.svg|32px]] [[Part_Measure_Refresh|Measure Refresh]] updates the measurements on screen. |
|||
* [[Image:Part_Measure_Clear_All.svg|32px]] [[Part_Measure_Clear_All|Clear All]] Clears all measurements. |
|||
* [[Image:Part_Measure_Toggle_All.svg|32px]] [[Part_Measure_Toggle_All|Toggle All]] shows or hides all measurements. |
|||
* [[Image:Part_Measure_Toggle_3d.svg|32px]] [[Part_Measure_Toggle_3d|Toggle 3D]] shows or hides 3D measurements. |
|||
* [[Image:Part_Measure_Toggle_Delta.svg|32px]] [[Part_Measure_Toggle_Delta|Toggle Delta]] shows or hides delta measurements. |
|||
===其他工具=== |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
* [[Image:Part_CompOffsetTools.png|48px]] [[Part_CompOffsetTools|Offset tools]]: |
|||
* [[Image:Part ImportCAD.png|32px]] [[Part ImportCAD|Import CAD]]: 您可利用此工具为当前文档添加*.IGES、*.STEP、*.BREP文档。 |
|||
* [[Image: |
** [[Image:Part_Offset.png|32px]] [[Part_Offset|3D Offset]]: 根据原始几何形状在特定的距离处构建一个平行的副本。 |
||
* [[Image: |
** [[Image:Part_Offset2D.png|32px]] [[Part_Offset2D|2D Offset]]: 根据原始连线在特定的距离处创建一个平行的副本,或者缩放一个平面端面。(v0.17) |
||
* [[Part ConvertToSolid|Convert to solid]]: 将一个几何形状对象转换为一个实体对象。 |
|||
* [[Part ReverseShapes|Reverse shapes]]: 调转选中对象所有表面上的法线方向。 |
|||
* [[Image:Part CreateSimpleCopy.svg|32px]] [[Part CreateSimpleCopy|Create simple copy]]: 为选中的对象创建一个简单的副本。 |
|||
* [[Image:Part RefineShape.png|32px]] [[Part RefineShape|Refine shape]]: 通过去除不必要的线条来清理表面。 |
|||
* [[Image:Part CheckGeometry.png|32px]] [[Part CheckGeometry|Check geometry]]: 检测选中对象的几何体是否存在错误。 |
|||
* [[Std Measure Menu|Measure]]: 令用户可以实现点/边/面间的线性测量与角度测量。 |
|||
* [[Image:Part Attachment.svg|32px]] [[Part Attachment|Attachment]]: 本工具的功能为令一个对象附着于另一对象之上。 |
|||
</div> |
</div> |
||
* Create a copy: |
|||
** [[Image:Part_SimpleCopy.svg|32px]] [[Part_SimpleCopy|Create simple copy]]: Creates a simple copy of the selected object. |
|||
** [[File:Part_TransformedCopy.svg|32px]] [[Part_TransformedCopy|Create transformed copy]]: creates a transformed copy of the selected object. {{Version|0.19}} |
|||
** [[File:Part_ElementCopy.svg|32px]] [[Part_ElementCopy|Create shape element copy]]: creates a copy from an element (vertex, edge, face) of the selected object. {{Version|0.19}} |
|||
** [[Image:Part_RefineShape.svg|32px]] [[Part_RefineShape|Refine shape]]: Cleans faces by removing unnecessary lines. |
|||
* [[Image:Part_CheckGeometry.svg|32px]] [[Part CheckGeometry|Check geometry]]: Checks the geometry of selected objects for errors. |
|||
== 首选项 == |
|||
* [[Image:Preferences-import-export.svg|32px]] [[Import_Export_Preference|Preference ...]] 导入 导出 |
|||
== OCCT中的几何概念 == |
|||
在OpenCascade术语中,我们会在几何图元(geometric primitive)与拓扑形状(topological shape)之间进行区分。一个几何图元可以是点、线、圆、平面等等,甚至还可以为类似于B-样条曲线或表面(surface)这样更为复杂的图元类型。而拓扑形状则可以是顶点、边、连线、面(face)、实体或其他形状所复合而成的对象。几何图元不能直接显示于3D场景中,却常用于构建拓扑形状的几何图形。例如,一条边可由线或部分圆来构建而成。 |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
* [[Image:Part_Thickness.png|32px]] [[Part_Thickness|Thickness]]: 镂空一个实体,在选中的面上留下开口。 |
|||
总而言之,几何图元都是“无形状”的基本构成单位,而拓扑形状则是基于前者所构建的实体对象。 |
|||
</div> |
</div> |
||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
* [[Image:Part_ProjectionOnSurface.png|32px]] [[Part_ProjectionOnSurface|Projection on surface]]: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19) |
|||
至于全部图元与形状的完整列表可参考 [http://www.opencascade.org/org/doc/ OCC文档] (或者: [http://opencascade.sourcearchive.com/documentation/6.3.0.dfsg.1-1/classes.html sourcearchive.com])以'''Geom_*'''搜索几何图元,以'''TopoDS_*'''搜索拓扑形状。在此,您可以阅读到两者间更多的不同点。请注意,官方的OCC文档并不存在于网络上(您必须下载一份存档文件),而且它主要为程序员而设,并非终端用户。但是,仍希望您能以此为起点来查找更为深入的信息。 |
|||
</div> |
</div> |
||
* [[Image:Part_EditAttachment.svg|32px]] [[Part_EditAttachment|Attachment]]: Attaches an object to another object. |
|||
<blockquote style="color: slategray">''At a very high level, topology tells what pieces an object is made of, and the logical relationships between them. A shape is made of a certain set of faces. A face is bounded by a certain set of edges. Two faces are adjacent if they share a common edge.''</blockquote> |
|||
=== Boolean === |
|||
<blockquote style="color: slategray">''Topology alone does not tell you the size, curvature, or 3D locations of any of those pieces. However, each piece of topology does knows about it's underlying geometry. A face knows what surface it lies on. An edge knows what curve it lies on. The geometry knows about curvature and location in space.'' - [https://www.opencascade.com/content/geometry-and-topology Source]</blockquote> |
|||
These tools perform boolean operations. |
|||
<hr /> |
|||
* [[Image:Part_CompCompoundTools.png|48px]] [[Part_CompCompoundTools|Compound Tools]]: |
|||
<blockquote style="color: slategray">''Thus, Topology defines the relationship between simple geometric entities, which can be linked together to represent complex shapes.'' - [https://www.opencascade.com/doc/occt-7.0.0/overview/html/occt_user_guides__modeling_data.html Modeling Data User's Guide]</blockquote> |
|||
** [[Image:Part_Compound.svg|32px]] [[Part_Compound|Make compound]]: Creates a compound from the selected objects. |
|||
** [[Image:Part_ExplodeCompound.svg|32px]] [[Part_ExplodeCompound|Explode Compound]]: Splits up compounds. |
|||
** [[Image:Part CompoundFilter.svg|32px]] [[Part_CompoundFilter|Compound Filter]]: Extracts the individual pieces from compounds. |
|||
* [[Image:Part_Boolean.svg|32px]] [[Part_Boolean|Boolean]]: 在对象上执行布尔运算 |
|||
[[File:ClassTopoDS_Shape_inherit_graph.png]] |
|||
* [[Image:Part_Cut.svg|32px]] [[Part_Cut|Cut]]: Cuts (subtracts) one object from another. |
|||
<div class="mw-translate-fuzzy"> |
|||
几何类型实际可分为两大关键组群:曲线(curve)与表面(surface)。您可利用曲线(线、圆……)来直接构建一个边,而采用表面(平面,圆柱体……)来构建一个面(face)。例如,几何图元中的线是无限长的,即它由一个基向量与一个方向向量定义而成,而线的拓扑形状表示却一定要以起点与终点来定义为有限长度。另外,一个立方体——一个实体——可用6个有限的平面来创建。 |
|||
</div> |
|||
* [[Image:Part_Fuse.svg|32px]] [[Part_Fuse|Fuse]]: Fuses (unions) two or more objects. |
|||
<div class="mw-translate-fuzzy"> |
|||
当然,您也可以将一条边或一个面还原为其对应的几何图元。 |
|||
</div> |
|||
* [[Image:Part_Common.svg|32px]] [[Part_Common|Common]]: Extracts the common (intersection) part of two objects. |
|||
<div class="mw-translate-fuzzy"> |
|||
这样一来,利用区区几种形状您就可以构建出灰常复杂的零件。反之,您亦可以从一个更加复杂的形状中提取出构成它的所有子形状。 |
|||
</div> |
|||
* [[Image:Part_CompJoinFeatures.png|48px]] [[Part CompJoinFeatures|Join features]]: |
|||
** [[Image:Part_JoinConnect.svg|32px]] [[Part_JoinConnect|Connect]]: Connects interiors of walled objects. |
|||
** [[Image:Part_JoinEmbed.svg|32px]] [[Part_JoinEmbed|Embed]]: Embeds a walled object into another walled object. |
|||
** [[Image:Part_JoinCutout.svg|32px]] [[Part_JoinCutout|Cutout]]: Creates a cutout in a wall of an object for another walled object. |
|||
* [[Image:Part_CompSplittingTools.png|48px]] [[Part CompSplittingTools|Splitting tools]]: |
|||
Thus, out of shapes you can build very complex parts or, the other way round, extract all sub-shapes a more complex shape is made of. |
|||
** [[Image:Part_BooleanFragments.svg|32px]] [[Part_BooleanFragments|Boolean fragments]]: Creates all pieces obtained from Boolean operations. |
|||
** [[Image:Part SliceApart.svg|32px]] [[Part_SliceApart|Slice apart]]: Slices and splits an object by intersecting it with other objects. |
|||
** [[Image:Part_Slice.svg|32px]] [[Part_Slice|Slice]]: Slices an object by intersecting it with other objects. |
|||
** [[Image:Part_XOR.svg|32px]] [[Part_XOR|XOR]]: Removes space shared by an even number of objects. |
|||
=== Measure === |
|||
[[File:Part_TopoShape_relationships.svg|600px]] |
|||
* [[Image:Part_Measure_Linear.svg|32px]] [[Part_Measure_Linear|Measure Linear]]: Creates a linear measurement. |
|||
{{Caption|The {{incode|Part::TopoShape}} class is the geometrical object that is seen on screen. Essentially all workbenches use these [[Part_TopoShape|TopoShapes]] internally to build and display edges, faces, and solids.}} |
|||
* [[Image:Part_Measure_Angular.svg|32px]] [[Part_Measure_Angular|Measure Angular]]: Creates an angular measurement. |
|||
== 脚本 == |
|||
* [[Image:Part_Measure_Refresh.svg|32px]] [[Part_Measure_Refresh|Measure Refresh]]: Updates all measurements. |
|||
{{Emphasis|参见:}} [[Part scripting|零件脚本]] |
|||
* [[Image:Part_Measure_Clear_All.svg|32px]] [[Part_Measure_Clear_All|Clear All]]: Clears all measurements. |
|||
零件模块中主要使用的数据结构为OpenCascade中的 [http://en.wikipedia.org/wiki/Boundary_representation BRep]数据类型。几乎零件模块中的所有内容与对象类型都可在[[Python|Python]]脚本中使用。这其中包括几何图元,如线段与圆形(或弧), 以及整个TopoShapes范畴,如顶点、边、连线、面、实体与组合对象。对于其中的每一种对象而言,都存在若干创建方法,而对于TopoShapes中的特定对象而言,还支持一些如布尔并集/差集/交集等高级操作。以[[FreeCAD Scripting Basics|FreeCAD脚本基础]]页面所述的方式来浏览零件模块中的内容,即可获悉更多详情。 |
|||
* [[Image:Part_Measure_Toggle_All.svg|32px]] [[Part_Measure_Toggle_All|Toggle All]]: Shows or hides all measurements. |
|||
The most basic object that can be created is a [[Part Feature|Part Feature]], which has a simple {{PropertyData|Placement}} property, and basic properties to define its color and appearance. |
|||
* [[Image:Part_Measure_Toggle_3D.svg|32px]] [[Part_Measure_Toggle_3D|Toggle 3D]]: Shows or hides 3D measurements. |
|||
Another simple object used in 2D geometrical objects is [[Part Part2DObject|Part Part2DObject]], which is the base of [[Sketcher_SketchObject|Sketcher SketchObject]] ([[Sketcher Workbench|Sketcher]]), and most [[Draft Workbench|Draft elements]]. |
|||
* [[Image:Part_Measure_Toggle_Delta.svg|32px]] [[Part_Measure_Toggle_Delta|Toggle Delta]]: Shows or hides delta measurements. |
|||
=== Test script === |
|||
<span id="Other_tools"></span> |
|||
Test the creation of [[Part_Primitives|Part Primitives]] with a script. {{Version|0.19}} |
|||
<div class="mw-translate-fuzzy"> |
|||
===其他工具=== |
|||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
{{Code|code= |
|||
* [[Image:Part Import.svg|32px]] [[Part Import/zh-cn|Import]]: 您可利用此工具为当前文档添加*.IGES、*.STEP、*.BREP文档。 |
|||
import parttests.part_test_objects as pto |
|||
</div> |
|||
pto.create_test_file("example_file") |
|||
}} |
|||
* [[File:Part_Export.svg|32px]] [[Part_Export|Export]]: Exports to *.IGES, *.STEP, or *.BREP files. |
|||
This script is located in the installation directory of the program, and can be examined to see how the basic primitives are built. |
|||
{{Code|code= |
|||
$INSTALL_DIR/Mod/Part/parttests/part_test_objects.py |
|||
}} |
|||
* [[File:Part_BoxSelection.svg|32px]] [[Part_BoxSelection|Box selection]]: Selects faces from a rectangular area. |
|||
=== 示例 === |
|||
* [[File:Part_ShapeFromMesh.svg|32px]] [[Part_ShapeFromMesh|Create shape from mesh]]: Creates a shape object from a mesh object. |
|||
为了创建一条线条元素,可以切换至Python控制台并录入: |
|||
* [[File:Part_PointsFromMesh.svg|32px]] [[Part_PointsFromMesh|Create points object from geometry]]: Creates a points object from a geometric object. |
|||
{{Code|code= |
|||
import Part,PartGui |
|||
doc=App.newDocument() |
|||
l=Part.LineSegment() |
|||
l.StartPoint=(0.0,0.0,0.0) |
|||
l.EndPoint=(1.0,1.0,1.0) |
|||
doc.addObject("Part::Feature","Line").Shape=l.toShape() |
|||
doc.recompute() |
|||
}} |
|||
* [[File:Part_MakeSolid.svg|32px]] [[Part_MakeSolid|Convert to solid]]: Converts a shape object to a solid object. |
|||
让我们来逐步分析上述python示例: |
|||
* [[File:Part_ReverseShape.svg|32px]] [[Part_ReverseShape|Reverse shapes]]: Flips the normals of all faces of selected objects. |
|||
{{Code|code= |
|||
import Part,PartGui |
|||
doc=App.newDocument() |
|||
}} |
|||
* Create a copy: |
|||
加载零件模块并创建一个新文档 |
|||
** [[File:Part_SimpleCopy.svg|32px]] [[Part_SimpleCopy|Create simple copy]]: Creates a simple copy of a selected object. |
|||
** [[File:Part_TransformedCopy.svg|32px]] [[Part_TransformedCopy|Create transformed copy]]: Creates a transformed copy of a selected object. |
|||
** [[File:Part_ElementCopy.svg|32px]] [[Part_ElementCopy|Create shape element copy]]: Creates a copy from an element (vertex, edge, face) of a selected object. |
|||
** [[Image:Part_RefineShape.svg|32px]] [[Part_RefineShape|Refine shape]]: Cleans faces by removing unnecessary lines. |
|||
* [[File:Part_CheckGeometry.svg|32px]] [[Part_CheckGeometry|Check geometry]]: Checks the geometry of selected objects for errors. |
|||
{{Code|code= |
|||
l=Part.LineSegment() |
|||
l.StartPoint=(0.0,0.0,0.0) |
|||
l.EndPoint=(1.0,1.0,1.0) |
|||
}} |
|||
* [[Image:Part Defeaturing.svg|32px]] [[Part_Defeaturing|Defeaturing]]: Removes features from an object. |
|||
线条其实就是线段,因为它具有起点和终点。 |
|||
=== Context menu items === |
|||
{{Code|code= |
|||
doc.addObject("Part::Feature","Line").Shape=l.toShape() |
|||
}} |
|||
* [[File:Std_SetAppearance.svg|32px]] [[Std_SetAppearance|Appearance]]: Determines the appearance of a whole object (color, transparency etc.). |
|||
这行代码为文档添加了一个零件对象类型,并为此对象的'Shape'属性设置为以线段进行形状表示。在此,关键是要理解我们通过几何图元(Part.LineSegment)创建了一个TopoShape(利用toShape()方法)。只有几何图形才能添加至文档中。在FreeCAD中,几何图元常用作几何图形的“基本组成结构”。 |
|||
* [[File:Part_ColorPerFace.svg|32px]] [[Part_ColorPerFace|Color per face]]: Assigns colors to individual faces of objects. |
|||
{{Code|code= |
|||
doc.recompute() |
|||
}} |
|||
<span id="Preferences"></span> |
|||
此句更新了文档。这为新零件对象的可视化表示做好了准备工作。 |
|||
== 首选项 == |
|||
<div class="mw-translate-fuzzy"> |
|||
请注意,我们可以直接通过在构造函数中指定起点与终点来创建一条线段,例如 Part.LineSegment(point1,point2),或者正如我们此前的做法,在创建一条默认线段后再调整其属性。 |
|||
* [[Image:Preferences-import-export.svg|32px]] [[Import_Export_Preferences|Preference ...]] 导入 导出 |
|||
</div> |
|||
<span id="Scripting"></span> |
|||
A Line can be created also using: |
|||
== 脚本 == |
|||
<div class="mw-translate-fuzzy"> |
|||
{{Code|code= |
|||
{{Emphasis|参见:}} [[Part scripting|零件脚本]] |
|||
import FreeCAD |
|||
</div> |
|||
import Part |
|||
DOC = FreeCAD.newDocument() |
|||
def mycreateLine(pt1, pt2, objName): |
|||
obj = DOC.addObject("Part::Line", objName) |
|||
obj.X1 = pt1[0] |
|||
obj.Y1 = pt1[2] |
|||
obj.Z1 = pt1[2] |
|||
obj.X2 = pt2[0] |
|||
obj.Y2 = pt2[1] |
|||
obj.Z2 = pt2[2] |
|||
DOC.recompute() |
|||
return obj |
|||
line = mycreateLine((0,0,0), (0,10,0), "LineName") |
|||
}} |
|||
以相似的方式来创建一个圆形: |
|||
{{Code|code= |
|||
import Part |
|||
doc = App.activeDocument() |
|||
c = Part.Circle() |
|||
c.Radius=10.0 |
|||
f = doc.addObject("Part::Feature", "Circle") |
|||
f.Shape = c.toShape() |
|||
doc.recompute() |
|||
}} |
|||
or using: |
|||
{{Code|code= |
|||
import FreeCAD |
|||
import Part |
|||
DOC = FreeCAD.newDocument() |
|||
def mycreateCircle(rad, objName): |
|||
obj = DOC.addObject("Part::Circle", objName) |
|||
obj.Radius = rad |
|||
DOC.recompute() |
|||
return obj |
|||
circle = mycreateCircle(5.0, "CircleName") |
|||
}} |
|||
请再次注意,这段代码利用圆形(几何图元)构建了一个几何形状。之后,我们依然能通过下列方式访问造型几何体: |
|||
{{Code|code= |
|||
s = f.Shape |
|||
e = s.Edges[0] |
|||
c = e.Curve |
|||
}} |
|||
在此,我们获取对象f的几何形状,再获得构成它的一系列边。在当前情况下只能获得一条边,因为我们用单个圆形构造了整个几何形状,因此只取边列表中的第一项,继而获得构成该形状的曲线。每条边都有一个曲线,几何图元就是基于它而成。 |
|||
如果您想了解更多请前往[[Topological data scripting|拓扑数据脚本]]页面。 |
|||
<span id="Tutorials"></span> |
|||
<div class="mw-translate-fuzzy"> |
|||
== 教程 == |
== 教程 == |
||
* [[Import_from_STL_or_OBJ|从STL或OBJ文件中导入数据]] : 如何在FreeCAD中导入STL/OBJ文件。 |
* [[Import_from_STL_or_OBJ|从STL或OBJ文件中导入数据]] : 如何在FreeCAD中导入STL/OBJ文件。 |
||
* [[Export_to_STL_or_OBJ|导出STL或OBJ文件]] : 如何从FreeCAD中导出STL/OBJ文件 |
* [[Export_to_STL_or_OBJ|导出STL或OBJ文件]] : 如何从FreeCAD中导出STL/OBJ文件 |
||
* [[Whiffle_Ball_tutorial|Whiffle球教程]] : 如何使用零件模块 |
* [[Whiffle_Ball_tutorial|Whiffle球教程]] : 如何使用零件模块 |
||
</div> |
|||
* [[Import_from_STL_or_OBJ|Import from STL or OBJ]] : How to import STL/OBJ files in FreeCAD |
|||
* [[Export_to_STL_or_OBJ|Export to STL or OBJ]] : How to export STL/OBJ files from FreeCAD |
|||
* [[Whiffle_Ball_tutorial|Whiffle Ball tutorial]] : How to use the Part Module |
|||
{{Docnav |
{{Docnav |
||
|[[ |
|[[OpenSCAD_Workbench|OpenSCAD Workbench]] |
||
|[[ |
|[[PartDesign_Workbench|PartDesign Workbench]] |
||
|IconL=Workbench_OpenSCAD.svg |
|IconL=Workbench_OpenSCAD.svg |
||
|IconR=Workbench_PartDesign.svg |
|IconR=Workbench_PartDesign.svg |
Revision as of 18:05, 13 April 2024
Introduction
简介
FreeCAD的实体建模能力都是基于 Open Cascade Technology (OCCT)内核——一种具有创建与处理高级3D几何体等特性的专业级CAD系统。零件工作台(Part Workbench)是一种建立于OCCT库之上的层级,为用户提供了访问OCCT几何图元与函数的功能。每种工作台(如底图工作台, 草图工作台, 零件设计工作台等等)的一切2D与3D绘制功能其实都是基于零件工作台暴露出的函数实现的。因此,可以认为零件工作台是FreeCAD建模功能的核心组件。
A more detailed discussion of Part workbench versus Part Design workbench can be found here: Part and Part Design.
以零件工作台创建的对象相对简单;为了构建更为复杂的几何图形,可以为之运用布尔运算(并集与减运算)。此建模范式就是尽人皆知的构造实体几何 (CSG) 工作流程,它是早期CAD系统中所用的传统方法。另一方面,零件设计工作台(PartDesign Workbench)还提供了更为现代的工作流程来构建几何图形:它利用参数化方式来定义草图,再将其挤压成型为基本的实体对象,最后通过参数化变换(特征编辑)来修改模型,直到用户获取预期的最终模型为止。
零件对象比网格工作台(Mesh Workbench)创建的网格对象更为复杂,因为用户可以对前者执行更为高级的操作,如连续的布尔运算、修改历史与参数化处理。
零件工作台是最基础的层级,它为FreeCAD中的其他工作台暴露出OCCT的各种绘制函数
工具
这些工具皆位于Part菜单。
图元
以下这些工具用于创建图元对象。
- Box: 根据指定的规格绘制一个立方体
- Cylinder: 根据指定的规格绘制一个圆柱体
- Sphere: 根据指定的规格绘制一个球体
- Cone: 根据指定的规格绘制一个圆锥体
- Torus: 根据指定的规格绘制一个环面(torus)(圆环 (ring))
- CreatePrimitives: 一种用于创建各类参数化几何图元的工具
- Shapebuilder: 一种利用各种参数化几何图元创建更加复杂几何图形的工具
- Cylinder: Creates a cylinder.
- Sphere: Creates a sphere.
- Cone: Creates a cone.
- Torus: Creates a torus.
- Tube: Creates a tube.
- Create primitives...: A tool to create one of the following primitives:
- Plane: Creates a plane.
- Box: Creates a box. This object can also be created with the Box tool.
- Cylinder: Creates a cylinder. This object can also be created with the Cylinder tool.
- Cone: Creates a cone. This object can also be created with the Cone tool.
- Sphere: Creates a sphere. This object can also be created with the Sphere tool.
- Ellipsoid: Creates a ellipsoid.
- Torus: Creates a torus. This object can also be created with the Torus tool.
- Prism: Creates a prism.
- Wedge: Creates a wedge.
- Helix: Creates a helix.
- Spiral: Creates a spiral.
- Circle: Creates a circular arc.
- Ellipse: Creates an elliptical arc.
- Point: Creates a point.
- Line: Creates a line.
- Regular polygon: Creates a regular polygon.
- Shape builder...: Creates shapes from various primitives.
修改对象
这些工具用于修改已存在的对象。通过它们即可选取待修改的对象。
- Revolve: Creates a solid by revolving an object (not a solid) around an axis.
- Mirror: Mirrors the selected object across a mirror plane.
- Scale: Scales one or more shapes. introduced in version 0.22
- Fillet: Fillets (rounds) edges of an object.
- Chamfer: Chamfers edges of an object.
- Make face from wires: Makes a face from a set of wires (contours).
- Ruled Surface: Creates a ruled surface.
- Loft: Lofts from one profile to another.
- Sweep: Sweeps one or more profiles along a path.
- Section: Creates a section by intersecting an object with a section plane.
- Cross sections...: Creates one or more cross-sections through an object.
- Thickness: 镂空一个实体,在选中的面上留下开口。
- Projection on surface: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19)
- Attachment: Attaches an object to another object.
Boolean
These tools perform boolean operations.
- Compound Tools:
- Make compound: Creates a compound from the selected objects.
- Explode Compound: Splits up compounds.
- Compound Filter: Extracts the individual pieces from compounds.
- Boolean: 在对象上执行布尔运算
- Cut: Cuts (subtracts) one object from another.
- Fuse: Fuses (unions) two or more objects.
- Common: Extracts the common (intersection) part of two objects.
- Splitting tools:
- Boolean fragments: Creates all pieces obtained from Boolean operations.
- Slice apart: Slices and splits an object by intersecting it with other objects.
- Slice: Slices an object by intersecting it with other objects.
- XOR: Removes space shared by an even number of objects.
Measure
- Measure Linear: Creates a linear measurement.
- Measure Angular: Creates an angular measurement.
- Measure Refresh: Updates all measurements.
- Clear All: Clears all measurements.
- Toggle All: Shows or hides all measurements.
- Toggle 3D: Shows or hides 3D measurements.
- Toggle Delta: Shows or hides delta measurements.
其他工具
- Import: 您可利用此工具为当前文档添加*.IGES、*.STEP、*.BREP文档。
- Export: Exports to *.IGES, *.STEP, or *.BREP files.
- Box selection: Selects faces from a rectangular area.
- Create shape from mesh: Creates a shape object from a mesh object.
- Create points object from geometry: Creates a points object from a geometric object.
- Convert to solid: Converts a shape object to a solid object.
- Reverse shapes: Flips the normals of all faces of selected objects.
- Create a copy:
- Create simple copy: Creates a simple copy of a selected object.
- Create transformed copy: Creates a transformed copy of a selected object.
- Create shape element copy: Creates a copy from an element (vertex, edge, face) of a selected object.
- Refine shape: Cleans faces by removing unnecessary lines.
- Check geometry: Checks the geometry of selected objects for errors.
- Defeaturing: Removes features from an object.
- Appearance: Determines the appearance of a whole object (color, transparency etc.).
- Color per face: Assigns colors to individual faces of objects.
首选项
- Preference ... 导入 导出
脚本
参见: 零件脚本
教程
- 从STL或OBJ文件中导入数据 : 如何在FreeCAD中导入STL/OBJ文件。
- 导出STL或OBJ文件 : 如何从FreeCAD中导出STL/OBJ文件
- Whiffle球教程 : 如何使用零件模块
- Import from STL or OBJ : How to import STL/OBJ files in FreeCAD
- Export to STL or OBJ : How to export STL/OBJ files from FreeCAD
- Whiffle Ball tutorial : How to use the Part Module
- Primitives: Box, Cylinder, Sphere, Cone, Torus, Tube, Create primitives, Shape builder
- Creation and modification: Extrude, Revolve, Mirror, Fillet, Chamfer, Make face from wires, Ruled Surface, Loft, Sweep, Section, Cross sections, 3D Offset, 2D Offset, Thickness, Projection on surface, Attachment
- Boolean: Make compound, Explode Compound, Compound Filter, Boolean, Cut, Fuse, Common, Connect, Embed, Cutout, Boolean fragments, Slice apart, Slice, XOR
- Measure: Measure Linear, Measure Angular, Measure Refresh, Clear All, Toggle All, Toggle 3D, Toggle Delta
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub