How benjaminsauder/edgeflow works
Project type and purpose
• EdgeFlow is a Blender addon (plugin) written in pure Python.
• It extends Blender’s mesh‐editing UI by registering a set of custom operators that perform curved edge‐loop manipulations.
• Key purpose: provide “Set Flow,” “Set Linear,” “Set Curve,” and “Set Vertex Curve” tools on Blender’s Mesh → Edge/Vertex menus.
File structure
• Top‐level files:
• blender_manifest.toml + __init__.py – addon metadata and registration entry point
• README.md, LICENSE, .gitignore – documentation and project metadata
• Operator modules (the core components):
• op_set_edge_flow.py
• op_set_edge_linear.py
• op_set_edge_curve.py
• op_set_vertex_curve.py
• Utility modules (shared logic):
• dijkstra.py – graph search for sorting edge loops
• edgeloop.py – constructs sorted loops from raw selection
• interpolate.py – spline/harmonic interpolation routines
• util.py – helper functions (angle checks, distance metrics, mesh access)
• No external dependencies beyond Blender’s Python API and standard library.
README for additional insights
• The README describes each operator’s parameters and UI placement.
• Developer Notes mention a custom edge‐loop sorting and a Hermite spline interpolation implementation.
• There is no reference to a separate service or database—everything runs inside Blender’s process.
a. Main components:
1. Blender Host Application
2. Addon Manager & Registration (blender_manifest.toml + __init__.py)
3. UI/Menu Integration (Mesh→Edge, Mesh→Vertex, Context Menus, Shortcuts)
4. Operator Modules (op_set_* .py files)
5. Core Logic Modules (dijkstra.py, edgeloop.py, interpolate.py, util.py)
6. Blender Mesh Data API (bpy.types.Mesh, BMesh)
b. Relationships & data flow:
• User triggers menu/shortcut → Blender dispatches to EdgeFlow operator
• Operator module reads current mesh via bpy and BMesh API
• Operator calls edgeloop.py to sort selected elements into loops
• Operator calls interpolate.py (with control points from edgeloop and dijkstra)
• util.py provides angle checks, tension blending, and assigns new vertex positions
• Resulting mesh is pushed back to Blender viewport
c. Architectural patterns & principles:
• Modular separation: each operator lives in its own file
• Shared services (graph search, interpolation) factored into utility modules
• Event-driven: UI event → operator invocation → mesh mutation
d. Technologies/frameworks:
• Python 3.x (Blender’s embedded Python)
• Blender Python API (bpy, bmesh modules)
• Hermite spline interpolation (self‐contained code ported from Paul Bourke’s algorithm)