Skip to content

0.8.1

Compare
Choose a tag to compare
@tomasf tomasf released this 01 Nov 11:21
· 55 commits to main since this release
  • Added readEnvironment variants for reading specific key paths from the environment
readEnvironment(\.naturalUpDirection) { naturalUp in
    Cylinder(diameter: 1, height: 10)
        .rotated(to: naturalUp ?? .up)
}
  • Added an @EnvironmentValue property wrapper that can be used in Shape2D/Shape3D for accessing values from the environment.
struct HollowBall: Shape3D {
    let diameter: Double
    let mountDiameter: Double
    @EnvironmentValue(\.tolerance) var tolerance

    var body: any Geometry3D {
        Sphere(diameter: diameter)
            .subtracting {
                Cylinder(diameter: mountDiameter + tolerance, height: diameter)
            }
    }
}