Part Primitives: Difference between revisions

From FreeCAD Documentation
(fixed error in the menu)
 
(11 intermediate revisions by one other user not shown)
Line 16: Line 16:
|Name=Part Primitives
|Name=Part Primitives
|MenuLocation=Part → Create primitives...
|MenuLocation=Part → Create primitives...
||Workbenches=[[Part_Workbench|Part]]
|Workbenches=[[Part_Workbench|Part]], [[OpenSCAD_Workbench|OpenSCAD]]
|SeeAlso=[[Part_Builder|Part Shapebuilder]]
|SeeAlso=[[Part_Builder|Part Builder]]
}}
}}


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


=== Create ===
=== Create === <!--T:27-->


<!--T:23-->
<!--T:23-->
# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Part_Primitives.svg|16px]] [[Part_Primitives|Part Primitives]]}} button.
#* Press the {{Button|[[Image:Part_Primitives.svg|16px]] [[Part_Primitives|Part Primitives]]}} button.
#* Select the {{MenuCommand|Part → Create Primitives → [[Image:Part_Primitives.svg|16px]] Create Primitives...}} option from the menu.
#* Select the {{MenuCommand|Part → [[Image:Part_Primitives.svg|16px]] Create Primitives...}} option from the menu.
# The {{MenuCommand|Geometic Primitives}} task panel opens.
# The {{MenuCommand|Geometric Primitives}} task panel opens.
# Select a primitive type from the dropdown list.
# Select a primitive type from the dropdown list.
# Specify the properties.
# Specify the properties.
# Press the {{Button|Create}} button.
# Press the {{Button|Create}} button.
# The primitive object is created.
# The primitive object is created.
# Note that the task panel stays open.
# Optionally create additional primitives.
# Optionally create additional primitives.
# Press the {{Button|Close}} button to finish the command.
# Press the {{Button|Close}} button to close the task panel and finish the command.


=== Edit ===
=== Edit === <!--T:28-->


<!--T:25-->
<!--T:25-->
# Double-click the primitive object in the [[Tree_view|Tree view]].
# Double-click the primitive object in the [[Tree_view|Tree view]].
# The {{MenuCommand|Geometic Primitives}} task panel opens.
# The {{MenuCommand|Geometric Primitives}} task panel opens.
# Change one or more properties.
# Change one or more properties.
# The object is dynamically updated in the [[3D_view|3D view]].
# The object is dynamically updated in the [[3D_view|3D view]].
# Press the {{Button|OK}} button.
# Press the {{Button|OK}} button.


<!--T:29-->
Of course 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.
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 == <!--T:3-->
== Geometric Primitives == <!--T:3-->
Line 73: Line 75:
*[[Image:Part_Helix.svg|32px]] [[Part_Helix|Helix]]: Creates a helix.
*[[Image:Part_Helix.svg|32px]] [[Part_Helix|Helix]]: Creates a helix.
*[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Creates a spiral.
*[[Image:Part_Spiral.svg|32px]] [[Part_Spiral|Spiral]]: Creates a spiral.
*[[Image:Part_Circle.svg|32px]] [[Part_Circle|Circle]]: Creates a circular edge.
*[[Image:Part_Circle.svg|32px]] [[Part_Circle|Circle]]: Creates a circular arc.
*[[Image:Part_Ellipse.svg|32px]] [[Part_Ellipse|Ellipse]]: Creates an elliptical edge.
*[[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_Point.svg|32px]] [[Part_Point|Point]]: Creates a point.
*[[Image:Part_Line.svg|32px]] [[Part_Line|Line]]: Creates a line.
*[[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_RegularPolygon.svg|32px]] [[Part_RegularPolygon|Regular polygon]]: Creates a regular polygon.


== Notes ==
== Notes == <!--T:30-->


<!--T:31-->
* The Part Primitives command cannot create a [[Image:Part_Tube.svg|16px]] [[Part_Tube|Part Tube]].
* The Part Primitives command cannot create a [[Image:Part_Tube.svg|16px]] [[Part_Tube|Part Tube]].


== Scripting == <!--T:12-->
== Scripting == <!--T:12-->


<!--T:32-->
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation], [[Part_scripting|Part scripting]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation], [[Part_scripting|Part scripting]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:14-->
<!--T:14-->
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]]:

<!--T:15-->
This can be run from the [[Python_console|Python console]].


</translate>
</translate>
Line 101: Line 102:


<!--T:16-->
<!--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.
This script is located in the installation directory of the program, and can be examined to see how the basic primitives are built:


</translate>
</translate>
Line 110: Line 111:


<!--T:17-->
<!--T:17-->
It can be used as input to the program as well.
It can be used as input for the program as well:


</translate>
</translate>

Latest revision as of 11:18, 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