Exposing Eigen3 solvers via python #30908
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#30908
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%Since the Eigen3 library is shipped with Blender it would be nice to be able to
access the linear algebra functions from python.
There are probaly several developers who need to use external libraries
(numpy, ...) to solve certain problems. In my mesh alignment
(pointcloud alignment) tool it is needed to calculate a least-squares solution
for the transformation matrix.
This patch adds a new module to mathutils (mathutils.eigen) and provides a
generic solve function that can solve Ax=b for x currently with
The matrices are lists of python lists 1,0,0],[0,1,0],[0,0,1 and vectors are
either [- [x],- [x],- [x]] or [1,2,3]. This is because the mathutils.Matrix class does
not support matrices of arbitrary size.
The solver throws exceptions if the Matrix rows don't have the same size or if
the rows of A and b are not equal or if the elements are not PyLong or PyFloat.
The return value is a list of values which corresponds to the vector 'x'
Attached is a little example that shows how the solver is used
(solver_example.txt)
The patch can be applied with
patch -p0 -d source/blender/python < mathutils_eigen.diff
in the root of the blender directory%%%
Changed status to: 'Open'
Changed status from 'Open' to: 'Archived'
Added subscriber: @Sergey
Blender is not a framework, so exposing Eigen is not something we're really interested in.
However, we've got numpy in official builds now, which i believe will solve your needs.
So thanks for the patch, but archiving it now.