Part Cylinder: Difference between revisions

From FreeCAD Documentation
mNo edit summary
(Description)
Line 23: Line 23:


<!--T:9-->
<!--T:9-->
The [[Image:Part_Cylinder.svg|24px]] [[Part_Cylinder|Part Cylinder]] command creates a parametric cylinder solid.
The [[Image:Part_Cylinder.svg|24px]] [[Part_Cylinder|Part Cylinder]] command creates a parametric cylinder solid. It is the result of extruding a circular arc along a straight path. In the coordinate system defined by its {{PropertyData|Placement}} property, the bottom face of the cylinder lies on the XY plane with its center at the origin.


A Part Cylinder can be turned into a segment of a cylinder by changing its {{PropertyData|Angle}} property.
FreeCAD creates a cylinder, with a radius of 2 millimetres and a height of 10 millimetre.

By default, the cylinder is positioned with the center of the bottom circle at the origin (0,0,0). The bottom of the cylinder is on the xy-plane. Its extension in z-direction follows the positive axis value.


</translate>
</translate>
[[File:Part Cylinder Example.png]]
[[Image:Part_Cylinder_Example.png|400px]]
<translate>
<translate>



Revision as of 09:21, 1 March 2022

Part Cylinder

Menu location
Part → Primitives → Cylinder
Workbenches
Part
Default shortcut
None
Introduced in version
-
See also
Part Primitives

Description

The Part Cylinder command creates a parametric cylinder solid. It is the result of extruding a circular arc along a straight path. In the coordinate system defined by its DataPlacement property, the bottom face of the cylinder lies on the XY plane with its center at the origin.

A Part Cylinder can be turned into a segment of a cylinder by changing its DataAngle property.

Usage

  1. There are several ways to invoke the command:
    • Press the Cylinder button.
    • Select the Part → Primitives → Cylinder option from the menu.

Example

Part Cylinder scripting example.

A Part Cylinder object with the values of the bottom scripting example are shown here.

The described placement and orientation changes are not shown because of simplicity for the given example.

Properties

See also: Property editor.

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

Data

Cylinder

  • DataRadius (Radius): The radius of the cylinder. This defines a plane in the XY area.
  • DataHeight (Height): The height of the cylinder. This is the dimension in the Z direction.
  • DataAngle (Angle): The rotation angle of the cylinder. The rotation angle permits the creation of a portion of cylinder (it is set to 360° by default).

Prism

Scripting

A Part Cylinder can be created using the following function:

cylinder = FreeCAD.ActiveDocument.addObject("Part::Cylinder", "myCylinder")
  • Where myCylinder is the user editable name for the object.
  • The function returns the newly created object.

The label text of the object can be easily changed by

cylinder.Label = "new myCylinderName"

For example, you may wish to modify the width, length or of the start and finish vertex.

cylinder.Radius = 10
cylinder.Height = 25
cylinder.Angle = 270
cylinder.FirstAngle = 30
cylinder.SecondAngle = 45

The result is a three-quarter cylinder.

You can change its placement and orientation with:

cylinder.Placement = FreeCAD.Placement(FreeCAD.Vector(1, 2, 3), FreeCAD.Rotation(75, 60, 30))