4.1.5      Torus

The  button from Primitives section in Geometry tab and Geometry->Primitives->Create Torus... command from main menu invoke Create Torus dialogue for creating a Torus primitive object.

The Create Torus dialogue with default parameters and preview of the torus solid will appear.


Name and medium

We can set the name of the torus and choose the medium assigned to the torus from Medium list. The Medium list contains all media available in the Project Media and the default medium is taken from current active medium (see Project Media chapter for more information).


Parameters

The Parameters section contains torus dimensions: radius of the circle around which the disc circulates (Radius1), radius of the disc defining the form of the torus (Radius2), angles to cut/define the disc of the torus (V Parameters) and an angle to define the circumference of the torus (U Parameter) for creating a portion of the torus.


Position

The Position section contains X, Y and Z centre position relative to the origin 0, 0, 0 and the axis of direction: X, Y, Z (default) or User defined described by (x, y, z) vector.

     


The torus at origin position and along X axis.


The torus at origin position and along Y axis.


The torus at origin position and along Z axis.


The torus shifted from origin position and along Z axis.


The torus shifted from origin position and along axis described by (1, 0, 1) vector.


Map to face

From Pick option allows adjusting the centre position, axis of direction and minimum or maximum size to the selected area.


Press left mouse button for face selection.


Press From Pick button to place the torus in the middle of the selected face.


Select Use minimum dimension from the list and press From Pick button to place the torus in the middle of the selected face and adjust the radius (Radius1) to the minimal dimension of the face.


Select Use maximum dimension from the list and press From Pick button to place the torus in the middle of the selected face and adjust the radius (Radius1) to the maximal dimension of the face.


Python code

The python code, which can be useful when creating project scripts, generated by Create Torus dialogue for default parameters:


from FreeCAD import Base

import Part,PartGui

App.ActiveDocument.addObject("Part::Torus","Torus")

App.ActiveDocument.Torus.Radius1 = 10.00000

App.ActiveDocument.Torus.Radius2 = 2.00000

App.ActiveDocument.Torus.Angle1 = -180.00000

App.ActiveDocument.Torus.Angle2 = 180.00000

App.ActiveDocument.Torus.Angle3 = 360.00000

App.ActiveDocument.Torus.Placement = Base.Placement(Base.Vector(0.00000,0.00000,0.00000),Base.Rotation(0.00000,0.00000,0.00000,1.00000))

App.ActiveDocument.Torus.Label = "Torus"

App.ActiveDocument.Torus.Medium = QW_Modeller.getQWMedium("metal")

Gui.SendMsgToActiveView("ViewFit")

App.ActiveDocument.recompute()