Skip to content

Commit

Permalink
Make protocols public
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasf committed Feb 27, 2024
1 parent 1eea16d commit 1161d40
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftSCAD/Values/Axes.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

protocol Axes {
public protocol Axes {
associatedtype Axis

init(axis: Axis)
Expand All @@ -11,7 +11,7 @@ protocol Axes {
/// A set of possible axes in two dimensions

public struct Axes2D: Axes, OptionSet, Hashable {
typealias Axis = Axis2D
public typealias Axis = Axis2D

public let rawValue: Int
public static let x = Axes2D(rawValue: 1 << 0)
Expand Down Expand Up @@ -47,7 +47,7 @@ public struct Axes2D: Axes, OptionSet, Hashable {
/// A set of possible axes in three dimensions

public struct Axes3D: Axes, OptionSet, Hashable {
typealias Axis = Axis3D
public typealias Axis = Axis3D

public let rawValue: Int
public static let x = Axes3D(rawValue: 1 << 0)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftSCAD/Values/Transforms/AffineTransform.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

protocol AffineTransform {
public protocol AffineTransform {
associatedtype Vector: SwiftSCAD.Vector

static var identity: Self { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import simd

/// An `AffineTransform2D` represents a 2D affine transformation using a 3x3 matrix.
public struct AffineTransform2D: AffineTransform, Equatable {
typealias Vector = Vector2D
private var matrix: Matrix3x3

internal init(_ matrix: Matrix3x3) {
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftSCAD/Values/Vectors/Vector.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Foundation

protocol Vector {
public protocol Vector {
associatedtype Axes: SwiftSCAD.Axes
associatedtype Transform: AffineTransform

static var zero: Self { get }
static prefix func -(_ v: Self) -> Self
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftSCAD/Values/Vectors/Vector2D.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ public extension Vector2D {
}

extension Vector2D: Vector {
typealias Axes = Axes2D
public typealias Transform = AffineTransform2D
}
2 changes: 1 addition & 1 deletion Sources/SwiftSCAD/Values/Vectors/Vector3D.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ public extension Vector3D {
}

extension Vector3D: Vector {
typealias Axes = Axes3D
public typealias Transform = AffineTransform3D
}

0 comments on commit 1161d40

Please sign in to comment.