waterfall-cad-examples 0.6.0.0 → 0.6.0.1
raw patch · 4 files changed
+21/−16 lines, 4 filesdep ~opencascade-hsdep ~waterfall-caddep ~waterfall-cad-svgPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: opencascade-hs, waterfall-cad, waterfall-cad-svg
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- src/CsgExample.hs +5/−6
- src/FilletExample.hs +4/−3
- waterfall-cad-examples.cabal +7/−7
CHANGELOG.md view
@@ -8,6 +8,11 @@ ## Unreleased +## 0.6.0.1++- Adjusted `CsgExample` to use `centeredCylinder`, and removed use of `Booleans.Operators` +- Use `whenNearlyEqual` in `FilletExample`+ ## 0.6.0.0 ### Added
src/CsgExample.hs view
@@ -7,17 +7,16 @@ import qualified Waterfall.Solids as Solids import qualified Waterfall.Transforms as Transforms-import Waterfall.Booleans.Operators ( (~-~), (~/\~), (~\/~) )-import Linear (V3 (..), (^*), unit, _x, _y, _z )+import Waterfall.Booleans ( union, intersection, difference )+import Linear (V3 (..), (^*), unit, _x, _y ) import Data.Function ((&)) csgExample :: Solids.Solid csgExample = let sphere = Solids.unitSphere cube = Transforms.uScale 1.5 Solids.centeredCube- cylinder = Solids.unitCylinder &- Transforms.translate (unit _z ^* (-0.5)) &- Transforms.scale (V3 0.55 0.55 4) + cylinder = Solids.centeredCylinder+ & Transforms.scale (V3 0.55 0.55 4) cylinderA = Transforms.rotate (unit _x) (pi/2) cylinder cylinderB = Transforms.rotate (unit _y) (pi/2) cylinder- in (cube ~/\~ sphere) ~-~ (cylinder ~\/~ cylinderA ~\/~ cylinderB)+ in (cube `intersection` sphere) `difference` (cylinder `union` cylinderA `union` cylinderB)
src/FilletExample.hs view
@@ -14,9 +14,10 @@ , chamfer , conditionalChamfer , indexedConditionalChamfer+ , whenNearlyEqual ) import Control.Lens ((^.))-import Linear (V3 (..), _z)+import Linear (V3 (..), _xy) import Control.Monad (guard) filletExample :: Solid@@ -36,14 +37,14 @@ -- round every edge [[ roundFillet 0.1 centeredCube -- round horizontal edges - , roundConditionalFillet (\(s, e) -> if s ^. _z == e ^._z then Nothing else Just 0.1) centeredCube+ , roundConditionalFillet (whenNearlyEqual _xy 0.1) centeredCube -- round edges with odd indices by a variable radius depending on the edge index , roundIndexedConditionalFillet (\i _ -> (fromIntegral i * 0.04) <$ guard (odd i)) centeredCube ], -- chamfer every edge [ chamfer 0.1 centeredCube -- chamfer horizontal edges - , conditionalChamfer (\(s, e) -> if s ^. _z == e ^._z then Nothing else Just 0.1) centeredCube+ , conditionalChamfer (whenNearlyEqual _xy 0.1) centeredCube -- chamfer edges with odd indices by a variable amount depending on the edge index , indexedConditionalChamfer (\i _ -> (fromIntegral i * 0.04) <$ guard (odd i)) centeredCube ]]
waterfall-cad-examples.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: waterfall-cad-examples-version: 0.6.0.0+version: 0.6.0.1 synopsis: Examples for Waterfall CAD, a Declarative CAD/Solid Modeling Library description: Please see the README on GitHub at <https://github.com/joe-warren/opencascade-hs#readme> category: Graphics@@ -52,14 +52,14 @@ base >=4.7 && <5 , lens ==5.* , linear >=1.21 && <2- , opencascade-hs >=0.6.0.0 && <0.7+ , opencascade-hs >=0.6.0.1 && <0.7 , optparse-applicative >=0.17 && <0.19 , parsec ==3.1.* , parser-combinators >=1.2 && <1.4 , raw-strings-qq >=1.1 && <2 , svg-tree >=0.6 && <1.0- , waterfall-cad >=0.6.0.0 && <0.7- , waterfall-cad-svg >=0.6.0.0 && <0.7+ , waterfall-cad >=0.6.0.1 && <0.7+ , waterfall-cad-svg >=0.6.0.1 && <0.7 , xml ==1.* default-language: Haskell2010 @@ -74,14 +74,14 @@ base >=4.7 && <5 , lens ==5.* , linear >=1.21 && <2- , opencascade-hs >=0.6.0.0 && <0.7+ , opencascade-hs >=0.6.0.1 && <0.7 , optparse-applicative >=0.17 && <0.19 , parsec ==3.1.* , parser-combinators >=1.2 && <1.4 , raw-strings-qq >=1.1 && <2 , svg-tree >=0.6 && <1.0- , waterfall-cad >=0.6.0.0 && <0.7+ , waterfall-cad >=0.6.0.1 && <0.7 , waterfall-cad-examples- , waterfall-cad-svg >=0.6.0.0 && <0.7+ , waterfall-cad-svg >=0.6.0.1 && <0.7 , xml ==1.* default-language: Haskell2010