Skip to content

Fix: remove gradient color artifacts by earcut-based triangulation#2403

Open
ZaildarAnmol wants to merge 1 commit into3b1b:masterfrom
ZaildarAnmol:fix/gradient-triangulation
Open

Fix: remove gradient color artifacts by earcut-based triangulation#2403
ZaildarAnmol wants to merge 1 commit into3b1b:masterfrom
ZaildarAnmol:fix/gradient-triangulation

Conversation

@ZaildarAnmol
Copy link
Copy Markdown

Problem: gradient fills show extra colors due to overlapping triangle fan.
Fix: non-overlapping triangulation using mapbox_earcut (outer ring + holes).
Fallback to previous triangulation if dependency absent.
Tested on the minimal scene from issue #2387/#2382 and several concave/holed shapes; artifacts are gone.
No API changes; performance comparable for typical glyphs/shapes.

Fixes #2387

…iangulation (3b1b#2387/3b1b#2382)

- Add triangulate_polygon_with_holes via mapbox_earcut
- Route VMobject triangulation to earcut for closed paths (fallback to old method if lib missing)
- Preserves existing shader pipeline; removes overlapping triangles causing color bleed
@Vegeorca
Copy link
Copy Markdown

Vegeorca commented Oct 30, 2025 via email

@mathsvisualization
Copy link
Copy Markdown
Contributor

Is he doing the right thing? I don't like it? If it works then also show its results. If I don't want to see this then you can use set_color_by_code like this.
Checkout this #2424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Workflow for Manual Version Bumps

3 participants