🤖 split poly meshes for mixed pattern and solid colors#5590
Draft
KristianHolme wants to merge 2 commits intoMakieOrg:masterfrom
Draft
🤖 split poly meshes for mixed pattern and solid colors#5590KristianHolme wants to merge 2 commits intoMakieOrg:masterfrom
KristianHolme wants to merge 2 commits intoMakieOrg:masterfrom
Conversation
- Poly updates mesh children when color mixes AbstractPattern with Colorants or uses multiple distinct patterns - Add mesh_vertex_paint_eltype and fix color_per_mesh for heterogeneous paint - Extend register_colormapping! for pattern arrays with clear errors for invalid mixes - Add isequal, hash, and == for ImagePattern and LinePattern - Add isolated tests for mesh vertex paint and barplot/poly resolve Made-with: Cursor
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
Fixes #5589
Summary
Improves handling of per-element color that mixes solid colors and Makie.Pattern / LinePattern, and multiple distinct patterns, for recipes that merge geometry into meshes (notably poly and barplot via the shared pipeline).
Motivation
A single merged mesh cannot combine vertex-style color with pattern texture in one draw the way the current pipeline expects. The same applies when several different patterns are used. Previously this showed up as awkward failures or inconsistent behavior; this change makes the behavior explicit and consistent.
Changes
Poly: Detect when mesh paint must be split (
poly_mesh_patterns_need_split), remove/rebuild mesh subplots when meshes / color update, optionally emit one mesh! per submesh when needed, and keep mesh children ordered before stroke (lines!).register_colormapping!: Handle color as an array of patterns (including all-pattern arrays with allequal / not), and error with clear messages when colorants and patterns are mixed in one array in contexts that still use a single merged mesh (e.g. raw mesh!).
color_per_mesh: Introducemesh_vertex_paint_eltypeso expanded per-vertex paint uses a concreteUnion{...}when types differ, instead of relying ontypejoinending up asAny.ImagePattern / LinePattern: Implement isequal, hash, and
==so pattern identity works with allequal and similar logic.Tests
New isolated tests in
Makie/test/isolated/mesh_vertex_colors.jl(included from runtests.jl):mesh_vertex_paint_eltype,color_per_mesh, and resolve smoke tests for barplot with patterns and mixed solid + pattern colors.Type of change
Delete options that do not apply:
Checklist
🤖 Written by Cursor