packages feed

waterfall-cad-examples 0.6.1.0 → 0.6.2.0

raw patch · 4 files changed

+45/−9 lines, 4 filesdep ~opencascade-hsdep ~svg-treedep ~waterfall-cadPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: opencascade-hs, svg-tree, waterfall-cad, waterfall-cad-svg

API changes (from Hackage documentation)

+ TakePathFractionExample: takePathFractionExample :: Solid

Files

CHANGELOG.md view
@@ -8,6 +8,10 @@  ## Unreleased +## 0.6.2.0++- Added `TakePathFractionExample`, demonstrating `takePathFraction`+ ## 0.6.1.0  ### Added 
app/Main.hs view
@@ -16,6 +16,7 @@ import TwoDBooleansExample (twoDBooleansExample) import SVG.PathExample (pathExample) import SVG.ReadFileExample (readFileExample)+import TakePathFractionExample (takePathFractionExample) import Waterfall.SVG (writeDiagramSVG) import DarkModeSVG (writeDarkModeSVG) import Waterfall.IO (writeSTL, writeSTEP, writeGLTF, writeGLB, writeOBJ)@@ -78,6 +79,7 @@       OA.flag' boundingBoxExample (OA.long "bound" <> OA.help "demonstrates calculating the oriented bounding box, and axis aligned bounding box, of a shape" ) <|>       OA.flag' twoDBooleansExample (OA.long "2d-booleans" <> OA.help "demonstrates 2D boolean operations (union, intersection, difference) on shapes" ) <|>       OA.flag' platonicSolidsExample (OA.long "platonic-solids" <> OA.help "demonstrates the 5 platonic solids (tetrahedron, cube, octahedron, dodecahedron and icosahedron)") <|>+      OA.flag' takePathFractionExample (OA.long "take-path-fraction" <> OA.help "demonstrates truncating a path to different fractions of its length") <|>       (OA.flag' gearExample (OA.long "gear" <> OA.help "generate an involute gear") <*>        (OA.option OA.auto (OA.long "thickness" <> OA.help "gear depth") <|> pure 1.0) <*>        (OA.option OA.auto (OA.long "module" <> OA.help "gear module") <|> pure 5.0) <*>
+ src/TakePathFractionExample.hs view
@@ -0,0 +1,29 @@+{-|+<<models/takePathFraction.glb>>+-}+module TakePathFractionExample+( takePathFractionExample+) where++import Waterfall.Sweep (sweep)+import Waterfall.Solids (Solid)+import qualified Waterfall.Path as Path+import qualified Waterfall.TwoD.Shape as Shape+import qualified Waterfall.Transforms as Transforms+import qualified Waterfall.TwoD.Transforms as TwoD.Transforms+import Linear (V3 (..), zero)++takePathFractionExample :: Solid+takePathFractionExample =+    let sweepPath = Path.pathFrom zero+            [ Path.bezierRelative (V3 0 0 0.5) (V3 0.5 0.5 0.5) (V3 0.5 0.5 1)+            , Path.bezierRelative (V3 0 0 0.5) (V3 (-0.5) (-0.5) 0.5) (V3 (-0.5) (-0.5) 1)+            , Path.arcViaRelative (V3 0 1 1) (V3 0 2 0)+            , Path.lineTo (V3 0 2 0)+            ]+        profile = TwoD.Transforms.uScale2D 0.2 Shape.unitCircle+        fractions = [0.1, 0.2 .. 1.0]+    in mconcat+        [ Transforms.translate (V3 (f * 10) 0 0) . sweep (Path.takePathFraction3D f sweepPath) $ profile+        | f <- fractions+        ]
waterfall-cad-examples.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           waterfall-cad-examples-version:        0.6.1.0+version:        0.6.2.0 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@@ -42,6 +42,7 @@       SVG.PathExample       SVG.ReadFileExample       SweepExample+      TakePathFractionExample       TextExample       TwoDBooleansExample   other-modules:@@ -53,14 +54,14 @@       base >=4.7 && <5     , lens ==5.*     , linear >=1.21 && <2-    , opencascade-hs >=0.6.1.0 && <0.7+    , opencascade-hs >=0.6.2.0 && <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.1.0 && <0.7-    , waterfall-cad-svg >=0.6.1.0 && <0.7+    , svg-tree >=0.6 && <1+    , waterfall-cad >=0.6.2.0 && <0.7+    , waterfall-cad-svg >=0.6.2.0 && <0.7     , xml ==1.*   default-language: Haskell2010 @@ -75,14 +76,14 @@       base >=4.7 && <5     , lens ==5.*     , linear >=1.21 && <2-    , opencascade-hs >=0.6.1.0 && <0.7+    , opencascade-hs >=0.6.2.0 && <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.1.0 && <0.7+    , svg-tree >=0.6 && <1+    , waterfall-cad >=0.6.2.0 && <0.7     , waterfall-cad-examples-    , waterfall-cad-svg >=0.6.1.0 && <0.7+    , waterfall-cad-svg >=0.6.2.0 && <0.7     , xml ==1.*   default-language: Haskell2010