Skip to content

murmurations-dev/qdregion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QDRegion

QuickDraw-inspired region boolean operations rendered with SwiftUI’s Canvas and GraphicsContext.

This project explores how to model and draw region operations such as union, intersection, difference, and xor using modern SwiftUI APIs, while acknowledging the current limitations around true vector boolean path composition.

Features

  • Enum-based region model: compose regions with .primitive(Path), .union, .intersection, .difference, .xor.
  • Rendering via Canvas and GraphicsContext.
  • Layered clipping approach to visually approximate boolean operations.
  • Clear separation between “drawing” and “materializing” a path.

Why

Classic QuickDraw regions supported boolean composition of shapes. SwiftUI’s Path does not yet expose full geometric boolean operations. This repo demonstrates:

  • How to represent region expressions declaratively.
  • How to render those expressions in SwiftUI using layered clips.
  • Where the current API boundaries are and how to bridge beyond them if needed.

How it works

QDRegionView accepts a QDRegion.Op and draws it inside a Canvas.

  • Primitive
    • Directly filled with the current foreground style:
    context.fill(path, with: .foreground)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages