Skip to content

Commit

Permalink
Prevent usage of profiled extrude without topEdge or bottomEdge
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasf committed Mar 10, 2024
1 parent d1d7d62 commit 159f2de
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Sources/SwiftSCAD/Operations/Extrude/EdgeProfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public extension Geometry2D {
/// - `.convexHull`: This method creates a smooth, non-layered shape. It is often computationally less intensive and results in a more aesthetically pleasing form but only works as expected for convex shapes.
/// - Returns: The extruded 3D geometry.

func extruded(height: Double, topEdge: EdgeProfile = .sharp, bottomEdge: EdgeProfile = .sharp, method: EdgeProfile.Method) -> any Geometry3D {
func extruded(height: Double, topEdge: EdgeProfile, bottomEdge: EdgeProfile, method: EdgeProfile.Method) -> any Geometry3D {
extruded(height: height)
.intersection {
if topEdge != .sharp {
Expand All @@ -79,6 +79,16 @@ public extension Geometry2D {
}
}
}

/// See ``extruded(height:topEdge:bottomEdge:method:)``
func extruded(height: Double, topEdge: EdgeProfile, method: EdgeProfile.Method) -> any Geometry3D {
extruded(height: height, topEdge: topEdge, bottomEdge: .sharp, method: method)
}

/// See ``extruded(height:topEdge:bottomEdge:method:)``
func extruded(height: Double, bottomEdge: EdgeProfile, method: EdgeProfile.Method) -> any Geometry3D {
extruded(height: height, topEdge: .sharp, bottomEdge: bottomEdge, method: method)
}
}

public extension EdgeProfile {
Expand Down

0 comments on commit 159f2de

Please sign in to comment.