Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env cabal
{- cabal:
build-depends:
base
, linear
, waterfall-cad ^>= 0.5.1.0
, opencascade-hs ^>= 0.5.1.0
-}
-- short-description: Model of a Cartoon Bomb, Labelled C++
import qualified Waterfall
import Linear
import Data.Function ((&))
len = 50
innerR = 25/2
wallT = 0.8
overhang = 1
holeRA = 8.5/2
holeRB = 6/2
ISO-10303-21;
HEADER;
/* Generated by software containing ST-Developer
* from STEP Tools, Inc. (www.steptools.com)
*/
/* OPTION: using custom renumber hook */
FILE_DESCRIPTION(
/* description */ ('STEP AP242',
'CAx-IF Rec.Pracs.---Representation and Presentation of Product Manufa
import qualified Waterfall
import qualified Waterfall.SVG
import qualified Graphics.Svg as Svg
import Linear
import Control.Lens ((&), (.~))
import Codec.Picture.Types (PixelRGBA8 (..))
somePath :: Waterfall.Path2D
somePath = Waterfall.pathFrom zero
[ Waterfall.bezierRelative (V2 0 50) (V2 50 50) (V2 50 100)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env stack
{- stack script --resolver lts-22.6
--package linear
--package lens
--package waterfall-cad
--extra-dep waterfall-cad-0.4.0.0
--extra-dep opencascade-hs-0.4.0.0
-}
import qualified Waterfall
@joe-warren
joe-warren / CompileTagFeeds.hs
Created September 29, 2024 16:26
CompileTagFeeds.hs
let compileTagFeeds feedType feedExt feedCompiler =
tagsRules tags $ \tag pat -> version feedType $ do
route (setExtension feedExt)
compile $ do
(allPosts, ctx) <- loadPattern pat
posts <- recentFirst allPosts
let feedCtx = ctx `mappend` postCtx
tagDescription <- readTagDescriptionFile'
let feedConfiguration = myFeedConfiguration
{ feedTitle = feedTitle myFeedConfiguration <> " :: Only " <> tag <> " Posts"
import qualified Waterfall
import Linear
import Data.Maybe (fromMaybe)
outerBoundingBox :: (V3 Double, V3 Double) -> (V3 Double, V3 Double)
outerBoundingBox (lo, hi) = let b = 2 in ( lo - V3 b b 0, hi + V3 50 b 0)
innerBoundingBox :: (V3 Double, V3 Double) -> (V3 Double, V3 Double)
innerBoundingBox (lo, hi) = let b = 1 in ( lo - V3 b b (-1), hi + V3 60 b 1)
import qualified Waterfall
import qualified Waterfall.TwoD.Shape as Shape
import Waterfall.Internal.Solid (debug)
import Linear
import Control.Lens ((^.))
import Data.Monoid (Endo (..))
tSlotCrossSection :: Waterfall.Path2D
tSlotCrossSection =
let oneQuarter =
import qualified Waterfall
import qualified Waterfall.TwoD.Shape as Shape
import Waterfall.Internal.Solid (debug)
import Linear
import Control.Lens ((^.))
pathFactor :: Double
pathFactor = 12.5
heartPath :: Waterfall.Path