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


@interface SCNTube : SCNGeometry


Figure 1

A tube and its properties

The outer surface of a tube is a cylinder. Define the size of the cylinder’s cross section in the x- and z-axis dimensions of its local coordinate space with the outerRadius property, and its extent in the y-axis dimension with the height property. A cylinder becomes a tube through the subtraction of a cylindrical volume along its central axis. Define the size of this circular hole using the tube’s innerRadius property. To position and orient a tube in a scene, attach it to the geometry property of an SCNNode object.

Control the level of detail with the radialSegmentCount and heightSegmentCount properties. A higher radial segment count creates a smoother curve for the tube’s circular inner and outer surfaces. A higher segment count in either direction produces more vertices, which can improve rendering quality for certain lighting models or custom shader effects, but at a cost to rendering performance.

A tube contains four SCNGeometryElement objects: one each for its base and top, one that wraps around its outer surface, and one that wraps around its inner surface. SceneKit can render each element using a different material. For details, see the materials property in SCNGeometry.


Creating a Tube

+ tubeWithInnerRadius:outerRadius:height:

Creates a tube geometry with the specified inner radius, outer radius, and height.

Adjusting a Tube’s Dimensions


The radius of the tube’s outer circular cross section. Animatable.


The radius of the circular hole through the tube. Animatable.


The extent of the tube along its y-axis. Animatable.

Adjusting Geometric Detail


The number of subdivisions around the circumference of the tube. Animatable.


The number of subdivisions in the inner and outer surfaces of the tube along its y-axis. Animatable.


Inherits From

See Also

Basic Shapes


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


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


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


A right circular cone or frustum geometry.


A right circular cylinder geometry.


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


A right rectangular pyramid geometry.


A sphere (or ball or globe) geometry.


A torus, or ring-shaped geometry.