Part Spiral: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{UnfinishedDocu{{#translation:}}}}
<translate>
<translate>


Line 17: Line 16:
|Name=Part Spiral
|Name=Part Spiral
|MenuLocation=Part → [[Part_Primitives|Create primitives]] → Spiral
|MenuLocation=Part → [[Part_Primitives|Create primitives]] → Spiral
|Workbenches=[[Part_Workbench|Part]]
|Workbenches=[[Part_Workbench|Part]], [[OpenSCAD_Workbench|OpenSCAD]]
|Version=0.14
|Version=0.14
|SeeAlso=[[Part_Primitives|Part Primitives]]
|SeeAlso=[[Part_Primitives|Part Primitives]]
Line 25: Line 24:


<!--T:13-->
<!--T:13-->
A [[Image:Part_Spiral.svg|24px]] '''Part Spiral''' is a parametric shape that can be created with the [[Image:Part_Primitives.svg|24px]] [[Part_Primitives|Part Primitives]] command. In the coordinate system defined by its {{PropertyData|Placement}} property, the spiral lies on the XY plane with its center at the origin and its start point on the X axis. It widens as it turns counterclockwise.
The [[Image:Part_Spiral.svg|24px]] [[Part_Spiral|Part Spiral]] command creates a parametric spiral shape.


</translate>
FreeCAD creates a spiral, with default values for growth and radius. The number of rotations can be set too.
[[Image:Part_Spiral_Example.png|400px]]

<translate>
By default, the spiral is positioned with its start point on the x-axis with a distance of the radius from the origin (0,0,0). Its rotation is counterclockwise.

[[File:Part Spiral Example.png|Screenshot of Part Spiral]]


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


<!--T:6-->
<!--T:14-->
See [[Part_Primitives#Usage|Part Primitives]].
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Part_Primitives.svg|16px]] [[Part Primitives|Create Primitives...]]}} button.
#* Select the {{MenuCommand|Part → Create Primitives → [[Image:Part_Primitives.svg|16px]] Create Primitives...}} option from the menu.
#* Select the {{MenuCommand|[[Image:Part_Spiral.svg|16px]] Spiral}} option from the menu.
# Set options and press {{Button|Create}}.
# To close the dialog press {{Button|Close}}.


== Example ==
== Example == <!--T:15-->


<!--T:16-->
[[File:Part Spiral Scripting Example.png|thumb|Part Spiral scripting example]]
[[Image:Part_Spiral_Scripting_Example.png|thumb|Part Spiral from the scripting example]]


<!--T:17-->
A Part spiral object with the values of the bottom scripting example are shown here.
A Part Spiral object created with the [[#Scripting|scripting example]] below is shown here.


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


<!--T:19-->
See also: [[Property_editor|Property editor]].
See also: [[Property_editor|Property editor]].


<!--T:20-->
A Part Spiral object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties. It also has the following additional properties:
A Part Spiral object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties. It also has the following additional properties:


=== Data ===
=== Data === <!--T:21-->


<!--T:22-->
{{TitleProperty|Attachment}}

<!--T:23-->
The object has the same attachment properties as a [[Part_Part2DObject#Data|Part Part2DObject]].

<!--T:24-->
{{TitleProperty|Spiral}}
{{TitleProperty|Spiral}}


<!--T:25-->
*{{PropertyData|Growth|Length}}: The growth of the spiral. This is the distance between the curves of the spiral.
*{{PropertyData|Radius|Length}}: The radius of the spiral. This is the distance between the origin and the start point of the curve.
* {{PropertyData|Growth|Length}}: The distance between two consecutive turns of the spiral. The default is {{Value|1mm}}.
*{{PropertyData|Rotations|Float}}: The number of full 360° rotations of the spiral. The rotation direction is counterclockwise.
* {{PropertyData|Radius|Length}}: The start radius of the spiral, the distance between its center and its start point. Can be {{Value|0mm}}. The default is {{Value|1mm}}.
*{{PropertyData|Segment Length|Float}}: The segment length of the spiral.
* {{PropertyData|Rotations|QuantityConstraint}}: The number of rotations, or turns, of the spiral. The default is {{Value|2}}.
* {{PropertyData|Segment Length|QuantityConstraint}}: The number of turns per spiral subdivision. The default is {{Value|1}}, meaning each full turn of the spiral is a separate segment. Use {{Value|0}} to suppress subdivision.


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


<!--T:27-->
A Part Spiral is created with the {{Incode|addObject()}} method of the document.
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation], [[Part_scripting|Part scripting]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

<!--T:28-->
A Part Spiral can be created with the {{Incode|addObject()}} method of the document:


</translate>
</translate>
Line 74: Line 82:
<translate>
<translate>


<!--T:29-->
* Where {{Incode|mySpiral}} is the name for the object. The name must be unique for the entire document.
* Where {{Incode|"mySpiral"}} is the name for the object.
* The function returns the newly created object.
* The function returns the newly created object.


<!--T:30-->
The {{Incode|Label}} is the user editable name for the object. It can be easily changed by
Example:


</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCAD as App
spiral.Label = "new mySpiralName"
}}
<translate>


doc = App.activeDocument()
You can access and modify attributes of the {{Incode|spiral}} object. For example, you may wish to modify the growth, radius and rotations parameters.


spiral = doc.addObject("Part::Spiral", "mySpiral")
</translate>
{{Code|code=
spiral.Growth = 2
spiral.Growth = 2
spiral.Radius = 3
spiral.Radius = 3
spiral.Rotations = 4
spiral.Rotations = 4
spiral.Placement = App.Placement(App.Vector(1, 2, 3), App.Rotation(75, 60, 30))

doc.recompute()
}}
}}
<translate>
<translate>


You can change its placement and orientation with:

</translate>
{{Code|code=
spiral.Placement = FreeCAD.Placement(FreeCAD.Vector(1, 2, 3), FreeCAD.Rotation(75, 60, 30))
}}
<translate>


<!--T:9-->
<!--T:9-->
Line 114: Line 117:


</translate>
</translate>
{{Part Tools navi{{#translation:}}}}
{{Part_Tools_navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 10:19, 3 March 2022

Part Spiral

Menu location
Part → Create primitives → Spiral
Workbenches
Part, OpenSCAD
Default shortcut
None
Introduced in version
0.14
See also
Part Primitives

Description

A Part Spiral is a parametric shape that can be created with the Part Primitives command. In the coordinate system defined by its DataPlacement property, the spiral lies on the XY plane with its center at the origin and its start point on the X axis. It widens as it turns counterclockwise.

Usage

See Part Primitives.

Example

Part Spiral from the scripting example

A Part Spiral object created with the scripting example below is shown here.

Properties

See also: Property editor.

A Part Spiral object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:

Data

Attachment

The object has the same attachment properties as a Part Part2DObject.

Spiral

  • DataGrowth (Length): The distance between two consecutive turns of the spiral. The default is 1mm.
  • DataRadius (Length): The start radius of the spiral, the distance between its center and its start point. Can be 0mm. The default is 1mm.
  • DataRotations (QuantityConstraint): The number of rotations, or turns, of the spiral. The default is 2.
  • DataSegment Length (QuantityConstraint): The number of turns per spiral subdivision. The default is 1, meaning each full turn of the spiral is a separate segment. Use 0 to suppress subdivision.

Scripting

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

A Part Spiral can be created with the addObject() method of the document:

spiral = FreeCAD.ActiveDocument.addObject("Part::Spiral", "mySpiral")
  • Where "mySpiral" is the name for the object.
  • The function returns the newly created object.

Example:

import FreeCAD as App

doc = App.activeDocument()

spiral = doc.addObject("Part::Spiral", "mySpiral")
spiral.Growth = 2
spiral.Radius = 3
spiral.Rotations = 4
spiral.Placement = App.Placement(App.Vector(1, 2, 3), App.Rotation(75, 60, 30))

doc.recompute()