packages feed

waterfall-cad-examples 0.0.0.1 → 0.1.0.0

raw patch · 5 files changed

+32/−8 lines, 5 filesdep ~opencascade-hsdep ~waterfall-cadPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: opencascade-hs, waterfall-cad

API changes (from Hackage documentation)

+ TextExample: textExample :: FilePath -> Double -> String -> Double -> Solid

Files

CHANGELOG.md view
@@ -8,4 +8,10 @@  ## Unreleased -## 0.0.0.1 - YYYY-MM-DD+## 0.1.0.0 - 2023-12-05 ++### Added++- Added Waterfall.Text, containing text rendering functions++## 0.0.0.1 - 2023-11-29
app/Main.hs view
@@ -6,6 +6,7 @@ import FilletExample (filletExample) import RevolutionExample (revolutionExample) import SweepExample (sweepExample)+import TextExample (textExample) import Waterfall.IO (writeSTL, writeSTEP) import qualified Waterfall.Solids as Solids import qualified Options.Applicative as OA@@ -32,6 +33,12 @@                  (OA.option OA.auto (OA.long "pitch" <> OA.help "pitchAngle")                      <|> ((* (pi/180)) <$> OA.option OA.auto (OA.long "pitchDegrees" <> OA.help "pitch angle in degrees"))                     <|> pure (20*pi/180)) +                ) <|> +                (OA.flag' textExample (OA.long "text" <> OA.help "render text") <*>+                 (OA.strOption (OA.long "font" <> OA.help "font path")) <*>+                 (OA.option OA.auto (OA.long "size" <> OA.help "font size") <|> pure 12.0) <*>+                 (OA.strOption (OA.long "content" <> OA.help "text to render") <|> pure "Waterfall CAD") <*>+                 (OA.option OA.auto (OA.long "depth" <> OA.help "depth to extrude the text to") <|> pure 10.0)                  )  
src/SweepExample.hs view
@@ -7,12 +7,12 @@ import qualified Waterfall.Path as Path import qualified Waterfall.TwoD.Path2D as Path2D import qualified Waterfall.TwoD.Shape as Shape-import Linear ( V3 (..), (*^), angle, unit, _x, zero )+import Linear ( V3 (..), (*^), angle, unit, _x, zero)  sweepExample :: Solid sweepExample =  -    let sweepPath = Path.pathFrom zero +    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)
+ src/TextExample.hs view
@@ -0,0 +1,10 @@+module TextExample (+    textExample+) where++import qualified Waterfall++textExample :: FilePath -> Double -> String -> Double -> Waterfall.Solid+textExample fontpath fontSize content depth = +    let font = Waterfall.fontFromPath fontpath fontSize+    in Waterfall.prism depth $ Waterfall.text font content
waterfall-cad-examples.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           waterfall-cad-examples-version:        0.0.0.1+version:        0.1.0.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@@ -34,6 +34,7 @@       PrismExample       RevolutionExample       SweepExample+      TextExample   other-modules:       Paths_waterfall_cad_examples   hs-source-dirs:@@ -43,9 +44,9 @@       base >=4.7 && <5     , lens ==5.*     , linear >=1.21 && <2-    , opencascade-hs >=0.0.0.1 && <0.1+    , opencascade-hs >=0.1.0.0 && <0.2     , optparse-applicative >=0.17 && <0.19-    , waterfall-cad >=0.0.0.1 && <0.1+    , waterfall-cad >=0.1.0.0 && <0.2   default-language: Haskell2010  executable waterfall-cad-examples@@ -59,8 +60,8 @@       base >=4.7 && <5     , lens ==5.*     , linear >=1.21 && <2-    , opencascade-hs >=0.0.0.1 && <0.1+    , opencascade-hs >=0.1.0.0 && <0.2     , optparse-applicative >=0.17 && <0.19-    , waterfall-cad >=0.0.0.1 && <0.1+    , waterfall-cad >=0.1.0.0 && <0.2     , waterfall-cad-examples   default-language: Haskell2010