This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverlappingInstances #-} | |
{-# LANGUAGE IncoherentInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Layout where | |
import Raylib.Types | |
-- | Horizontal split | |
newtype H a = H a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE Arrows #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE TypeApplications #-} | |
-- ghcid -c 'ghci -isrc' src/Gui.hs -T'sync prog' | |
module Gui (module Gui) where | |
import LiveCoding | |
import Raylib.Util ( WindowResources, drawing ) | |
import Control.Monad.IO.Class ( MonadIO(liftIO) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Lens.Plated | |
import Control.Lens | |
import Language.Haskell.TH | |
import Control.Lens.Extras | |
import Debug.Trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_last_vertex(f): | |
"""Call a function with the newest vertex of the workplane as the first argument. | |
For example, add_last_vertex(Line)(p) is equivalent to Line((0,0), p), | |
if there was no last vertex, or if the last vertex was (0,0) | |
""" | |
def wrapped(*args, **kwargs): | |
context = Builder._get_context() | |
loclastpt = Vector() | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# NOINLINE runLoop #-} | |
runLoop :: IORef Bool | |
runLoop = unsafePerformIO (newIORef True) | |
main = rapid 0 \ k -> do | |
HGCode{..} <- return $ HGCode { input = "CE5S1_hex_grid.gcode" &= typ "INPUT" &= argPos 0, output = def &= typ "OUTPUT" &= argPos 1 } | |
lines <- createRef k "lines" $ runResourceT $ runConduit $ sourceFile input | |
.| decodeUtf8C | |
.| parseGcodeC @Pico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rain Barrel Simulation | |
I want to decide how big my rain barrel has to be. So I use NOAA's version of YYZ's weather | |
mkdir 71624099999 | |
for f in `seq 2006 2022`; do | |
wget https://ncei.noaa.gov/data/global-hourly/access/$f/71624099999.csv -O $f | |
done | |
rm 71624099999/2005.csv # is missing for some reason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} | |
-- use linear V2 Float, V3 Float instead of raylib Vector2 Vector3 | |
module RaylibLinear | |
(module Raylib.Core, | |
module Raylib.Types, | |
module Raylib.Util, | |
module RaylibLinear) where | |
import Raylib.Core hiding (getMonitorPosition, getWindowPosition, getWindowScaleDPI, getMousePosition, getMouseDelta, getMouseWheelMoveV, getTouchPosition, getScreenToWorldRay) | |
import Raylib.Types hiding (Quaternion, Camera3D) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- autogenerated by mkCxt.sh. defines a CC.ctxTypesTable based on the Types.hs files in opencascade-hs | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Cxt where | |
import Data.Map (fromList) | |
import qualified Language.C.Inline.Cpp as C | |
import qualified Language.C.Types as C | |
import qualified Language.C.Inline.Context as C | |
import qualified OpenCascade.BRepBuilderAPI.Types as BRepBuilderAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PWD0=$(pwd) | |
SCRIPT_DIR=$(dirname "$0") | |
writePY () { | |
cat <<'EOF' > $SCRIPT_DIR/yet-another-cad-viewer-master/example/object.py | |
# Optional: enable logging to see what's happening | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ViewPatterns, ApplicativeDo #-} | |
module Main (main) where | |
import Text.Regex.Applicative | |
import Data.List | |
import Control.Monad | |
import System.Exit | |
import System.Environment | |
import Data.Maybe | |
import Data.Char | |
import Data.IntMap (IntMap) |
NewerOlder