Revamp tree support: anatomically-correct trunk → branch → twig structure at ≤45° with circular cross-sections#172
Conversation
…ch/twig structure Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
|
This is a fantastic start @copilot, we are definitely on the right track here, the supports actually look like real trees now! However, many issues still remain:
More suggestions to come but I think two at a time is enough for now. |
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Both changes are in commit Varying size by type — three radius multipliers replace the old fixed constant:
Circular O + diagonal X shape —
Example output for a trunk node (nozzle = 0.4 mm, radius = 1.2 mm): G0 X1.2 Y0 Z1 F9000 ; travel to circle start (3 o'clock)
G1 X1.039 Y0.6 Z1 E0.017 F900 ; circle segment 1
G1 X0.6 Y1.039 Z1 E0.033 F900 ; …
...
G1 X1.2 Y0 Z1 E0.198 F900 ; circle closes at start
G0 X-0.849 Y-0.849 Z1 F9000 ; travel to X arm start
G1 X0.849 Y0.849 Z1 E0.262 F900 ; X arm 1
G0 X-0.849 Y0.849 Z1 F9000 ; travel to X arm 2 start
G1 X0.849 Y-0.849 Z1 E0.326 F900 ; X arm 2 |
There was a problem hiding this comment.
Pull request overview
This PR overhauls the tree support generator to produce a converging trunk→branch→twig segment structure (≤45° target) and renders each node as a circular “O + X” cross-section, replacing the previous grid-like behavior so tree supports look and behave distinctly from normal supports.
Changes:
- Replaced trunk-grid / line-grouping approach with a precomputed segment tree (
buildTreeStructure) + per-layer segment intersection rendering (generateTreePattern). - Added node rendering as circular perimeter + diagonal X infill (
renderNodeAt) and point convergence viadeduplicatePoints. - Updated/expanded tree support tests and refreshed LFS G-code fixtures for tree-support examples.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/slicer/support/tree/tree.coffee |
Implements precomputed trunk/branch/twig segments and per-layer node rendering (O+X circle nodes). |
src/slicer/support/tree/tree.test.coffee |
Replaces old trunk-grid/line-grouping tests with new structure/rendering/deduplication tests and cache assertions. |
resources/gcode/support/tree/dome/upright.gcode |
Updates stored tree-support example output (LFS pointer). |
resources/gcode/support/tree/dome/sideways-everywhere.gcode |
Updates stored tree-support example output (LFS pointer). |
resources/gcode/support/tree/arch/upright.gcode |
Updates stored tree-support example output (LFS pointer). |
resources/gcode/support/tree/arch/sideways-everywhere.gcode |
Updates stored tree-support example output (LFS pointer). |
|
@copilot apply changes based on the comments in this thread |
…conditional test assertion Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
All four issues from that review thread are addressed in commit
|
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.