Created
July 9, 2025 21:44
-
-
Save mightybyte/bfc34080b8bae43e702039991518afd2 to your computer and use it in GitHub Desktop.
Extender for window blinds
This file contains hidden or 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
module BlindsHolder where | |
------------------------------------------------------------------------------ | |
import Linear | |
import qualified Waterfall as W | |
import qualified Waterfall.Solids as W | |
import Waterfall.Booleans | |
------------------------------------------------------------------------------ | |
newTabOffset :: Double | |
newTabOffset = 10 | |
tabLength :: Double | |
tabLength = 15.3 | |
tabX :: Double | |
tabX = 10.2 | |
tabY :: Double | |
tabY = 2.3 | |
holderSide :: Double | |
holderSide = 12 | |
tab :: Double -> Double -> W.Solid | |
tab x y = | |
W.translate (V3 (holderSide/2 - x/2) (holderSide/2 - y/2) 0) $ | |
W.scale (V3 x y tabLength) W.unitCube | |
tabHolder :: W.Solid | |
tabHolder = W.scale (V3 holderSide holderSide (tabLength+2)) W.unitCube | |
blindsHolder | |
:: Double | |
-> Double | |
-> W.Solid | |
blindsHolder x y = | |
(horizTab <> vertTab <> tabHolder) `difference` (tab (x + 0.1) (y + 0.1)) | |
where | |
horizTab = W.translate (V3 0 0 newTabOffset) (tab x y) -- (tab (x - 0.2) (y - 0.2)) | |
vertTab = W.translate (V3 12 0 0) $ W.rotate (V3 0 0 1) (pi / 2.0) horizTab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment