<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Spatial",
  "identifier" : "/documentation/Spatial/Size3D",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Spatial"
    ],
    "preciseIdentifier" : "c:@UA@SPSize3D"
  },
  "title" : "Size3D"
}
-->

# Size3D

A size that describes width, height, and depth in a 3D coordinate system.

```
struct Size3D
```

## Topics

### Creating a 3D size structure

[`init()`](/documentation/Spatial/Size3D/init())

Creates a size structure.

[`init(width: Double, height: Double, depth: Double)`](/documentation/Spatial/Size3D/init(width:height:depth:)-4j9bk)

Creates a size structure from the specified double-precision values.

[`init<T>(width: T, height: T, depth: T)`](/documentation/Spatial/Size3D/init(width:height:depth:)-4kscw)

Creates a size structure from the specified floating-point values.

[`init(simd_float3)`](/documentation/Spatial/Size3D/init(_:)-2ibhr)

Creates a size structure from the specified single-precision vector.

[`init(simd_double3)`](/documentation/Spatial/Size3D/init(_:)-3y7nr)

Creates a size structure from the specified double-precision vector.

[`init(vector: simd_double3)`](/documentation/Spatial/Size3D/init(vector:))

Creates a size structure from the specified double-precision vector.

[`init(Point3D)`](/documentation/Spatial/Size3D/init(_:)-7kyp0)

Creates a size structure from the specified Spatial point.

[`init(Vector3D)`](/documentation/Spatial/Size3D/init(_:)-6nss1)

Creates a size structure from the specified Spatial vector.

[`static SPSize3D SPSize3DMakeWithPoint(SPPoint3D point);`](/documentation/Spatial/SPSize3DMakeWithPoint)

Creates a size structure from the specified Spatial point.

[`static SPSize3D SPSize3DMakeWithVector(SPVector3D xyz);`](/documentation/Spatial/SPSize3DMakeWithVector-5cgfq)

Creates a size structure from the specified double-precision vector.

[`static SPSize3D SPSize3DMakeWithVector(simd_double3 xyz);`](/documentation/Spatial/SPSize3DMakeWithVector-6ar1t)

### Inspecting a 3D size’s properties

[`var width: Double`](/documentation/Spatial/Size3D/width)

The width value.

[`var height: Double`](/documentation/Spatial/Size3D/height)

The height value.

[`var depth: Double`](/documentation/Spatial/Size3D/depth)

The depth value.

[`double width;`](/documentation/Spatial/SPSize3D/width)

The width value.

[`double height;`](/documentation/Spatial/SPSize3D/height)

The height value.

[`double depth;`](/documentation/Spatial/SPSize3D/depth)

The depth value.

[`var size: Size3D`](/documentation/Spatial/Size3D/size)

The size value.

[`var vector: simd_double3`](/documentation/Spatial/Size3D/vector)

[`static simd_double3 SPSize3DGetVector(SPSize3D size);`](/documentation/Spatial/SPSize3DGetVector)

A simd three-element vector that contains the width, height, and depth values.

### Transforming a 3D size structure

[`func applying(Pose3D) -> Size3D`](/documentation/Spatial/Size3D/applying(_:)-85mlm)

Returns a size that results from applying the specified pose.

[`func applying(ScaledPose3D) -> Size3D`](/documentation/Spatial/Size3D/applying(_:)-7e2pf)

Returns a size that’s transformed by the specified scaled pose.

[`func applying(Pose3D) -> Size3D`](/documentation/Spatial/Size3D/applying(_:)-85mlm)

Returns a size that results from applying the specified pose.

[`func unapplying(AffineTransform3D) -> Size3D`](/documentation/Spatial/Size3D/unapplying(_:)-7qam3)

Returns a size that results from unapplying the specified affine transform.

[`func unapplying(ProjectiveTransform3D) -> Size3D`](/documentation/Spatial/Size3D/unapplying(_:)-yock)

Returns a size that results from unapplying the specified projective transform.

[`func unapplying(Pose3D) -> Size3D`](/documentation/Spatial/Size3D/unapplying(_:)-3ip2e)

Returns a size that results from unapplying the specified pose.

[`static SPSize3D SPSize3DScaleBySize(SPSize3D size, SPSize3D scale);`](/documentation/Spatial/SPSize3DScaleBySize)

Returns a size that results from scaling with the specified size structure.

[`static SPSize3D SPSize3DScaleUniform(SPSize3D size, double scale);`](/documentation/Spatial/SPSize3DScaleUniform)

Returns a size that results from uniformly scaling with the specified double-precision value.

[`static SPSize3D SPSize3DRotate(SPSize3D size, SPRotation3D rotation);`](/documentation/Spatial/SPSize3DRotate)

Returns a size that results from applying the specified rotation.

[`static SPSize3D SPSize3DRotateByQuaternion(SPSize3D size, simd_quatd quaternion);`](/documentation/Spatial/SPSize3DRotateByQuaternion)

Returns a size that results from rotating with the specified quaternion.

[`func sheared(AxisWithFactors) -> Size3D`](/documentation/Spatial/Size3D/sheared(_:))

Returns a size that results from shearing over an axis by shear factors for the other two axes.

[`func applying(ScaledPose3D) -> Size3D`](/documentation/Spatial/Size3D/applying(_:)-7e2pf)

Returns a size that’s transformed by the specified scaled pose.

[`func unapplying(ScaledPose3D) -> Size3D`](/documentation/Spatial/Size3D/unapplying(_:)-42rsa)

Returns a size that’s transformed by the inverse of the specified scaled pose.

[`static SPSize3D SPSize3DApplyPose(SPSize3D size, SPPose3D pose);`](/documentation/Spatial/SPSize3DApplyPose)

Returns a size that results from applying the specified pose.

[`static SPSize3D SPSize3DUnapplyPose(SPSize3D size, SPPose3D pose);`](/documentation/Spatial/SPSize3DUnapplyPose)

Returns a size that results from unapplying the specified pose.

[`static SPSize3D SPSize3DApplyAffineTransform(SPSize3D size, SPAffineTransform3D transform);`](/documentation/Spatial/SPSize3DApplyAffineTransform)

Returns a size that results from applying the specified affine transform.

[`static SPSize3D SPSize3DApplyProjectiveTransform(SPSize3D size, SPProjectiveTransform3D transform);`](/documentation/Spatial/SPSize3DApplyProjectiveTransform)

Returns a size that results from applying the specified projective transform.

[`static SPSize3D SPSize3DUnapplyAffineTransform(SPSize3D size, SPAffineTransform3D transform);`](/documentation/Spatial/SPSize3DUnapplyAffineTransform)

Returns a size that results from unapplying the specified affine transform.

[`static SPSize3D SPSize3DUnapplyProjectiveTransform(SPSize3D size, SPProjectiveTransform3D transform);`](/documentation/Spatial/SPSize3DUnapplyProjectiveTransform)

Returns a size that results from unapplying the specified projective transform.

[`static SPSize3D SPSize3DScaleBy(SPSize3D size, double x, double y, double z);`](/documentation/Spatial/SPSize3DScaleBy)

Returns a size that results from scaling with the specified double-precision values.

[`static SPSize3D SPSize3DShear(SPSize3D size, SPAxis shearAxis, double shearFactor0, double shearFactor1);`](/documentation/Spatial/SPSize3DShear)

Returns a size that results from shearing over an axis by shear factors for the other two axes.

[`static SPSize3D SPSize3DApplyScaledPose(SPSize3D size, SPScaledPose3D pose);`](/documentation/Spatial/SPSize3DApplyScaledPose)

Returns a size that’s transformed by the specified scaled pose.

[`static SPSize3D SPSize3DUnapplyScaledPose(SPSize3D size, SPScaledPose3D pose);`](/documentation/Spatial/SPSize3DUnapplyScaledPose)

Returns a size that’s transformed by the inverse of the specified scaled pose.

### Checking characteristics

[`func contains(anyOf: [Point3D]) -> Bool`](/documentation/Spatial/Size3D/contains(anyOf:))

Returns a Boolean value that indicates whether the size contains the specified point.

[`static bool SPSize3DContainsAnyPoint(SPSize3D size, const SPPoint3D *points, int pointCount);`](/documentation/Spatial/SPSize3DContainsAnyPoint)

Returns a Boolean value that indicates whether the size contains the specified point.

[`static bool SPSize3DContainsPoint(SPSize3D size, SPPoint3D other);`](/documentation/Spatial/SPSize3DContainsPoint)

Returns a Boolean value that indicates whether the size contains the specified point.

[`static bool SPSize3DContainsSize(SPSize3D size, SPSize3D other);`](/documentation/Spatial/SPSize3DContainsSize)

Returns a Boolean value that indicates whether the size contains the specified size.

[`static bool SPSize3DIsValid(SPSize3D size);`](/documentation/Spatial/SPSize3DIsValid)

A Boolean value that indicates whether the size represents a valid value.

[`static bool SPSize3DIsFinite(SPSize3D size);`](/documentation/Spatial/SPSize3DIsFinite)

[`static bool SPSize3DIsNaN(SPSize3D size);`](/documentation/Spatial/SPSize3DIsNaN)

[`static bool SPSize3DIsZero(SPSize3D size);`](/documentation/Spatial/SPSize3DIsZero)

### Creating derived 3D sizes

[`func intersection(Size3D) -> Size3D?`](/documentation/Spatial/Size3D/intersection(_:))

Returns the intersection of two sizes.

[`static SPSize3D SPSize3DIntersection(SPSize3D size, SPSize3D other);`](/documentation/Spatial/SPSize3DIntersection)

Returns the intersection of two sizes.

[`static SPSize3D SPSize3DUnion(SPSize3D size, SPSize3D other);`](/documentation/Spatial/SPSize3DUnion)

Returns the smallest size that contains two sizes.

### Comparing values

[`static func == (Size3D, Size3D) -> Bool`](/documentation/Spatial/Size3D/==(_:_:))

Returns a Boolean value that indicates whether two values are equal.

[`static bool SPSize3DEqualToSize(SPSize3D size1, SPSize3D size2);`](/documentation/Spatial/SPSize3DEqualToSize)

Returns a Boolean value that indicates whether two values are equal.

### 3D size constants

[`static let one: Size3D`](/documentation/Spatial/Size3D/one)

The size structure with width, height, and depth values of one.

[`static const SPSize3D SPSize3DZero;`](/documentation/Spatial/SPSize3DZero)

The size structure with the zero value.

[`static const SPSize3D SPSize3DInfinity;`](/documentation/Spatial/SPSize3DInfinity)

The size structure with infinite width, height, and depth values.

### Applying arithmetic operations

[`static func * (Size3D, Double) -> Size3D`](/documentation/Spatial/Size3D/*(_:_:)-751dt)

Returns a size that’s the product of a size and a scalar value.

[`static func * (Double, Size3D) -> Size3D`](/documentation/Spatial/Size3D/*(_:_:)-8zb5j)

Returns a size that’s the product of a scalar value and a size.

[`static func * (AffineTransform3D, Size3D) -> Size3D`](/documentation/Spatial/Size3D/*(_:_:)-4qpgt)

Returns the size that results from applying the affine transform to the size.

[`static func * (ProjectiveTransform3D, Size3D) -> Size3D`](/documentation/Spatial/Size3D/*(_:_:)-52miz)

Returns the size that results from applying the projective transform to the size.

[`static func * (Pose3D, Size3D) -> Size3D`](/documentation/Spatial/Size3D/*(_:_:)-5bb1n)

Returns a new size after applying the pose to the size.

[`static func + (Size3D, Size3D) -> Size3D`](/documentation/Spatial/Size3D/+(_:_:))

Returns a size that’s the element-wise sum of two sizes.

[`static func - (Size3D) -> Size3D`](/documentation/Spatial/Size3D/-(_:))

Returns a size that’s the element-wise negation of the size.

[`static func - (Size3D, Size3D) -> Size3D`](/documentation/Spatial/Size3D/-(_:_:))

Returns a size that’s the element-wise difference of two points.

[`static func *= (inout Size3D, Double)`](/documentation/Spatial/Size3D/*=(_:_:))

Multiplies a size and a double-precision value, and stores the result in the left-hand-side variable.

[`static func += (inout Size3D, Size3D)`](/documentation/Spatial/Size3D/+=(_:_:)-75tn3)

Adds two size structures and stores the result in the left-hand-side variable.

[`static func += (inout Size3D, Vector3D)`](/documentation/Spatial/Size3D/+=(_:_:)-7yrej)

Adds a size and a vector, and stores the result in the left-hand-side variable.

[`static func -= (inout Size3D, Size3D)`](/documentation/Spatial/Size3D/-=(_:_:)-8t5kg)

Subtracts a size from a size and stores the difference in the left-hand-side variable.

[`static func -= (inout Size3D, Vector3D)`](/documentation/Spatial/Size3D/-=(_:_:)-3te52)

Subtracts a size from a vector and stores the difference in the left-hand-side variable.

[`static func / (Size3D, Double) -> Size3D`](/documentation/Spatial/Size3D/_(_:_:))

Returns a size with each element divided by a scalar value.

[`static func /= (inout Size3D, Double)`](/documentation/Spatial/Size3D/_=(_:_:))

Divides a size by a scalar vaue and stores the result in the left-hand-side variable.

### Deprecated symbols

[`var simd: simd_double3`](/documentation/Spatial/Size3D/simd)

[`func containsAny(of: [Point3D]) -> Bool`](/documentation/Spatial/Size3D/containsAny(of:))

Returns a Boolean value that indicates whether the size contains the specified point.

[`static const SPSize3D SPSize3DInvalid;`](/documentation/Spatial/SPSize3DInvalid)

The null size that represents an invalid value.

### Initializers

[`init(simd_packed_double4)`](/documentation/Spatial/Size3D/init(_:)-25dft)

Creates a Spatial size from a simd packed vector.

[`init(Size3DFloat)`](/documentation/Spatial/Size3D/init(_:)-2jfoh)

Returns a double-precision size from a single-precision size.

### Default Implementations

[AdditiveArithmetic Implementations](/documentation/Spatial/Size3D/AdditiveArithmetic-Implementations)

[CustomReflectable Implementations](/documentation/Spatial/Size3D/CustomReflectable-Implementations)

[Decodable Implementations](/documentation/Spatial/Size3D/Decodable-Implementations)

[Encodable Implementations](/documentation/Spatial/Size3D/Encodable-Implementations)

[Equatable Implementations](/documentation/Spatial/Size3D/Equatable-Implementations)

[Hashable Implementations](/documentation/Spatial/Size3D/Hashable-Implementations)

[Primitive3DProtocol Implementations](/documentation/Spatial/Size3D/Primitive3DProtocol-Implementations)

[Scalable3DProtocol Implementations](/documentation/Spatial/Size3D/Scalable3DProtocol-Implementations)

[Shearable3D Implementations](/documentation/Spatial/Size3D/Shearable3D-Implementations)

[Volumetric Implementations](/documentation/Spatial/Size3D/Volumetric-Implementations)

[VolumetricProtocol Implementations](/documentation/Spatial/Size3D/VolumetricProtocol-Implementations)

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Volumetric`](/documentation/Spatial/Volumetric)

[`Rotatable3D`](/documentation/Spatial/Rotatable3D)

[`Copyable`](/documentation/Swift/Copyable)

[`Shearable3D`](/documentation/Spatial/Shearable3D)

[`Scalable3D`](/documentation/Spatial/Scalable3D)

[`SpatialTypeProtocol`](/documentation/Spatial/SpatialTypeProtocol)

[`CustomReflectable`](/documentation/Swift/CustomReflectable)

[`Primitive3D`](/documentation/Spatial/Primitive3D)

[`Escapable`](/documentation/Swift/Escapable)

[`AdditiveArithmetic`](/documentation/Swift/AdditiveArithmetic)

[`Encodable`](/documentation/Swift/Encodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Decodable`](/documentation/Swift/Decodable)

[`Sendable`](/documentation/Swift/Sendable)

[`Animatable`](/documentation/SwiftUI/Animatable)

[`Hashable`](/documentation/Swift/Hashable)

[`Primitive3DProtocol`](/documentation/Spatial/Primitive3DProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Scalable3DProtocol`](/documentation/Spatial/Scalable3DProtocol)

[`VectorArithmetic`](/documentation/SwiftUI/VectorArithmetic)

[`Rotatable3DProtocol`](/documentation/Spatial/Rotatable3DProtocol)

[`VolumetricProtocol`](/documentation/Spatial/VolumetricProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)