Skip to content

wip: explore face-centric vector network region model#644

Closed
softmarshmallow wants to merge 1 commit intocanaryfrom
main
Closed

wip: explore face-centric vector network region model#644
softmarshmallow wants to merge 1 commit intocanaryfrom
main

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

Summary

Exploratory PoC investigating a face-centric model for VectorNetworkRegion where fill_rule: FillRule is replaced by fill_mask: u64 — each loop owns one face, a bitmask marks which faces are filled, and fill rules become a codec at the import/export boundary.

  • fill_mask_poc.rs — isolated test file with the proposed model, nesting tree computation, fill-rule encode/decode codec, and Skia rendering
  • Rendered comparison PNGs — visual proof across 6 concentric-ring scenarios and 6 complex scenarios

Key findings

Scenario fill_rule (current) fill_mask (proposed) faces (ideal)
Concentric rings (simple) ✓ (some patterns need multi-region workaround) ✓ all patterns
Open + closed paths
Shared edges / T-junctions
Self-intersecting (Z, pentagram) ⚠ ambiguous ✗ (1 loop = 1 face) ✓ (needs planarization)
Overlapping circles ✗ double-paints ✗ nesting tree wrong ✓ (needs planarization)

Rendered outputs

fill_mask model (proposed) — concentric rings:
fill_mask

Current model — same scenarios (3 WRONG):
current

Current model — workaround with multi-region decomposition:
workaround

Complex scenarios — stress testing model boundaries:
complex

Design direction

The exploration points toward a face-centric model where:

  1. fill_rule is removed from the core struct (becomes SVG/Figma import/export codec)
  2. Faces are first-class entities alongside vertices and segments
  3. Auto-planarization on draw handles self-intersections
  4. Paint bucket maps directly to face.fills = paint (no decomposition puzzle)

See discussion thread for full analysis.

Test plan

  • cargo test -p cg --test fill_mask_poc — 10 tests pass (7 unit + 3 visual render)

🤖 Generated with Claude Code

Add static rendering for HTML form controls (<input>, <button>,
<textarea>, <select>, <fieldset>) in the htmlcss embed renderer.

Widgets are detected during the collect phase, sized with intrinsic
defaults during layout, and painted with generic platform chrome
(Chromium-style neutral appearance) during the paint phase.

Supported widget types:
- TextField (text, password, email, search, url, tel, number)
- Checkbox and Radio (checked/unchecked states)
- PushButton (<button>, <input type=submit/reset/button>)
- TextArea (with rows/cols sizing)
- Menulist (<select> with dropdown caret)
- SliderHorizontal (<input type=range>)
- ColorWell (<input type=color>)

The WidgetAppearance enum follows Chromium's ControlPart naming and
is designed to evolve toward interactive rendering by adding transient
state fields (focused, hovered, pressed) without structural refactoring.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b10a274-fa10-4b47-8c94-93bd7a51d0b0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 8, 2026 10:25am
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
code Ignored Ignored Apr 8, 2026 10:25am
legacy Ignored Ignored Apr 8, 2026 10:25am
backgrounds Skipped Skipped Apr 8, 2026 10:25am
blog Skipped Skipped Apr 8, 2026 10:25am
grida Skipped Skipped Apr 8, 2026 10:25am
viewer Skipped Skipped Apr 8, 2026 10:25am

Request Review

@vercel vercel Bot temporarily deployed to Preview – blog April 8, 2026 10:42 Inactive
@vercel vercel Bot temporarily deployed to Preview – backgrounds April 8, 2026 10:42 Inactive
@vercel vercel Bot temporarily deployed to Preview – viewer April 8, 2026 10:42 Inactive
@vercel vercel Bot temporarily deployed to Preview – grida April 8, 2026 10:42 Inactive
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.

1 participant