Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Oct 9, 2024
1 parent 95ddb74 commit 121e954
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 115 deletions.
20 changes: 0 additions & 20 deletions Sources/Bounds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions Sources/Euclid+CoreGraphics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 0 additions & 13 deletions Sources/Euclid+SceneKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,6 @@ public extension SCNGeometry {
]
)
}

@available(*, deprecated, renamed: "init(_:)")
convenience init(bounds: Bounds) {
self.init(bounds)
}
}

// MARK: import
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions Sources/LineSegment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 0 additions & 23 deletions Sources/Mesh+CSG.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -282,14 +272,6 @@ public extension Mesh {
merge(meshes, using: { $0.symmetricDifference($1, isCancelled: $2) }, isCancelled)
}

@available(*, deprecated, renamed: "symmetricDifference(_:isCancelled:)")
static func xor<T: Collection>(
_ 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.
///
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions Sources/Mesh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
18 changes: 0 additions & 18 deletions Sources/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<LineSegment>) {
Expand Down
6 changes: 0 additions & 6 deletions Sources/PathPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions Sources/Polygon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 0 additions & 12 deletions Sources/Vector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,6 @@ public extension Vector {
self - plane.normal * distance(from: plane)
}

/// Deprecated.
@available(*, deprecated, renamed: "projected(onto:)")
func project(onto plane: Plane) -> Vector {
projected(onto: plane)
}

/// Returns the distance between the vector (representing a position in space) from the specified line.
/// - Parameter line: The line to compare with.
/// - Returns: The absolute perpendicular distance between the point and line.
Expand All @@ -349,12 +343,6 @@ public extension Vector {
func projected(onto line: Line) -> Vector {
line.direction * (self - line.origin).dot(line.direction) - line.origin
}

/// Deprecated.
@available(*, deprecated, renamed: "projected(onto:)")
func project(onto line: Line) -> Vector {
projected(onto: line)
}
}

extension Vector: UnkeyedCodable {
Expand Down

0 comments on commit 121e954

Please sign in to comment.