Trimesh
A standalone half-edge data structure in python with no dependencies other than numpy. Also, in a separate file, a simple OpenGL viewer.
Install / Use
/learn @yig/TrimeshREADME
Author: Yotam Gingold <yotam (strudel) yotamgingold.com> License: Public Domain. (I, Yotam Gingold, the author, release this code into the public domain.) GitHub: https://github.com/yig/trimesh
trimesh.py: A python half-edge data structure for a triangle mesh that can - handle boundaries (the first outgoing halfedge at a vertex is always a boundary halfedge) (and the last outgoing halfedge is always the opposite of a boundary halfedge)) - save/load itself to/from OBJ format - save itself to OFF format
Loading:
import trimesh
mesh = trimesh.TriMesh.FromOBJ_FileName( "cube.obj" )
trimesh_viewer.py: A very simple GLUT viewer for TriMesh objects. Keys are: - w: toggle edges (wireframe) - r: reset the view - c: captures current window backbuffer into "screen-capture-<title>-<number>.png" - : toggle fullscreen - q: quit
GLUTWindow.py: A very simple class wrapping GLUT. Keys are: - c: captures current window backbuffer into "screen-capture-<title>-<number>.png" - : toggle fullscreen - q: quit
Known issues: trimesh.TriMesh doesn't save or load normals. trimesh.TriMesh doesn't load texture coordinates (though it does save them). GLUTWindow.GLUTWindow screen capture is broken and needs to be changed to use PIL.
Version History: - 2012-01-12: initial release - 2018-01-24: supports Python 3.x
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
