Will it Blend? Writing A Custom Constraint Solver for Blender with Cython
summary
A custom Cython-based constraint solver called pymaxian integrates with Blender as an add-on and achieves near-instant convergence for thousands of constraints after releases the GIL and optimizations, reporting about a 100x speedup. The work includes C++ geometry helpers, pxd/pyx bindings, memoryviews for nogil array access, profiling with py-spy in Docker that pinpoints initialization as the hotspot, and a working Blender UI that visualizes hanging cloth form-finding.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:23Agenda
- 1:51Software in the Built Environment What I Used It For • Building Analysis
- 3:45Physical and Digital Formfinding
- 4:34Constraint Solvers for 3d Geometry
- 6:28Why Cython?
- 7:38What is Cython? • Optimizing Static Compiler • Provides support for debugging in Python, Cython, and
- 8:00Toy Constraint Problem Constraints • Anchors (supports) - 10,21 Forces (loads) - 11
- 9:16Package Structure and Modules with Cython
- 12:20Compiling Cython
- 13:56Before you release the GIL...
- 15:20Releasing the GIL!
- 17:45Evaluating Cython performance - py-spy
- 19:55What is Blender?
- 20:56Adding your Cython package to Blender
- 22:28Blender Add-on Interface Creation Typical files
- 24:09Blender Properties
- 25:02Pymaxion - Blender Demo!
related talks
33mEasy wins with Cython: fast and multi-core
42mLift your Speed Limits with Cython
39mPushing Cython to its Limits in Scikit-learn
42mMaking your code faster: Cython and parallel processing in the Jupyter Notebook
43mAnalyzing 3D objects with power of Deep Learning and Cython
30mMultibody Simulation Using sympy, scipy and vpython
40mGet native with Cython
25m"Boosting Python Numeric Computations with Dynamic C++ Integration"
