Part Primitives: Difference between revisions

From FreeCAD Documentation
No edit summary
(Improved == Geometric Primitives ==)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:5-->
<!--T:5-->
{{Docnav
{{Docnav
Line 19: Line 20:
}}
}}


==Description== <!--T:9-->
== Description == <!--T:9-->


<!--T:2-->
<!--T:2-->
Line 30: Line 31:
{{Caption|Primitive shapes that can be created with the [[Part_Workbench|Part Workbench]].}}
{{Caption|Primitive shapes that can be created with the [[Part_Workbench|Part Workbench]].}}


==Usage== <!--T:22-->
== Usage == <!--T:22-->


<!--T:23-->
<!--T:23-->
Line 53: Line 54:
# Edits its properties in the Properties table.
# Edits its properties in the Properties table.


==Geometric Primitives== <!--T:3-->
== Geometric Primitives == <!--T:3-->


<!--T:10-->
<!--T:10-->
Some of the available (parametric) geometric primitives that are possible:
The following primitives can be created:
:[[Image:Part_Plane.svg|32px]] [[Part_Plane|Plane]]: inserts a simple parametric plane 10 x 10 mm, with the parameters of position, length, and width.
*[[Image:Part_Plane.svg|32px]] [[Part_Plane|Plane]]: Creates a plane.
:[[Image:Tree_Part_Box_Parametric.svg|32px]] [[Part_Box|Box/Cube]]: inserts a parametric, [http://en.wikipedia.org/wiki/Cuboid#Rectangular_cuboid rectangular cuboid], geometric primitive into the active document. The same tool as [[Image:Part_Box.svg|32px]] [[Part_Box|Box]].
*[[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]]: Inserts a simple parametric cylinder, with position, angle, radius and height parameters in to the active document. The same tool as [[Image:Part_Cylinder.svg|32px]] [[Part_Cylinder|Cylinder]].
*[[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]]: Inserts a parametric truncated Cone in to the active document. The same tool as [[Image:Part_Cone.svg|32px]] [[Part_Cone|Cone]].
*[[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]]: Inserts a parametric sphere, with position, angle1, angle2, angle3 and radius parameters. The same tool as [[Image:Part_Sphere.svg|32px]] [[Part_Sphere|Sphere]].
*[[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]]: Inserts a parametric Ellipsoid solid in to the active document.
*[[Image:Part_Ellipsoid.svg|32px]] [[Part_Ellipsoid|Ellipsoid]]: Creates a ellipsoid.
:[[Image:Tree_Part_Torus_Parametric.svg|32px]] [[Part_Torus|Torus]]: Inserts a simple parametric torus, with position, angle1, angle2, angle3, radius1 and radius2 as parameters in to the active document. The same tool as [[Image:Part_Torus.svg|32px]] [[Part_Torus|Torus]].
*[[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]]: Inserts a solid defined by a regular polygon cross section and a height in to the active document. {{Version|0.14}}
*[[Image:Part_Prism.svg|32px]] [[Part_Prism|Prism]]: Creates a prism.
:[[Image:Part_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Inserts a parametric Wedge object in to the active document.
*[[Image:Part_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Creates a wedge.
:[[Image:Part_Helix.svg|32px]] [[Part_Helix|Helix]]: Inserts a Helix geometric primitive in to the active document. Common usage for Helix is creating [[Thread_for_Screw_Tutorial|threads]].
*[[Image:Part_Helix.svg|32px]] [[Part_Helix|Helix]]: Creates a helix.
:[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Inserts a Spiral geometric primitive in to the active workbench. {{Version|0.14}}
*[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Creates a spiral.
:[[Image:Part_Circle.svg|32px]] [[Part_Circle|Circle]]: Inserts a circular curved edge in to the active document.
*[[Image:Part_Circle.svg|32px]] [[Part_Circle|Circle]]: Creates a circular edge.
:[[Image:Part_Ellipse.svg|32px]] [[Part_Ellipse|Ellipse]]: Inserts an elliptical curved edge in to the active document.
*[[Image:Part_Ellipse.svg|32px]] [[Part_Ellipse|Ellipse]]: Creates an elliptical edge.
:[[Image:Part_Point.svg|32px]] [[Part_Point|Point]] (Vertex): Inserts a Point (vertex) geometric primitive in to the active document.
*[[Image:Part_Point.svg|32px]] [[Part_Point|Point]]: Creates a point (vertex).
:[[Image:Part_Line.svg|32px]] [[Part_Line|Line]] (Edge): creates a simple line segment delimited by two vertices.
*[[Image:Part_Line.svg|32px]] [[Part_Line|Line]]: Creates a line (edge).
:[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular Polygon]]: Inserts a RegularPolygon geometric primitive in to the active document. {{Version|0.14}}
*[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular Polygon]]: Creates a regular polygon.


== Inheritance == <!--T:18-->
== Inheritance == <!--T:18-->

Revision as of 12:38, 15 February 2021

Part Primitives

Menu location
Part → Create primitives...
Workbenches
Part
Default shortcut
None
Introduced in version
-
See also
Part Shapebuilder

Description

Part Primitives opens a dialog to create any of the parametric geometric primitives defined in the Part Workbench.

Primitive shapes that can be created with the Part Workbench.

Usage

To create a primitive, either

    • press the Create primitives button in the toolbar.
    • select the Part → Create primitives... from the menu bar.
  1. In the appearing dialog select primitive type, set its parameters and location, finally press Create

The dialog keeps open so that you can subsequently create further primitives.

To edit a primitives there are 2 ways:

Using the dialog: introduced in version 0.19

  1. Select the primitive in the tree and double-click on it.
  2. The same dialog will open that was also used to create the primitive. Change there the parameters and you get a live preview of the changed primitive.
  3. To finish the editing press OK.

Using the property editor:

  1. Select the primitive in the tree.
  2. Edits its properties in the Properties table.

Geometric Primitives

The following primitives can be created:

  • 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 edge.
  • Ellipse: Creates an elliptical edge.
  • Point: Creates a point (vertex).
  • Line: Creates a line (edge).
  • Regular Polygon: Creates a regular polygon.

Inheritance

All part primitives are objects which derive from the Part::Primitive class. This class in turn derives from the basic Part Feature object (Part::Feature class).

Simplified diagram of the relationships between the core objects in the program. The Part::Primitive class is derived from the Part::Feature object. It includes an extension that allows it to be attached to faces and planes.

Scripting

See also: Part scripting

Test the creation of the primitives with a script. introduced in version 0.19

This can be run from the Python console.

import parttests.part_test_objects as pto
pto.create_test_file("example_file")

This script is located in the installation directory of the program, and can be examined to see how the basic primitives are built.

$INSTALL_DIR/Mod/Part/parttests/part_test_objects.py

It can be used as input to the program as well.

freecad $INSTALL_DIR/Mod/Part/parttests/part_test_objects.py