Difference between revisions of "Part Primitives"

From FreeCAD Documentation
Jump to navigation Jump to search
(Switch position of Line and Point)
 
(13 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
{{Docnav
 
{{Docnav
 
|[[Part_Torus|Torus]]
 
|[[Part_Torus|Torus]]
|[[Part_Shapebuilder|Shapebuilder]]
+
|[[Part_Builder|Shapebuilder]]
 
|[[Part_Module|Part]]
 
|[[Part_Module|Part]]
 
|IconL=Part_Torus.svg
 
|IconL=Part_Torus.svg
Line 13: Line 13:
 
<!--T:1-->
 
<!--T:1-->
 
{{GuiCommand
 
{{GuiCommand
|Name=Part CreatePrimitives
+
|Name=Part Primitives
|MenuLocation=Part → CreatePrimitives...
+
|MenuLocation=Part → Create primitives...
 
||Workbenches=[[Part_Module|Part]]
 
||Workbenches=[[Part_Module|Part]]
|SeeAlso=[[Part_Shapebuilder|Part Shapebuilder]]
+
|SeeAlso=[[Part_Builder|Part Shapebuilder]]
 
}}
 
}}
  
Line 22: Line 22:
  
 
<!--T:2-->
 
<!--T:2-->
A tool to create various parametric geometric primitives.  
+
[[Part_Primitives|Part Primitives]] opens a dialog to create any of the parametric geometric primitives defined in the [[Image:Workbench_Part.svg|24px|link=Part_Workbench]] [[Part_Workbench|Part Workbench]].
 +
 
 +
</translate>
 +
[[File:Part_Primitives_example.png|800px]]
 +
<translate>
 +
<!--T:11-->
 +
{{Caption|Primitive shapes that can be created with the [[Part_Workbench|Part Workbench]].}}
  
 
==Geometric Primitives== <!--T:3-->
 
==Geometric Primitives== <!--T:3-->
Line 35: Line 41:
 
:[[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]]: Inserts a parametric Ellipsoid solid in to the active document.
 
:[[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.
 
:[[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.
:[[Image:Part_Prism.svg|32px]] [[Part_Prism|Prism]] {{Version|0.14}}*: Inserts a solid defined by a regular polygon cross section and a height in to the active document.
+
:[[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_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Inserts a parametric Wedge object in to the active document.
 
:[[Image:Part_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Inserts a parametric Wedge object in to the active document.
 
:[[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]]: Inserts a Helix geometric primitive in to the active document. Common usage for Helix is creating [[Thread_for_Screw_Tutorial|threads]].
:[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]] {{Version|0.14}}*: Inserts a Spiral geometric primitive in to the active workbench.
+
:[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Inserts a Spiral geometric primitive in to the active workbench. {{Version|0.14}}
 
:[[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]]: Inserts a circular curved edge in to the active document.
 
:[[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]]: Inserts an elliptical curved edge in to the active document.
 
:[[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]] (Vertex): Inserts a Point (vertex) geometric primitive in to the active document.
:[[Image:Part_Line.svg|32px]] [[Part_Line|Line]] (Edge):
+
:[[Image:Part_Line.svg|32px]] [[Part_Line|Line]] (Edge): creates a simple line segment delimited by two vertices.
:[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular Polygon]] {{Version|0.14}}*: Inserts a RegularPolygon geometric primitive in to the active document.
+
:[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular Polygon]]: Inserts a RegularPolygon geometric primitive in to the active document. {{Version|0.14}}
 +
 
 +
== Inheritance == <!--T:18-->
 +
 
 +
<!--T:19-->
 +
All part primitives are objects which derive from the {{incode|Part::Primitive}} class. This class in turn derives from the basic [[Part_Feature|Part Feature]] object ({{incode|Part::Feature}} class).
 +
 
 +
<!--T:20-->
 +
[[File:FreeCAD_core_objects.svg|800px]]
 +
 
 +
<!--T:21-->
 +
{{Caption|Simplified diagram of the relationships between the core objects in the program. The {{incode|Part::Primitive}} class is derived from the {{incode|Part::Feature}} object. It includes an extension that allows it to be attached to faces and planes.}}
  
<!--T:4-->
+
== Scripting == <!--T:12-->
[[File:Part_CreatePrimitives_example_FreeCAD_0_13.jpg]]
+
 
{{clear}}
+
<!--T:13-->
 +
{{Emphasis|See also:}} [[Part_scripting|Part scripting]]
 +
 
 +
<!--T:14-->
 +
Test the creation of the primitives with a script. {{Version|0.19}}
 +
 
 +
<!--T:15-->
 +
This can be run from the [[Python_console|Python console]].
 +
</translate>
 +
{{Code|code=
 +
import parttests.part_test_objects as pto
 +
pto.create_test_file("example_file")
 +
}}
 +
<translate>
 +
 
 +
<!--T:16-->
 +
This script is located in the installation directory of the program, and can be examined to see how the basic primitives are built.
 +
</translate>
 +
{{Code|code=
 +
$INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
 +
}}
 +
<translate>
 +
 
 +
<!--T:17-->
 +
It can be used as input to the program as well.
 +
</translate>
 +
{{Code|code=
 +
freecad $INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
 +
}}
 +
<translate>
  
 
<!--T:6-->
 
<!--T:6-->
 
{{Docnav
 
{{Docnav
 
|[[Part_Torus|Torus]]
 
|[[Part_Torus|Torus]]
|[[Part_Shapebuilder|Shapebuilder]]
+
|[[Part_Builder|Shapebuilder]]
 
|[[Part_Module|Part]]
 
|[[Part_Module|Part]]
 
|IconL=Part_Torus.svg
 
|IconL=Part_Torus.svg
Line 60: Line 106:
  
 
</translate>
 
</translate>
 
 
{{Part Tools navi{{#translation:}}}}
 
{{Part Tools navi{{#translation:}}}}
 
 
{{Userdocnavi{{#translation:}}}}
 
{{Userdocnavi{{#translation:}}}}

Latest revision as of 20:47, 26 March 2020

Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎italiano • ‎polski • ‎română • ‎svenska • ‎čeština • ‎русский • ‎中文(中国大陆)‎
Arrow-left.svg Previous: Part Torus.svg Torus

Part Primitives.svg 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 Workbench Part.svg Part Workbench.

Part Primitives example.png

Primitive shapes that can be created with the Part Workbench.


Geometric Primitives

Some of the available (parametric) geometric primitives that are possible:

Part Plane.svg Plane: inserts a simple parametric plane 10 x 10 mm, with the parameters of position, length, and width.
Tree Part Box Parametric.svg Box/Cube: inserts a parametric, rectangular cuboid, geometric primitive into the active document.
Tree Part Cylinder Parametric.svg Cylinder: Inserts a simple parametric cylinder, with position, angle, radius and height parameters in to he active document.
Tree Part Cone Parametric.svg Cone: Inserts a parametric truncated Cone in to the active document.
Tree Part Sphere Parametric.svg Sphere: Inserts a parametric sphere, with position, angle1, angle2, angle3 and radius parameters.
Part Ellipsoid.svg Ellipsoid: Inserts a parametric Ellipsoid solid in to the active document.
Tree Part Torus Parametric.svg Torus: Inserts a simple parametric torus, with position, angle1, angle2, angle3, radius1 and radius2 as parameters in to the active document.
Part Prism.svg Prism: Inserts a solid defined by a regular polygon cross section and a height in to the active document. introduced in version 0.14
Part Wedge.svg Wedge: Inserts a parametric Wedge object in to the active document.
Part Helix.svg Helix: Inserts a Helix geometric primitive in to the active document. Common usage for Helix is creating threads.
Part Spiral.svg Spiral: Inserts a Spiral geometric primitive in to the active workbench. introduced in version 0.14
Part Circle.svg Circle: Inserts a circular curved edge in to the active document.
Part Ellipse.svg Ellipse: Inserts an elliptical curved edge in to the active document.
Part Point.svg Point (Vertex): Inserts a Point (vertex) geometric primitive in to the active document.
Part Line.svg Line (Edge): creates a simple line segment delimited by two vertices.
Part RegularPolygon.svg Regular Polygon: Inserts a RegularPolygon geometric primitive in to the active document. introduced in version 0.14

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

FreeCAD core objects.svg

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
Arrow-left.svg Previous: Part Torus.svg Torus