From fb27b4c46aeb289619db731599cfe06d00733d36 Mon Sep 17 00:00:00 2001 From: Folkert Kevelam Date: Thu, 28 Aug 2025 20:19:18 +0200 Subject: [PATCH] Fill out set based graphing --- data/penrose/set.domain | 2 ++ data/penrose/set.style | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/data/penrose/set.domain b/data/penrose/set.domain index 33d1bb8..c89fc96 100644 --- a/data/penrose/set.domain +++ b/data/penrose/set.domain @@ -1,3 +1,5 @@ type Set predicate SubSet(Set s1, Set s2) +predicate Disjoint(Set s1, Set s2) +predicate Union(Set s1, Set s2) diff --git a/data/penrose/set.style b/data/penrose/set.style index d474111..d52e988 100644 --- a/data/penrose/set.style +++ b/data/penrose/set.style @@ -1,17 +1,37 @@ canvas { - width = 100 - height = 100 + width = 500 + height = 500 } forall Set A; Set B where SubSet(A, B) { + ensure disjoint(B.text, A.icon, 10.0) ensure contains(A.icon, B.icon, 5.0) - A.icon above B.icon + layer A.icon above B.icon +} + +forall Set A; Set B +where Disjoint(A, B) { + ensure disjoint(A.icon, B.icon) +} + +forall Set A; Set B +where Union(A,B) { + ensure overlapping(A.icon, B.icon) + ensure disjoint(A.text, B.icon) + ensure disjoint(B.text, A.icon) } forall Set x { - x.icon = Circle { + shape x.icon = Circle { strokeWidth : 0.0 } - ensure x.icon.r > 25 + shape x.text = Equation { + string : x.label + fontSize : "32px" + } + ensure contains(x.icon, x.text) + encourage norm(x.text.center - x.icon.center) == 0 + layer x.text above x.icon + ensure x.icon.r > 25.0 }