How andrupavlov/pathsolver works
Project Type and Purpose
• This is an algorithmic art tool built as a Grasshopper definition (.gh) for Rhinoceros 7, with core logic implemented in a standalone Python module (PathSolver.py).
• Its purpose is to simulate point-behavior on a 3D surface and output curves/paths for artistic use in Rhino.
File-Structure Analysis
• Top-level:
• Example/PathSolver_ex.gh – the Grasshopper definition you open in Rhino+GH.
• PathSolver_PY/PathSolver.py – the Python‐only solver logic.
• README.md, LICENSE, .gitignore.
• No separate “frontend” or “backend” folders; instead we have:
• Host environment: Rhino + Grasshopper
• GH definition: user interface & component graph
• External script: the pure‐Python algorithm
Key Insights from README
• Requires Rhinoceros 7 and Grasshopper.
• GH file contains a Python node that either auto-loads PathSolver.py or refers to a manually-set filesystem path.
• Two solver variants available in the example GH file (switchable within Grasshopper).
Main Components
a. Rhino 7 Environment
b. Grasshopper Plugin (GH Canvas)
c. PathSolver_ex.gh Definition
d. Python Script Component (in GH)
e. External PathSolver_PY/PathSolver.py Module
f. Input Geometry & Parameters (user inputs on GH sliders, surfaces)
g. Output Geometry (points/curves rendered in Rhino viewport)
Relationships and Data Flow
1) User opens Rhino → Grasshopper → loads PathSolver_ex.gh
2) GH definition exposes input sliders & surface geometry
3) GH Python Component loads PathSolver.py (auto or manual path)
4) Inputs passed into PathSolver.py’s solve() function
5) Algorithm computes point trajectories/paths
6) Results returned to GH component
7) GH outputs curves/points, Rhino renders them
Architectural Patterns & Principles
• Separation of concerns: UI and parameter wiring live in GH, core logic lives in an external Python module.
• Modularity: PathSolver.py can be versioned/tested independently of the GH file.
• Runtime plugin loading: Python component dynamically imports the module at script‐execution time.
Technologies & Dependencies
• RhinoCommon API (available in Grasshopper’s Python script component)
• Grasshopper 3D visual scripting environment
• Python 3.x (as bridged by GH’s IronPython/Python scripting node)