Part Sphere

From FreeCAD Documentation
Revision as of 09:44, 1 March 2022 by Roy 043 (talk | contribs) (Description)

Part Sphere

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

Description

The Part Sphere command creates a parametric sphere solid. It is the result of revolving a circular arc profile around an axis. In the coordinate system defined by its DataPlacement property, the center of the sphere is positioned at the origin, and its axis of revolution is the Z axis.

A Part Sphere can be truncated at the top and/or bottom by changing its DataAngle1 and/or DataAngle2 properties. It can be turned into a segment of a sphere by changing its DataAngle3 property.

Usage

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

Example

Part Sphere scripting example

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

Notes

It is difficult to understand the meaning of the three angles.

A full filled sphere is defined by:

  • Angle 1 = -90°
  • Angle 2 = 90°
  • Angle 3 = 360°

If you increase or decrease these values, you will get a parted sphere.

Angle 1 is defined as the angle between the x and z axis. 0° is equal to the x axis. Negative values are equal to the -z direction.

Angle 2 is defined as the angle between the y and z axis. 0° is equal to the y axis. Positive values are equal to the z direction.

Angle 3 is defined as the angle between the x and y axis. 0° is equal to the x axis. The angle rotation is counterclockwise.

Properties

See also: Property editor.

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

Data

Sphere

  • DataRadius (Length): Radius of the sphere
  • DataAngle1 (Angle): 1st angle to cut / define the sphere (angle between XZ axis)
  • DataAngle2 (Angle): 2nd angle to cut / define the sphere (angle between YZ axis)
  • DataAngle3 (Angle): 3rd angle to cut / define the sphere (angle between XY axis)

Because it is quite difficult to explain the meaning of the parameters angle 1, angle 2, angle 3, the picture below gives an explanation about these parameters with following values: angle 1 = -45°, angle 2 = 45° and angle 3= 90°.

Limitations

If the Angle 1 and Angle 2 values are 'critical' (e.g. both have a value of 45°), the sphere cutoffs are overlapping and the result is invisible.

Scripting

A Part Sphere can be created using the following function:

sphere = FreeCAD.ActiveDocument.addObject("Part::Sphere", "mySphere")
  • Where mySphere 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

sphere.Label = "new mySphereName"

You can access and modify attributes of the sphere object.

For example, you may wish to modify the radius or the three angles of the sphere.

sphere.Radius = 20
sphere.Angle1 = -30
sphere.Angle2 = 45
sphere.Angle3 = 90

The result will be a part of a sphere, that looks like a piece of cake.

You can change its placement and orientation with:

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