Class

SCNTorus

A torus, or ring-shaped geometry.

Declaration

@interface SCNTorus : SCNGeometry

Overview

Figure 1

A torus and its properties

A torus is mathematically defined as a surface of revolution formed by revolving a circle around a coplanar axis. It is the product of two circles: a large ring and a pipe that encircles the ring. SceneKit uses these terms to define the dimensions of a torus geometry in its local coordinate space. The torus’ ringRadius property defines a circle in the x- and z-axis dimensions, centered at the origin, and its pipeRadius property defines the width of the surface encircling the ring. To change the orientation of a torus, adjust the transform property of the node containing the torus geometry.

Control the level of detail with the ringSegmentCount and pipeSegmentCount properties. Higher segment counts produce more vertices and a more smoothly curved surface, which can improve rendering quality at a cost to rendering performance.

Topics

Creating a Torus

+ torusWithRingRadius:pipeRadius:

Creates a torus geometry with the specified ring radius and pipe radius.

Adjusting a Torus’ Dimensions

ringRadius

The major radius of the torus, defining a circle in the x- and z-axis dimensions. Animatable.

pipeRadius

The minor radius of the torus, defining the pipe that encircles the torus ring. Animatable.

Configuring Torus Properties

ringSegmentCount

The number of subdivisions around the torus ring. Animatable.

pipeSegmentCount

The number of subdivisions around the torus pipe. Animatable.

Relationships

Inherits From

See Also

Basic Shapes

SCNFloor

A plane that can optionally display a reflection of the scene above it.

SCNBox

A six-sided polyhedron geometry whose faces are all rectangles, optionally with rounded edges and corners.

SCNCapsule

A right circular cylinder geometry whose ends are capped with hemispheres.

SCNCone

A right circular cone or frustum geometry.

SCNCylinder

A right circular cylinder geometry.

SCNPlane

A rectangular, one-sided plane geometry of specified width and height.

SCNPyramid

A right rectangular pyramid geometry.

SCNSphere

A sphere (or ball or globe) geometry.

SCNTube

A tube or pipe geometry—a right circular cylinder with a circular hole along its central axis.