Skip to content

Instantly share code, notes, and snippets.

View mikedh's full-sized avatar

Michael Dawson-Haggerty mikedh

View GitHub Profile
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 Edition 2',
'CAx-IF Rec.Pracs.---Representation and Presentation of Product Manufa
#!/usr/bin/env bash
#
# clean-build-dirs.sh — find and delete build/env directories:
# - Rust `target/` next to a Cargo.toml
# - Python `.venv/` next to a pyproject.toml
#
# A directory named `target` is treated as a Rust build dir only if it is a
# sibling of a Cargo.toml, OR it contains a Cargo build-cache marker
# (CACHEDIR.TAG / .rustc_info.json). A `.venv` is treated as a Python virtual
# env only if it is a sibling of a pyproject.toml, OR it contains a
mikedh@europa:example$ uv add trimesh "pyglet<2" "cascadio>=0.0.18rc5"
Resolved 5 packages in 0.51ms
Audited 4 packages in 0.04ms
mikedh@europa:example$ uv run python
Python 3.14.0 (main, Nov 19 2025, 22:48:15) [Clang 21.1.4 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import trimesh, cascadio
@mikedh
mikedh / sux
Last active March 7, 2026 23:35
#!/usr/bin/env python3
"""
sux - a less annoying tmux wrapper
Modes:
tmux `sux <name>` creates or attaches to a named tmux session.
`sux` with no args attaches to the most recent session.
docker `sux -d <name>` mounts the current directory into an isolated
Docker container with rust, uv, node, and claude-code.
@mikedh
mikedh / report.md
Last active January 17, 2025 21:36
Trimesh.load back-port accuracy

Running: python corpus.py -compare

  • Comparing 4.6.0 against 4.5.3
  • Return types matched 99.785% of the time
  • Loaded 758 vs Loaded 668
import os
cwd = os.path.abspath(os.path.expanduser(os.path.dirname(__file__)))
def backup(frag):
"""
Parse a string backwards to find the first value which can
be a variable name, parenthisized or bracked expression.
@mikedh
mikedh / cust16.glb.header.json
Created July 28, 2022 17:47
Byte alignment error
{
"scene": 0,
"scenes": [{ "nodes": [0] }],
"asset": {
"version": "2.0",
"generator": "https://github.com/mikedh/trimesh"
},
"accessors": [
{
"componentType": 5125,
import os
import time
import trimesh
import numpy as np
tol_norm = 1e-4
def test_align(align):
import os
import trimesh
import numpy as np
tol_norm = 1e-4
def test_align(align):
"""

robot-gltf

Summary

An effort to replace ROS packages describing a robot (a directory structure with URDF, SRDF, OBJ-MTL-STL-salad) with a single GLTF 2.0 GLB file including URDF and SRDF descriptions in the "extras" field of the GLTF header.

Proposed Robot-GLTF Format

  • All geometry is put into a GLTF 2.0 .GLB file.
  • Nodes in GLTF scene description are not used, but can be defined for visualization
  • The URDF and SRDF descriptions are stored in the extras field of the GLTF header.
  • Using the extras field keeps us completely compliant with the spec.