Skip to content

Instantly share code, notes, and snippets.

@spelufo
spelufo / open3d_poisson_recon_helpers.py
Created May 27, 2024 14:15
open3d_poisson_recon_helpers.py
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.
@spelufo
spelufo / git-log-to-json.sh
Created November 7, 2024 17:33
Convert git log output to JSON
# 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]}))
'