手册:参数化对象

From FreeCAD Documentation
Revision as of 12:16, 23 December 2018 by Johnquicker (talk | contribs) (Created page with "所有中间操作(2D 形状,凸台,凹坑等)仍然存在,您仍然可以随时更改其任何参数。需要的时候,整个链条将被重建(重新计算)。")
Other languages:

FreeCAD 专为参数化建模而设计。这意味着所创建的几何体不是可以自由雕刻的那种,而是由规则和参数而生成的。例如,可以凭半径和高度生成圆柱体。有了这两个参数,程序便具有了足够的信息来构建这个圆柱体。

FreeCAD 中的参数对象实际上是一小段程序,只要其中一个参数发生变化就会运行。对象可以有很多不同类型的参数:数字(整数,如1,2,3;或浮点值,如3.1416),真实世界的尺寸(1毫米,2.4米,4.5英尺),(x,y,z)坐标,文本字符串(“hello!”),等等。甚至,参数可以是另一个对象。

最后一种类型允许快速构建复杂的操作链,每个新对象以前一个为基础,向其添加新特征。

In the example below, a solid, cubic object (Pad) is based on a rectangular 2D shape (Sketch) and has an extrusion distance. With these two properties, it produces a solid shape by extruding the base shape by the given distance. You can then use this object as a base for further operations, such as drawing a new 2D shape on one of its faces (Sketch001) and then making a subtraction (Pocket), until arriving at your final object.

所有中间操作(2D 形状,凸台,凹坑等)仍然存在,您仍然可以随时更改其任何参数。需要的时候,整个链条将被重建(重新计算)。

Two important things are necessary to know:

  1. Recomputation is not always automatic. Heavy operations, that might modify a big portion of your document, and therefore take some time, are not performed automatically. Instead, the object (and all the objects that depend on it) will be marked for recomputation (a small blue icon appears on them in the tree view). You must then press the recompute button (or Edit->Refresh) to have all the marked objects recomputed.
  2. The dependency tree must always flow in the same direction. Loops are forbidden. (See DAG) You can have object A which depends on object B which depend on object C. But you cannot have object A which depends on object B which depends on object A. That would be a circular dependency. However, you can have many objects that depend on the same object, for example objects B and C both depend on A. Menu Tools -> Dependency graph shows you a dependency diagram like on the image above. It can be useful to detect problems.

Not all objects are parametric in FreeCAD. Often, the geometry that you import from other files won't contain any parameter, and will be simple, non-parametric objects. However, these can often be used as a base, or starting point for newly created parametric objects, depending, of course, on what the parametric object requires and the quality of the imported geometry.

All objects, however, parametric or not, will have a couple of basic parameters, such as a Name, which is unique in the document and cannot be edited, a Label, which is a user-defined name that can be edited, and a placement, which holds its position in the 3D space.

Finally, it is worth noting that custom parametric objects are easy to program in python.

Read more