Conversation
Will investigate this later
There was a problem hiding this comment.
Pull request overview
This PR implements crown shape envelopes based on the Weber and Penn paper on tree generation, adding parametric control over branch length and angles based on tree height.
Changes:
- Added crown shape functionality with 8 shape types (Conical, Spherical, Hemispherical, Cylindrical, Tapered Cylindrical, Flame, Inverse Conical, Tend Flame)
- Implemented viewport visualization of crown shape envelopes using Blender's GPU drawing API
- Refactored BranchFunction to use parameter groupings (SplitParams, GravityParams, DistributionParams, CrownParams) instead of flat member variables
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python_classes/viewport/shape_formulas.py | Core math implementation for crown shape calculations, ported from C++ |
| python_classes/viewport/crown_shape_drawer.py | Blender viewport drawing handler for visualizing crown envelopes |
| python_classes/viewport/init.py | Module initialization for viewport functionality |
| python_classes/nodes/tree_function_nodes/branch_node.py | Added crown shape UI controls and nested parameter mapping |
| python_classes/init.py | Registered viewport module in plugin lifecycle |
| m_tree/source/tree_functions/CrownShape.hpp | C++ implementation of crown shape math and parameter structures |
| m_tree/source/tree_functions/BranchFunction.hpp | Refactored to use parameter groupings and added crown support |
| m_tree/source/tree_functions/BranchFunction.cpp | Applied crown shape modifiers to branch generation logic |
| m_tree/source/tree_functions/base_types/TreeFunction.hpp | Added virtual destructor |
| m_tree/source/meshers/base_types/TreeMesher.hpp | Added virtual destructor |
| m_tree/python_bindings/main.cpp | Exposed crown shape enums and parameter structs to Python |
| pyproject.toml, m_tree/pyproject.toml, blender_manifest.toml, VERSION | Version bumped from 5.2.0 to 5.3.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implementation of the crown shape from the paper by Webber and Penn paper (https://courses.cs.duke.edu/cps124/fall01/resources/p119-weber.pdf) on tree generation.
This pull request introduces a major new feature: customizable crown shapes for tree generation, based on botanical research, allowing users to create more realistic and varied tree silhouettes. The changes include both user-facing documentation and significant refactoring of the codebase to group branch parameters and support the new crown shape functionality.
Crown Shape Feature:
CrownShapeenum,CrownParamsstruct, and integration into theBranchFunctionworkflow. [1] [2] [3] [4] [5]crown_shape_guide.mdexplaining how to use crown shapes, available options, formulas, and tips for realistic results. [1] [2]Parameter Refactoring:
BranchFunctionparameters: grouped related parameters into structs (SplitParams,GravityParams,DistributionParams,CrownParams) and updated Python bindings and C++ code to use these groupings for clarity and extensibility. [1] [2] [3] [4] [5] [6] [7] [8] [9]Version Updates:
5.3.0inVERSION,blender_manifest.toml, andm_tree/pyproject.tomlto reflect the new feature release. [1] [2] [3]Technical Improvements:
TreeMesherfor proper cleanup in derived classes.These changes make it easier for users to generate a wide variety of realistic tree forms and for developers to extend the codebase with additional biologically-inspired features in the future.