Skip to content

Instantly share code, notes, and snippets.

7663 , 788 , 722 , 779 , 854 , 193 , 194
*ELEMENT,TYPE=C3D6,ELSET=contactelements_st1_in1_at1_it2
7664 , 788 , 722 , 779 , 854 , 193 , 194
*ELEMENT,TYPE=C3D6,ELSET=contactelements_st1_in1_at1_it2
7665 , 788 , 722 , 779 , 854 , 193 , 194
*ELEMENT,TYPE=C3D6,ELSET=contactelements_st1_in1_at1_it2
7666 , 788 , 722 , 779 , 854 , 193 , 194
*ELEMENT,TYPE=C3D6,ELSET=contactelements_st1_in1_at1_it2
7667 , 788 , 722 , 779 , 854 , 193 , 194
*ELEMENT,TYPE=C3D6,ELSET=contactelements_st1_in1_at1_it2
@aavogt
aavogt / Rapids.hs
Created April 30, 2026 14:11
waterfall-cad cut to dimple
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE BlockArguments #-}
-- | cascade, waterfall, rapids
-- simplify waterfall-cad expressions by complicating the types and type errors
-- same as before with a fromInteger 0 case added
module Rapids (module Rapids, module Linear, module Control.Lens, module Waterfall) where
import Control.Lens hiding (prism)
@aavogt
aavogt / main.c
Created April 9, 2026 10:58
raylib turing pattern animation
// https://youtu.be/1A2gVRfUDPY
// start the window, resize it, press enter to start recording out.mp4
#ifndef RAYLIBD
#include "raygui.h"
#include "raylib.h"
#include "raymath.h"
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@aavogt
aavogt / mooney.sh
Created March 31, 2026 18:01
override the material in freecad's calculix input file with a rubber
echo =================
sed '/\*MATERIAL, NAME=MaterialSolid/{ n; N; c\
*HYPERELASTIC, NEO-HOOKE\
0.738,1e3
}' -i FEMMeshNetgen.inp
# freecad uses MPa,
# it converges for high values of *SURFACE BEHAVIOR
#
# https://rsmith.home.xs4all.nl/engineering/mooney-rivlin-rubber-data-for-calculix.html
@aavogt
aavogt / Rapids.hs
Last active March 10, 2026 14:13
simplify waterfall-cad expressions by complicating the types and type errors
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
-- moved to https://github.com/aavogt/battery-adapter
-- | cascade, waterfall, rapids
-- simplify waterfall-cad expressions by complicating the types and type errors
module Rapids (module Rapids, module Linear, module Control.Lens, module Waterfall) where
import Control.Lens hiding (prism)
import Data.Maybe
import Data.Proxy (Proxy (..))
@aavogt
aavogt / PathState2D.hs
Last active December 13, 2025 01:25
2d polyline offset/thickness/closing for waterfall-cad-svg
-- | 2d version of https://gist.github.com/aavogt/8fb7162e572d72049748e1e42b12bbd2
--
-- Example output:
-- https://i.ibb.co/yFBtS903/cup.png
--
-- > p0 = execPath $
-- > do
-- > hliner 140
-- > vliner 160
-- > hliner 140
@aavogt
aavogt / loft.hs
Created October 30, 2025 17:05
right-angle diverging duct as a sequence of lofts
{-# LANGUAGE FlexibleContexts #-}
-- # LANGUAGE NamedFieldPuns #-}
-- # LANGUAGE OverloadedRecordDot #-}
-- import Reinsch
import Control.Lens
import Data.List
import qualified Data.Vector.Storable as V
import Linear
import Waterfall
@aavogt
aavogt / 2025-09-09.tidal.hs
Created September 9, 2025 14:41
-XArrows for tidal join functions almost working
:set -XArrows
:set -i.
:load Arr.hs
:script bin/Tidal.ghci
import Control.Arrow
@aavogt
aavogt / pickup.py
Created September 5, 2025 15:27
garbage pickup bin asymmetry
# diagram or explanation at http://aavogt.github.io/pickup.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, CheckButtons
import warnings
warnings.filterwarnings('ignore')
# Vehicle and fuel parameters
truck_mass = 15000 # kg (loaded garbage truck)
drag_coefficient = 0.8 # typical for box truck
@aavogt
aavogt / tape.py
Created August 12, 2025 23:48
offset strip fin using fullcontrol.xyz example for why I started htpl
import fullcontrol as fc
import math
import time
import os
# the main thing is to reduce the temperature
# do I add retraction? Z or E? M207, G10 G11
# do I slow it down?
# do I make them closer together?
# do I add a horizontal line that gets cut off? This way I