Part Module/zh-cn: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
(47 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{docnav
{{Docnav
|[[OpenSCAD Module|OpenSCAD Module]]
|[[PartDesign Workbench|PartDesign Workbench]]
|[[OpenSCAD_Workbench|OpenSCAD Workbench]]
|[[PartDesign_Workbench|PartDesign Workbench]]
|IconL=OpenSCADWorkbench.svg
|IconL=Workbench_OpenSCAD.svg
|IconR=Workbench_PartDesign.svg
|IconR=Workbench_PartDesign.svg
}}
}}


[[Image:Workbench_Part.svg|64px]]
[[Image:Workbench_Part.svg|thumb|128px|Part workbench icon]]


{{TOCright}}

== Introduction ==

<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>


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">
以零件工作台创建的对象相对简单;为了构建更为复杂的几何图形,可以为之运用布尔运算(并集与减运算)。此建模范式就是尽人皆知的[[constructive solid geometry|构造实体几何]] (CSG) 工作流程,它是早期CAD系统中所用的传统方法。另一方面,[[PartDesign Workbench|零件设计工作台(PartDesign Workbench)]]还提供了更为现代的工作流程来构建几何图形:它利用参数化方式来定义草图,再将其挤压成型为基本的实体对象,最后通过参数化变换([[feature editing|特征编辑]])来修改模型,直到用户获取预期的最终模型为止。
以零件工作台创建的对象相对简单;为了构建更为复杂的几何图形,可以为之运用布尔运算(并集与减运算)。此建模范式就是尽人皆知的[[constructive solid geometry|构造实体几何]] (CSG) 工作流程,它是早期CAD系统中所用的传统方法。另一方面,[[PartDesign Workbench|零件设计工作台(PartDesign Workbench)]]还提供了更为现代的工作流程来构建几何图形:它利用参数化方式来定义草图,再将其挤压成型为基本的实体对象,最后通过参数化变换([[feature editing|特征编辑]])来修改模型,直到用户获取预期的最终模型为止。
</div>


<div class="mw-translate-fuzzy">
零件对象比[[Mesh Workbench|网格工作台(Mesh Workbench)]]创建的网格对象更为复杂,因为用户可以对前者执行更为高级的操作,如连续的布尔运算、修改历史与参数化处理。
零件对象比[[Mesh Workbench|网格工作台(Mesh Workbench)]]创建的网格对象更为复杂,因为用户可以对前者执行更为高级的操作,如连续的布尔运算、修改历史与参数化处理。
</div>

{{TOCright}}
[[Image:Part example.jpg]]


[[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>


以下这些工具用于创建图元对象。
以下这些工具用于创建图元对象。


<div class="mw-translate-fuzzy">
* [[Image:Part_Box.png|32px]] [[Part_Box|Box]]: 根据指定的规格绘制一个立方体
* [[Image:Part_Box.png|32px]] [[Part_Box|Box]]: 根据指定的规格绘制一个立方体
* [[Image:Part_Cylinder.png|32px]] [[Part_Cylinder|Cylinder]]: 根据指定的规格绘制一个圆柱体
* [[Image:Part_Cylinder.png|32px]] [[Part_Cylinder|Cylinder]]: 根据指定的规格绘制一个圆柱体
Line 38: Line 57:
* [[Image:Part_CreatePrimitives.png|32px]] [[Part_CreatePrimitives|CreatePrimitives]]: 一种用于创建各类参数化几何图元的工具
* [[Image:Part_CreatePrimitives.png|32px]] [[Part_CreatePrimitives|CreatePrimitives]]: 一种用于创建各类参数化几何图元的工具
* [[Image:Part_Shapebuilder.png|32px]] [[Part_Shapebuilder|Shapebuilder]]: 一种利用各种参数化几何图元创建更加复杂几何图形的工具
* [[Image:Part_Shapebuilder.png|32px]] [[Part_Shapebuilder|Shapebuilder]]: 一种利用各种参数化几何图元创建更加复杂几何图形的工具
</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">
* [[Image:Part_Extrude.png|32px]] [[Part_Extrude|Extrude]]: 将对象的平面端面挤压成型
* [[Image:Part_Extrude.png|32px]] [[Part_Extrude|Extrude]]: 将对象的平面端面挤压成型
* [[Image:Part_Revolve.png|32px]] [[Part_Revolve|Revolve]]: 通过令一(非实体)对象绕某轴旋转来创建另一个实体对象
* [[Image:Part_Revolve.png|32px]] [[Part_Revolve|Revolve]]: 通过令一(非实体)对象绕某轴旋转来创建另一个实体对象
Line 51: Line 107:
* [[Image:Part_Loft.png|32px]] [[Part_Loft|Loft]]: 对轮廓进行放样操作(放样成另一种轮廓)
* [[Image:Part_Loft.png|32px]] [[Part_Loft|Loft]]: 对轮廓进行放样操作(放样成另一种轮廓)
* [[Image:Part_Sweep.png|32px]] [[Part_Sweep|Sweep]]: 沿路径对一个或多个轮廓进行扫描
* [[Image:Part_Sweep.png|32px]] [[Part_Sweep|Sweep]]: 沿路径对一个或多个轮廓进行扫描

<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>
</div>


* [[Image:Part_Revolve.svg|32px]] [[Part_Revolve|Revolve]]: Creates a solid by revolving an object (not a solid) around an axis.
* [[Image:Part_Thickness.png|32px]] [[Part_Thickness|Thickness]]: 镂空一个实体,在选中的面上留下开口。


* [[Image:Part_Mirror.svg|32px]] [[Part_Mirror|Mirror]]: Mirrors the selected object across a mirror plane.
<div class="mw-translate-fuzzy">
* [[Image:Part_ProjectionOnSurface.png|32px]] [[Part_ProjectionOnSurface|Projection on surface]]: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19)
</div>


* [[Image:Part_Scale.svg|32px]] [[Part_Scale|Scale]]: Scales one or more shapes. {{Version|0.22}}
* [[Image:Part_CompCompoundTools.png|48px]] [[Part_CompCompoundTools|Compound Tools]]:
** [[Image:Part MakeCompound.png|32px]] [[Part MakeCompound|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 Compound‏‎Filter.png|32px]] [[Part Compound‏‎Filter|Compound Filter]]: The CompoundFilter can be used to extract the individual pieces.


* [[Image:Part_Booleans.png|32px]] [[Part_Booleans|Booleans]]: 在对象上执行布尔运算
* [[Image:Part_Fillet.svg|32px]] [[Part_Fillet|Fillet]]: Fillets (rounds) edges of an object.
* [[Image:Part_Union.png|32px]] [[Part_Union|Union]]: 将两个对象融为一体 (并集)
* [[Image:Part_Common.png|32px]] [[Part_Common|Common]]: 提取出两个对象中的共有部分(交集)
* [[Image:Part_Cut.png|32px]] [[Part_Cut|Cut]]: 从一个对象中去掉另一个对象(差集)


* [[Image:Part_Chamfer.svg|32px]] [[Part_Chamfer|Chamfer]]: Chamfers edges of an object.
* [[Image:Part_CompJoinFeatures.png|48px]] [[Part CompJoinFeatures|Join features]]: smart booleans for walled objects (e.g., pipes) {{Version|0.16}}
** [[Image:Part JoinConnect.png|32px]] [[Part_JoinConnect|Connect]]: Connects interiors of objects {{Version|0.16}}
** [[Image:Part JoinEmbed.png|32px]] [[Part_JoinEmbed|Embed]]: Embeds a walled object into another walled object {{Version|0.16}}
** [[Image:Part JoinCutout.png|32px]] [[Part_JoinCutout|Cutout]]: Creates a cutout in a wall of an object for another walled object {{Version|0.16}}


* [[File:Part_MakeFace.svg|32px]] [[Part_MakeFace|Make face from wires]]: Makes a face from a set of wires (contours).
* [[Image:Part_CompSplittingTools.png|48px]] [[Part CompSplittingTools|Splitting tools]]: {{Version|0.17}}
** [[Image:Part BooleanFragments.png|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.png|32px]] [[Part_Slice|Slice]]: Splits an object into pieces by intersections with another object {{Version|0.17}}
** [[Image:Part XOR.png|32px]] [[Part_XOR|XOR]]: removes space shared by even number of objects (symmetric version of [[Part_Cut|Cut]]) {{Version|0.17}}


* [[Image:Part Defeaturing.svg|32px]] [[Part_Defeaturing|Defeaturing]]: {{Version|0.18}}
* [[Image:Part_RuledSurface.svg|32px]] [[Part_RuledSurface|Ruled Surface]]: Creates a ruled surface.
* [[Image:Part_Section.png|32px]] [[Part_Section|Section]]: Creates a section by intersecting an object with a section plane
* [[Image:Part_SectionCross.png|32px]] [[Part_SectionCross|Cross sections...]]:
* [[Image:Part Attachment.svg|32px]] [[Part Attachment|Attachment]]: attachment is a utility to attach an object to another one.


* [[Image:Part_Loft.svg|32px]] [[Part_Loft|Loft]]: Lofts from one profile to another.
=== Measure ===


* [[Image:Part_Sweep.svg|32px]] [[Part_Sweep|Sweep]]: Sweeps one or more profiles along a path.
[[File:Std Measure Menu.png|64px]] [[Std Measure Menu|Measure]]: Allows linear and angular measurement between points, edges, and faces.


* [[Image:Part_Measure_Linear.svg|32px]] [[Part_Measure_Linear|Measure Linear]] allows you to make linear measurements.
* [[Image:Part_Section.svg|32px]] [[Part_Section|Section]]: Creates a section by intersecting an object with a section plane.
* [[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.


* [[Image:Part_CrossSections.svg|32px]] [[Part_CrossSections|Cross sections...]]: Creates one or more cross-sections through an object.
===其他工具===


<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:Part ExportCAD.png|32px]] [[Part ExportCAD|Export CAD]]: 您可利用此工具将一个零件对象导出至一个*.IGES、*.STEP、*.BREP文件
** [[Image:Part_Offset.png|32px]] [[Part_Offset|3D Offset]]: 根据原始几何形状在特定的距离处构建一个平行的副本
* [[Image:Part ShapeFromMesh.png|32px]] [[Part ShapeFromMesh|Shape from Mesh]]: 根据一个网格对象创建一个几何形状对象
** [[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>


<div class="mw-translate-fuzzy">
* Create a copy:
* [[Image:Part_Thickness.png|32px]] [[Part_Thickness|Thickness]]: 镂空一个实体,在选中的面上留下开口。
** [[Image:Part_SimpleCopy‎.svg|32px]] [[Part_SimpleCopy|Create simple copy]]: Creates a simple copy of the selected object.
</div>
** [[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.


<div class="mw-translate-fuzzy">
* [[Image:Part_CheckGeometry.svg|32px]] [[Part CheckGeometry|Check geometry]]: Checks the geometry of selected objects for errors.
* [[Image:Part_ProjectionOnSurface.png|32px]] [[Part_ProjectionOnSurface|Projection on surface]]: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19)
</div>


* [[Image:Part_EditAttachment.svg|32px]] [[Part_EditAttachment|Attachment]]: Attaches an object to another object.
== 首选项 ==


=== Boolean ===
* [[Image:Preferences-import-export.svg|32px]] [[Import_Export_Preference|Preference ...]] 导入 导出


These tools perform boolean operations.
== OCCT中的几何概念 ==


* [[Image:Part_CompCompoundTools.png|48px]] [[Part_CompCompoundTools|Compound Tools]]:
在OpenCascade术语中,我们会在几何图元(geometric primitive)与拓扑形状(topological shape)之间进行区分。一个几何图元可以是点、线、圆、平面等等,甚至还可以为类似于B-样条曲线或表面(surface)这样更为复杂的图元类型。而拓扑形状则可以是顶点、边、连线、面(face)、实体或其他形状所复合而成的对象。几何图元不能直接显示于3D场景中,却常用于构建拓扑形状的几何图形。例如,一条边可由线或部分圆来构建而成。
** [[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 Compound‏‎Filter.svg|32px]] [[Part_Compound‏‎Filter|Compound Filter]]: Extracts the individual pieces from compounds.


* [[Image:Part_Boolean.svg|32px]] [[Part_Boolean|Boolean]]: 在对象上执行布尔运算
总而言之,几何图元都是“无形状”的基本构成单位,而拓扑形状则是基于前者所构建的实体对象。


* [[Image:Part_Cut.svg|32px]] [[Part_Cut|Cut]]: Cuts (subtracts) one object from another.
至于全部图元与形状的完整列表可参考 [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文档并不存在于网络上(您必须下载一份存档文件),而且它主要为程序员而设,并非终端用户。但是,仍希望您能以此为起点来查找更为深入的信息。


* [[Image:Part_Fuse.svg|32px]] [[Part_Fuse|Fuse]]: Fuses (unions) two or more objects.
几何类型实际可分为两大关键组群:曲线(curve)与表面(surface)。您可利用曲线(线、圆……)来直接构建一个边,而采用表面(平面,圆柱体……)来构建一个面(face)。例如,几何图元中的线是无限长的,即它由一个基向量与一个方向向量定义而成,而线的拓扑形状表示却一定要以起点与终点来定义为有限长度。另外,一个立方体——一个实体——可用6个有限的平面来创建。


* [[Image:Part_Common.svg|32px]] [[Part_Common|Common]]: Extracts the common (intersection) part of two objects.
当然,您也可以将一条边或一个面还原为其对应的几何图元。


* [[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]]:
[[File:Part_TopoShape_relationships.svg|600px]]
** [[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 ===
{{Caption|The "Part::TopoShape" is the geometrical object that is seen on screen. Essentially all workbenches use these TopoShapes internally to build and display edges, faces, and solids.}}


* [[Image:Part_Measure_Linear.svg|32px]] [[Part_Measure_Linear|Measure Linear]]: Creates a linear measurement.
== 脚本 ==


* [[Image:Part_Measure_Angular.svg|32px]] [[Part_Measure_Angular|Measure Angular]]: Creates an angular measurement.
{{Emphasis|参见:}} [[Part scripting|零件脚本]]


* [[Image:Part_Measure_Refresh.svg|32px]] [[Part_Measure_Refresh|Measure Refresh]]: Updates all measurements.
零件模块中主要使用的数据结构为OpenCascade中的 [http://en.wikipedia.org/wiki/Boundary_representation BRep]数据类型。几乎零件模块中的所有内容与对象类型都可在[[Python|Python]]脚本中使用。这其中包括几何图元,如线段与圆形(或弧), 以及整个TopoShapes范畴,如顶点、边、连线、面、实体与组合对象。对于其中的每一种对象而言,都存在若干创建方法,而对于TopoShapes中的特定对象而言,还支持一些如布尔并集/差集/交集等高级操作。以[[FreeCAD Scripting Basics|FreeCAD脚本基础]]页面所述的方式来浏览零件模块中的内容,即可获悉更多详情。


* [[Image:Part_Measure_Clear_All.svg|32px]] [[Part_Measure_Clear_All|Clear All]]: Clears 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_All.svg|32px]] [[Part_Measure_Toggle_All|Toggle All]]: Shows or hides all 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_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.
为了创建一条线条元素,可以切换至Python控制台并录入:


<span id="Other_tools"></span>
{{Code|code=
<div class="mw-translate-fuzzy">
import Part,PartGui
===其他工具===
doc=App.newDocument()
</div>
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()
}}


<div class="mw-translate-fuzzy">
让我们来逐步分析上述python示例:
* [[Image:Part Import.svg|32px]] [[Part Import/zh-cn|Import]]: 您可利用此工具为当前文档添加*.IGES、*.STEP、*.BREP文档。
</div>


* [[File:Part_Export.svg|32px]] [[Part_Export|Export]]: Exports to *.IGES, *.STEP, or *.BREP files.
{{Code|code=
import Part,PartGui
doc=App.newDocument()
}}


* [[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.
{{Code|code=
l=Part.LineSegment()
l.StartPoint=(0.0,0.0,0.0)
l.EndPoint=(1.0,1.0,1.0)
}}


* [[File:Part_PointsFromMesh.svg|32px]] [[Part_PointsFromMesh|Create points object from geometry]]: Creates a points object from a geometric object.
线条其实就是线段,因为它具有起点和终点。


* [[File:Part_MakeSolid.svg|32px]] [[Part_MakeSolid|Convert to solid]]: Converts a shape object to a solid object.
{{Code|code=
doc.addObject("Part::Feature","Line").Shape=l.toShape()
}}


* [[File:Part_ReverseShape.svg|32px]] [[Part_ReverseShape|Reverse shapes]]: Flips the normals of all faces of selected objects.
这行代码为文档添加了一个零件对象类型,并为此对象的'Shape'属性设置为以线段进行形状表示。在此,关键是要理解我们通过几何图元(Part.LineSegment)创建了一个TopoShape(利用toShape()方法)。只有几何图形才能添加至文档中。在FreeCAD中,几何图元常用作几何图形的“基本组成结构”。


* Create a copy:
{{Code|code=
** [[File:Part_SimpleCopy‎.svg|32px]] [[Part_SimpleCopy|Create simple copy]]: Creates a simple copy of a selected object.
doc.recompute()
** [[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.
此句更新了文档。这为新零件对象的可视化表示做好了准备工作。


* [[Image:Part Defeaturing.svg|32px]] [[Part_Defeaturing|Defeaturing]]: Removes features from an object.
请注意,我们可以直接通过在构造函数中指定起点与终点来创建一条线段,例如 Part.LineSegment(point1,point2),或者正如我们此前的做法,在创建一条默认线段后再调整其属性。


=== Context menu items ===
以相似的方式来创建一个圆形:


* [[File:Std_SetAppearance.svg|32px]] [[Std_SetAppearance|Appearance]]: Determines the appearance of a whole object (color, transparency etc.).
{{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()
}}


* [[File:Part_ColorPerFace.svg|32px]] [[Part_ColorPerFace|Color per face]]: Assigns colors to individual faces of objects.
请再次注意,这段代码利用圆形(几何图元)构建了一个几何形状。之后,我们依然能通过下列方式访问造型几何体:


<span id="Preferences"></span>
{{Code|code=
== 首选项 ==
s = f.Shape
e = s.Edges[0]
c = e.Curve
}}


<div class="mw-translate-fuzzy">
在此,我们获取对象f的几何形状,再获得构成它的一系列边。在当前情况下只能获得一条边,因为我们用单个圆形构造了整个几何形状,因此只取边列表中的第一项,继而获得构成该形状的曲线。每条边都有一个曲线,几何图元就是基于它而成。
* [[Image:Preferences-import-export.svg|32px]] [[Import_Export_Preferences|Preference ...]] 导入 导出
</div>


<span id="Scripting"></span>
如果您想了解更多请前往[[Topological data scripting|拓扑数据脚本]]页面。
== 脚本 ==


<div class="mw-translate-fuzzy">
{{Emphasis|参见:}} [[Part scripting|零件脚本]]
</div>

<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 Module|OpenSCAD Module]]
|[[OpenSCAD_Workbench|OpenSCAD Workbench]]
|[[PartDesign Workbench|PartDesign Workbench]]
|[[PartDesign_Workbench|PartDesign Workbench]]
|IconL=OpenSCADWorkbench.svg
|IconL=Workbench_OpenSCAD.svg
|IconR=Workbench_PartDesign.svg
|IconR=Workbench_PartDesign.svg
}}
}}


{{Part Tools navi{{#translation:}}}}
{{Userdocnavi}}
{{Userdocnavi{{#translation:}}}}
[[Category:Part]]
[[Category:Workbenches]]
[[Category:Workbenches{{#translation:}}]]

Revision as of 18:05, 13 April 2024


Part workbench icon

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: 一种利用各种参数化几何图元创建更加复杂几何图形的工具
  • Cone: Creates a cone.
  • 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.

修改对象

这些工具用于修改已存在的对象。通过它们即可选取待修改的对象。

  • Extrude: 将对象的平面端面挤压成型
  • Revolve: 通过令一(非实体)对象绕某轴旋转来创建另一个实体对象
  • Mirror: 根据指定的镜面对选中的对象进行镜像操作
  • Fillet: 为对象的边倒(圆)角
  • Chamfer: 为对象的边倒角
  • Ruled Surface:
  • Loft: 对轮廓进行放样操作(放样成另一种轮廓)
  • Sweep: 沿路径对一个或多个轮廓进行扫描
  • Revolve: Creates a solid by revolving an object (not a solid) around an axis.
  • Mirror: Mirrors the selected object across a mirror plane.
  • Fillet: Fillets (rounds) edges of an object.
  • Chamfer: Chamfers edges of an object.
  • 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.
  • Offset tools:
    • 3D Offset: 根据原始几何形状在特定的距离处构建一个平行的副本。
    • 2D Offset: 根据原始连线在特定的距离处创建一个平行的副本,或者缩放一个平面端面。(v0.17)
  • Thickness: 镂空一个实体,在选中的面上留下开口。
  • Projection on surface: 向表面上投影logo、文本或任意表面、连线、边。可以为投影部分创建一个示例或连线。(v0.19)
  • Attachment: Attaches an object to another object.

Boolean

These tools perform boolean operations.

  • Boolean: 在对象上执行布尔运算
  • Cut: Cuts (subtracts) one object from another.
  • Fuse: Fuses (unions) two or more objects.
  • Common: Extracts the common (intersection) part of two objects.
  • Join features:
    • Connect: Connects interiors of walled objects.
    • Embed: Embeds a walled object into another walled object.
    • Cutout: Creates a cutout in a wall of an object for another walled object.
  • 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

其他工具

  • Import: 您可利用此工具为当前文档添加*.IGES、*.STEP、*.BREP文档。
  • Export: Exports to *.IGES, *.STEP, or *.BREP files.

Context menu items

  • Appearance: Determines the appearance of a whole object (color, transparency etc.).

首选项

脚本

参见: 零件脚本

教程