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
def mesh_cleanup(mesh_o3d): | |
mesh_o3d.remove_non_manifold_edges() | |
mesh_o3d.merge_close_vertices(0.001) | |
mesh_o3d.remove_duplicated_vertices() | |
mesh_o3d.remove_duplicated_triangles() | |
mesh_o3d.remove_unreferenced_vertices() | |
mesh_o3d.remove_degenerate_triangles() | |
# This seems to keep the majority normal direction, but without knowing | |
# how it works there's the risk that it flips all the faces. |
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
# Similar to https://til.simonwillison.net/jq/git-log-json | |
git log --pretty=format:'%H%x00%an <%ae>%x00%ad%x00%s%x00' | python -c 'import sys, json | |
for line in sys.stdin: | |
commit, author, date, *message = line.split("\x00") | |
print(json.dumps({"commit": commit, "author": author, "date": date, "message": message[0]})) | |
' |
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
#!/bin/sh | |
set -e | |
test "$#" -ge 2 || { | |
echo >&2 'usage: backup DIR DEST [ROOT]' | |
echo >&2 ' Make a backup of DIR in DEST/DATE/PATH, where:' | |
echo >&2 " * DATE is the today's date in the format YYYY-MM-DD." | |
echo >&2 ' * PATH is the path to DIR relative to ROOT (ROOT defaults to /).' | |
echo >&2 |
OlderNewer