Part Primitives/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
{{Docnav
|[[Part_Torus|Torus]]
|[[Part_Tube|Tube]]
|[[Part_Plane|Plane]]
|[[Part_Shapebuilder|Shapebuilder]]
|[[Part_Module|Part]]
|[[Part_Workbench|Part]]
|IconL=Part_Torus.svg
|IconL=Part_Tube.svg
|IconR=Part_Plane.svg
|IconC=Workbench_Part.svg
|IconC=Workbench_Part.svg
|IconR=Part_Shapebuilder.svg
}}
}}


{{GuiCommand
{{GuiCommand
|Name=Part CreatePrimitives
|Name=Part Primitives
|MenuLocation=Part → CreatePrimitives...
|MenuLocation=Part → Create primitives...
||Workbenches=[[Part_Module|Part]]
|Workbenches=[[Part_Workbench|Part]], [[OpenSCAD_Workbench|OpenSCAD]]
|SeeAlso=[[Part_Shapebuilder|Part Shapebuilder]]
|SeeAlso=[[Part_Builder|Part Builder]]
}}
}}


==Description==
== Description ==


[[Part_Primitives|Part Primitives]] opens a dialog to create any of the parametric geometric primitives defined in the [[Part_Workbench|Part Workbench]].
The [[Image:Part_Primitives.svg|24px]] '''Part Primitives''' command opens a dialog to create one or more parametric primitives. 16 primitive types are available.


[[File:Part_Primitives_example.png|800px]]
[[File:Part_Primitives_example.png|600px]]
{{Caption|Primitive shapes that can be created with the [[Part_Workbench|Part Workbench]].}}
{{Caption|The primitives that can be created with the command}}


==Geometric Primitives==
== Usage ==


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

:[[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.
# There are several ways to invoke the command:
:[[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.
#* Press the {{Button|[[Image:Part_Primitives.svg|16px]] [[Part_Primitives|Part Primitives]]}} button.
:[[Image:Tree_Part_Cylinder_Parametric.svg|32px]] [[Part_Cylinder|Cylinder]]: Inserts a simple parametric cylinder, with position, angle, radius and height parameters in to he active document.
#* Select the {{MenuCommand|Part → [[Image:Part_Primitives.svg|16px]] Create Primitives...}} option from the menu.
:[[Image:Tree_Part_Cone_Parametric.svg|32px]] [[Part_Cone|Cone]]: Inserts a parametric truncated Cone in to the active document.
# The {{MenuCommand|Geometric Primitives}} task panel opens.
:[[Image:Tree_Part_Sphere_Parametric.svg|32px]] [[Part_Sphere|Sphere]]: Inserts a parametric sphere, with position, angle1, angle2, angle3 and radius parameters.
# Select a primitive type from the dropdown list.
:[[Image:Part_Ellipsoid.svg|32px]] [[Part_Ellipsoid|Ellipsoid]]: Inserts a parametric Ellipsoid solid in to the active document.
# Specify the properties.
:[[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.
# Press the {{Button|Create}} button.
:[[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}}
# The primitive object is created.
:[[Image:Part_Wedge.svg|32px]] [[Part_Wedge|Wedge]]: Inserts a parametric Wedge object in to the active document.
# Note that the task panel stays open.
:[[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]].
# Optionally create additional primitives.
:[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Inserts a Spiral geometric primitive in to the active workbench. {{Version|0.14}}
# Press the {{Button|Close}} button to close the task panel and finish the command.
:[[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.
=== Edit ===
:[[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): creates a simple line segment delimited by two vertices.
# Double-click the primitive object in the [[Tree_view|Tree view]].
:[[Image:Part_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular Polygon]]: Inserts a RegularPolygon geometric primitive in to the active document. {{Version|0.14}}
# The {{MenuCommand|Geometric Primitives}} task panel opens.
# Change one or more properties.
# The object is dynamically updated in the [[3D_view|3D view]].
# Press the {{Button|OK}} button.

The properties of a Part Primitive can also be changed in the [[Property_editor|Property editor]], and its {{PropertyData|Placement}} can also be changed with the [[Image:Std_TransformManip.svg|16px]] [[Std_TransformManip|Std TransformManip]] command.

== Geometric Primitives ==

The following primitives can be created:
*[[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.

== Notes ==

* The Part Primitives command cannot create a [[Image:Part_Tube.svg|16px]] [[Part_Tube|Part Tube]].


== Scripting ==
== Scripting ==


{{Emphasis|See also:}} [[Part_scripting|Part scripting]]
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation], [[Part_scripting|Part scripting]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


Test the creation of the primitives with a script. {{Version|0.19}}
There is a Python script to test the creation of the primitives. It can be run from the [[Python_console|Python console]]:


This can be run from the [[Python_console|Python console]].
{{Code|code=
{{Code|code=
import parttests.part_test_objects as pto
import parttests.part_test_objects as pto
Line 55: Line 85:
}}
}}


This script is located in the installation directory of the program, and can be examined to see how the basic primitives are built.
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=
{{Code|code=
$INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
$INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
}}
}}


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

{{Code|code=
{{Code|code=
freecad $INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
freecad $INSTALL_DIR/Mod/Part/parttests/part_test_objects.py
}}
}}



{{Docnav
{{Docnav
|[[Part_Torus|Torus]]
|[[Part_Tube|Tube]]
|[[Part_Plane|Plane]]
|[[Part_Shapebuilder|Shapebuilder]]
|[[Part_Module|Part]]
|[[Part_Workbench|Part]]
|IconL=Part_Torus.svg
|IconL=Part_Tube.svg
|IconR=Part_Plane.svg
|IconC=Workbench_Part.svg
|IconC=Workbench_Part.svg
|IconR=Part_Shapebuilder.svg
}}
}}


{{Part_Tools_navi{{#translation:}}}}

{{Part Tools navi{{#translation:}}}}

{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 11:47, 21 January 2023

Part Primitives

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

Description

The Part Primitives command opens a dialog to create one or more parametric primitives. 16 primitive types are available.

The primitives that can be created with the command

Usage

Create

  1. There are several ways to invoke the command:
    • Press the Part Primitives button.
    • Select the Part → Create Primitives... option from the menu.
  2. The Geometric Primitives task panel opens.
  3. Select a primitive type from the dropdown list.
  4. Specify the properties.
  5. Press the Create button.
  6. The primitive object is created.
  7. Note that the task panel stays open.
  8. Optionally create additional primitives.
  9. Press the Close button to close the task panel and finish the command.

Edit

  1. Double-click the primitive object in the Tree view.
  2. The Geometric Primitives task panel opens.
  3. Change one or more properties.
  4. The object is dynamically updated in the 3D view.
  5. Press the OK button.

The properties of a Part Primitive can also be changed in the Property editor, and its DataPlacement can also be changed with the Std TransformManip command.

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 arc.
  • Ellipse: Creates an elliptical arc.
  • Point: Creates a point.
  • Line: Creates a line.
  • Regular polygon: Creates a regular polygon.

Notes

  • The Part Primitives command cannot create a Part Tube.

Scripting

See also: Autogenerated API documentation, Part scripting and FreeCAD Scripting Basics.

There is a Python script to test the creation of the primitives. It 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 for the program as well:

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