From 9643e621aab5c1982d79f8dbba3b3962f01e0075 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Wed, 31 Jan 2024 21:43:37 +0000 Subject: [PATCH] Remove deprecated methods --- Sources/Bounds.swift | 20 -------------------- Sources/Euclid+CoreGraphics.swift | 5 ----- Sources/Euclid+SceneKit.swift | 13 ------------- Sources/LineSegment.swift | 6 ------ Sources/Mesh+CSG.swift | 23 ----------------------- Sources/Mesh.swift | 6 ------ Sources/Path.swift | 18 ------------------ Sources/PathPoint.swift | 6 ------ Sources/Polygon.swift | 6 ------ 9 files changed, 103 deletions(-) diff --git a/Sources/Bounds.swift b/Sources/Bounds.swift index 390aba17..7517e890 100644 --- a/Sources/Bounds.swift +++ b/Sources/Bounds.swift @@ -131,26 +131,6 @@ public extension Bounds { } } - /// Deprecated. - @available(*, deprecated, renamed: "init(_:)") - init(points: [Vector] = []) { - self = points.reduce(.empty) { - Bounds(min: Euclid.min($0.min, $1), max: Euclid.max($0.max, $1)) - } - } - - /// Deprecated. - @available(*, deprecated, renamed: "init(_:)") - init(polygons: [Polygon]) { - self.init(polygons) - } - - /// Deprecated. - @available(*, deprecated, renamed: "init(_:)") - init(bounds: [Bounds]) { - self.init(bounds) - } - /// A Boolean value that indicates whether the bounds is empty (has zero volume). var isEmpty: Bool { size == .zero diff --git a/Sources/Euclid+CoreGraphics.swift b/Sources/Euclid+CoreGraphics.swift index 88d76fb3..c8dbbfb7 100644 --- a/Sources/Euclid+CoreGraphics.swift +++ b/Sources/Euclid+CoreGraphics.swift @@ -120,11 +120,6 @@ public extension Path { init(_ cgPath: CGPath, detail: Int = 4, color: Color? = nil) { self.init(subpaths: cgPath.paths(detail: detail, color: color)) } - - @available(*, deprecated, renamed: "init(_:detail:color:)") - init(cgPath: CGPath, detail: Int = 4, color: Color? = nil) { - self.init(subpaths: cgPath.paths(detail: detail, color: color)) - } } public extension CGPath { diff --git a/Sources/Euclid+SceneKit.swift b/Sources/Euclid+SceneKit.swift index 4937057e..2189d95a 100644 --- a/Sources/Euclid+SceneKit.swift +++ b/Sources/Euclid+SceneKit.swift @@ -437,11 +437,6 @@ public extension SCNGeometry { ] ) } - - @available(*, deprecated, renamed: "init(_:)") - convenience init(bounds: Bounds) { - self.init(bounds) - } } // MARK: import @@ -553,9 +548,6 @@ public extension Mesh { /// - Returns: A ``Material`` instance, or `nil` for the default material. typealias SCNMaterialProvider = (_ m: SCNMaterial) -> Material? - @available(*, deprecated, renamed: "SCNMaterialProvider") - typealias MaterialProvider = (_ m: SCNMaterial) -> Material? - /// Loads a mesh from a file using any format supported by SceneKit, with optional material mapping. /// - Parameters: /// - url: The `URL` of the file to be loaded. @@ -779,11 +771,6 @@ public extension Mesh { init?(_ scnGeometry: SCNGeometry, material: Material?) { self.init(scnGeometry) { _ in material } } - - @available(*, deprecated, renamed: "init(_:materialLookup:)") - init?(scnGeometry: SCNGeometry, materialLookup: SCNMaterialProvider? = nil) { - self.init(scnGeometry, materialLookup: materialLookup) - } } #else diff --git a/Sources/LineSegment.swift b/Sources/LineSegment.swift index 1241810d..07faadc8 100644 --- a/Sources/LineSegment.swift +++ b/Sources/LineSegment.swift @@ -47,12 +47,6 @@ public struct LineSegment: Hashable, Sendable { self.start = start self.end = end } - - /// Deprecated. - @available(*, deprecated, renamed: "init(start:end:)") - public init?(_ start: Vector, _ end: Vector) { - self.init(start: start, end: end) - } } extension LineSegment: Comparable { diff --git a/Sources/Mesh+CSG.swift b/Sources/Mesh+CSG.swift index 6c4ecdd4..54003543 100644 --- a/Sources/Mesh+CSG.swift +++ b/Sources/Mesh+CSG.swift @@ -200,11 +200,6 @@ public extension Mesh { ) } - @available(*, deprecated, renamed: "subtracting(_:isCancelled:)") - func subtract(_ mesh: Mesh, isCancelled: CancellationHandler = { false }) -> Mesh { - subtracting(mesh, isCancelled: isCancelled) - } - /// Efficiently gets the difference between multiple meshes. /// - Parameters /// - meshes: An ordered collection of meshes. All but the first will be subtracted from the first. @@ -265,11 +260,6 @@ public extension Mesh { ) } - @available(*, deprecated, renamed: "symmetricDifference(_:isCancelled:)") - func xor(_ mesh: Mesh, isCancelled: CancellationHandler = { false }) -> Mesh { - symmetricDifference(mesh, isCancelled: isCancelled) - } - /// Efficiently XORs multiple meshes. /// - Parameters /// - meshes: A collection of meshes to be XORed. @@ -282,14 +272,6 @@ public extension Mesh { merge(meshes, using: { $0.symmetricDifference($1, isCancelled: $2) }, isCancelled) } - @available(*, deprecated, renamed: "symmetricDifference(_:isCancelled:)") - static func xor( - _ meshes: T, - isCancelled: CancellationHandler = { false } - ) -> Mesh where T.Element == Mesh { - symmetricDifference(meshes, isCancelled: isCancelled) - } - /// Returns a new mesh representing the volume shared by both the mesh /// parameter and the receiver. If these do not intersect, an empty mesh will be returned. /// @@ -335,11 +317,6 @@ public extension Mesh { ) } - @available(*, deprecated, renamed: "intersection(_:isCancelled:)") - func intersect(_ mesh: Mesh, isCancelled: CancellationHandler = { false }) -> Mesh { - intersection(mesh, isCancelled: isCancelled) - } - /// Efficiently computes the intersection of multiple meshes. /// - Parameters /// - meshes: A collection of meshes to be intersected. diff --git a/Sources/Mesh.swift b/Sources/Mesh.swift index 3c74481a..6ae0e6eb 100644 --- a/Sources/Mesh.swift +++ b/Sources/Mesh.swift @@ -329,12 +329,6 @@ public extension Mesh { ) } - /// Deprecated. - @available(*, deprecated, renamed: "smoothingNormals(forAnglesGreaterThan:)") - func smoothNormals(_ threshold: Angle) -> Mesh { - smoothingNormals(forAnglesGreaterThan: threshold) - } - /// Subdivides triangles and quads, leaving other polygons unchanged. func subdivide() -> Mesh { Mesh( diff --git a/Sources/Path.swift b/Sources/Path.swift index 30d46636..51994163 100644 --- a/Sources/Path.swift +++ b/Sources/Path.swift @@ -140,12 +140,6 @@ public extension Path { mapColors { _ in color } } - /// Deprecated. - @available(*, deprecated, renamed: "withColor(_:)") - func with(color: Color?) -> Path { - withColor(color) - } - /// Closes the path by joining last point to first. /// - Returns: A new path, or `self` if the path is already closed, or cannot be closed. func closed() -> Path { @@ -216,18 +210,6 @@ public extension Path { ) } - @available(*, deprecated, renamed: "init(_:)") - init(polygon: Polygon) { - let hasTexcoords = polygon.hasTexcoords - self.init( - unchecked: polygon.vertices.map { - .point($0.position, texcoord: hasTexcoords ? $0.texcoord : nil) - }, - plane: polygon.plane, - subpathIndices: nil - ) - } - /// Creates a path from a set of line segments. /// - Parameter lineSegments: A set of``LineSegment`` to convert to a path. init(_ lineSegments: Set) { diff --git a/Sources/PathPoint.swift b/Sources/PathPoint.swift index 6aa43ddd..f618cfe4 100644 --- a/Sources/PathPoint.swift +++ b/Sources/PathPoint.swift @@ -343,12 +343,6 @@ public extension PathPoint { point.color = color return point } - - /// Deprecated. - @available(*, deprecated, renamed: "withColor(_:)") - func with(color: Color?) -> PathPoint { - withColor(color) - } } extension PathPoint { diff --git a/Sources/Polygon.swift b/Sources/Polygon.swift index 12732877..fc30a395 100644 --- a/Sources/Polygon.swift +++ b/Sources/Polygon.swift @@ -224,12 +224,6 @@ public extension Polygon { return polygon } - /// Deprecated. - @available(*, deprecated, renamed: "withMaterial(_:)") - func with(material: Material?) -> Polygon { - withMaterial(material) - } - /// Creates a polygon from an array of vertices. /// - Parameters: /// - vertices: An array of ``Vertex`` that make up the polygon.