Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: restore the 2D triangle mesh domain #1354

Merged
merged 10 commits into from May 2, 2023
Merged

refactor: restore the 2D triangle mesh domain #1354

merged 10 commits into from May 2, 2023

Conversation

wodeni
Copy link
Member

@wodeni wodeni commented May 1, 2023

Description

#770 and #808 introduced the 2D triangle mesh domain but never tracked them in the registry. This PR restores this domain by fixing a few minor issues and add diagrams to the registry.

Implementation strategy and design decisions

  • attrRotation uses the top-left corner as the default rotation origin, which seems wrong. Changed so that the default is the shape's bbox center. Due to this fix, all diagrams that contain Text are impacted, since we include the rotation transformation even if the rotation is zero.
  • The font size settings in the original Style program seems a little off from the targeted diagrams. Not really sure if anything changed between feat: 2d triangle mesh domain #770 and now, as the system changed quite a bit, but I updated some stylings so they are a little closer.
  • Added mesh disjoint styling for angle-equivalence. The code remains commented out because it's blocked by Implement Style modules (imports and namespaces) #776, but here's a diagram with the block uncommented.
    image

Examples with steps to reproduce them

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have reviewed any generated registry diagram changes

Open questions

Questions that require more discussion or to be addressed in future development:

@wodeni wodeni marked this pull request as draft May 1, 2023 18:01
@cloudflare-pages
Copy link

cloudflare-pages bot commented May 1, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea93359
Status: ✅  Deploy successful!
Preview URL: https://dd092fc9.penrose-72l.pages.dev
Branch Preview URL: https://triangle-mesh.penrose-72l.pages.dev

View logs

@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Merging #1354 (ea93359) into main (2678139) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #1354   +/-   ##
=======================================
  Coverage   62.14%   62.14%           
=======================================
  Files          67       67           
  Lines        8557     8557           
  Branches     2050     2050           
=======================================
  Hits         5318     5318           
  Misses       3101     3101           
  Partials      138      138           
Impacted Files Coverage Δ
packages/core/src/renderer/AttrHelper.ts 48.36% <50.00%> (ø)

@github-actions
Copy link

github-actions bot commented May 2, 2023

± Registry diff

M	acquaintanceship-graph-simple-graph.svg
M	allShapes-allShapes.svg
A	angle-equivalence-triangle-mesh-2d.svg
M	arrowheads-arrowheads.svg
M	caffeine-structural-formula.svg
M	call-directed-graph-directed-multigraph.svg
M	call-undirected-graph-pseudograph.svg
M	center-shrink-circle-animation.svg
M	circle-example-euclidean.svg
M	closest-point-test-closest-point.svg
M	collinear-euclidean.svg
M	communications-network-one-way-links-graph-simple-directed-graph.svg
M	computer-network-diagnostic-links-graph-pseudograph.svg
M	computer-network-graph-simple-graph.svg
M	computer-network-multiple-links-graph-pseudograph.svg
M	computer-network-multiple-one-way-links-graph-directed-multigraph.svg
A	concyclic-pair-triangle-mesh-2d.svg
M	congruent-triangles-euclidean.svg
M	continuousmap-continuousmap.svg
A	cotan-formula-triangle-mesh-2d.svg
M	cube-graphs-simple-graph.svg
M	cubic-bezier-cubic-bezier.svg
M	glutamine-molecules-basic.svg
M	half-adder-distinctive-shape.svg
A	halfedge-mesh-triangle-mesh-2d.svg
M	hypercube-network-graph-simple-graph.svg
M	hypergraph-hypergraph.svg
M	incenter-triangle-euclidean.svg
M	influence-graph-simple-directed-graph.svg
M	jobs-trained-matching-graph-simple-graph.svg
M	jobs-trained-no-matching-graph-simple-graph.svg
M	lagrange-bases-lagrange-bases.svg
M	linear-array-graph-simple-graph.svg
M	lines-around-rect-rect-line-dist.svg
M	matrix-matrix-addition-matrix-ops.svg
M	matrix-matrix-division-elementwise-matrix-ops.svg
M	matrix-matrix-multiplication-elementwise-matrix-ops.svg
M	matrix-matrix-multiplication-matrix-ops.svg
M	matrix-matrix-subtraction-matrix-ops.svg
M	matrix-transpose-matrix-ops.svg
M	matrix-vector-left-multiplication-matrix-ops.svg
M	matrix-vector-right-multiplication-matrix-ops.svg
M	mesh-network-graph-simple-graph.svg
M	midsegment-triangles-euclidean.svg
M	mobius-mobius.svg
M	module-dependency-graph-simple-directed-graph.svg
M	niche-overlap-graph-simple-graph.svg
M	nitricacid-lewis.svg
M	one-water-molecule-atoms-and-bonds.svg
M	parallel-lines-euclidean.svg
M	persistent-homology-persistent-homology.svg
M	precedence-graph-simple-directed-graph.svg
M	protein-interaction-graph-simple-graph.svg
M	quaternion-group-group-theory-cayley-graph.svg
M	quaternion-group-group-theory-multiplication-table.svg
A	relative-orientation-triangle-mesh-2d.svg
M	round-robin-graph-simple-directed-graph.svg
M	scalar-vector-division-matrix-ops.svg
M	scalar-vector-left-multiplication-matrix-ops.svg
M	scalar-vector-right-multiplication-matrix-ops.svg
M	siggraph-teaser-euclidean-teaser.svg
M	tree-tree.svg
M	tree-venn-3d.svg
M	tree-venn.svg
A	triangle-centers-triangle-mesh-2d.svg
M	two-triangles-triangle-mesh-3d.svg
M	two-vectors-perp-vectors-dashed.svg
M	union-graph-simple-graph.svg
M	vector-vector-addition-matrix-ops.svg
M	vector-vector-division-elementwise-matrix-ops.svg
M	vector-vector-multiplication-elementwise-matrix-ops.svg
M	vector-vector-outerproduct-matrix-ops.svg
M	vector-vector-subtraction-matrix-ops.svg
M	vector-wedge-exterior-algebra.svg
M	wet-floor-atoms-and-bonds.svg
M	word-cloud-example-word-cloud.svg
M	wos-laplace-estimator-walk-on-spheres.svg
M	wos-nested-estimator-walk-on-spheres.svg
M	wos-offcenter-estimator-walk-on-spheres.svg
M	wos-poisson-estimator-walk-on-spheres.svg

📊 Performance

Key

Note that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.

     0s   1s   2s   3s   4s   5s   6s   7s   8s   9s
     |    |    |    |    |    |    |    |    |    |
name ▝▀▀▀▀▀▀▀▀▀▀▀▚▄▄▄▄▄▄▄▄▄▞▀▀▀▀▀▀▀▀▀▀▀▀▚▄▄▄▄▄▄▄▄▄▖
      compilation labelling optimization rendering

Data

                                                                  0s   1s   2s   3s   4s   5s
                                                                  |    |    |    |    |    |
3d-projection-fake-3d-linear-algebra                              ▝▞▖
acquaintanceship-graph-simple-graph                               ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▞▀▀▀▀▀▀▀▚
allShapes-allShapes                                               ▝▞▄▖
angle-equivalence-triangle-mesh-2d                                ▝▀▚▀▚
arrowheads-arrowheads                                             ▝▞▖
caffeine-structural-formula                                       ▝▀▀▀▞▖
call-directed-graph-directed-multigraph                           ▝▀▀▀▀▀▚▀▚
call-undirected-graph-pseudograph                                 ▝▀▀▀▀▞▚
center-shrink-circle-animation                                    ▝▞▖
circle-example-euclidean                                          ▝▀▞▖
closest-point-test-closest-point                                  ▝▀▀▀▀▀▚▚
collinear-euclidean                                               ▝▀▞▖
communications-network-one-way-links-graph-simple-directed-graph  ▝▀▀▀▀▚▀▖
complete-bipartite-graphs-simple-graph                            ▝▀▀▀▀▀▀▀▀▀▀▀▀▚▀▀▖
complete-graphs-simple-graph                                      ▝▀▀▀▀▀▀▀▀▞▀▖
computer-network-diagnostic-links-graph-pseudograph               ▝▀▀▀▀▞▖
computer-network-graph-simple-graph                               ▝▀▀▚▚
computer-network-multiple-links-graph-pseudograph                 ▝▀▀▀▚▀▖
computer-network-multiple-one-way-links-graph-directed-multigraph ▝▀▀▀▀▀▚▀▖
concyclic-pair-triangle-mesh-2d                                   ▝▚▚
congruent-triangles-euclidean                                     ▝▀▀▞▖
continuousmap-continuousmap                                       ▝▞▖
cotan-formula-triangle-mesh-2d                                    ▝▀▞▖
cube-graphs-simple-graph                                          ▝▀▀▀▀▀▀▀▀▀▞▀▚
cubic-bezier-cubic-bezier                                         ▝▚▀▖
cycle-graphs-simple-graph                                         ▝▀▀▀▀▀▚▀▖
glutamine-molecules-basic                                         ▝▀▞▖
half-adder-distinctive-shape                                      ▝▚▚
halfedge-mesh-triangle-mesh-2d                                    ▝▀▞▖
hybrid-topology-graph-simple-graph                                ▝▀▚▚
hypercube-network-graph-simple-graph                              ▝▀▀▀▚▚
hypergraph-hypergraph                                             ▝▀▀▚▀▀▀▀▀▚
incenter-triangle-euclidean                                       ▝▀▞▖
influence-graph-simple-directed-graph                             ▝▀▚▚
jobs-trained-matching-graph-simple-graph                          ▝▀▀▀▞▚
jobs-trained-no-matching-graph-simple-graph                       ▝▀▀▚▚
lagrange-bases-lagrange-bases                                     ▝▞▖
linear-array-graph-simple-graph                                   ▝▀▀▞▖
lines-around-rect-rect-line-dist                                  ▝▚▚
matrix-matrix-addition-matrix-ops                                 ▝▚▚
matrix-matrix-division-elementwise-matrix-ops                     ▝▚▚
matrix-matrix-multiplication-elementwise-matrix-ops               ▝▚▚
matrix-matrix-multiplication-matrix-ops                           ▝▚▚
matrix-matrix-subtraction-matrix-ops                              ▝▚▚
matrix-transpose-matrix-ops                                       ▝▚▚
matrix-vector-left-multiplication-matrix-ops                      ▝▚▚
matrix-vector-right-multiplication-matrix-ops                     ▝▚▚
mesh-network-graph-simple-graph                                   ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▞▀▀▀▀▀▀▀▀▀▀▚
midsegment-triangles-euclidean                                    ▝▀▞▖
mobius-mobius                                                     ▝▚▚
module-dependency-graph-simple-directed-graph                     ▝▀▀▀▞▖
niche-overlap-graph-simple-graph                                  ▝▀▀▀▀▚▚
nitricacid-lewis                                                  ▝▀▀▞▀▖
non-convex-non-convex                                             ▝▚▚
one-water-molecule-atoms-and-bonds                                ▝▞▖
parallel-lines-euclidean                                          ▝▀▞▖
persistent-homology-persistent-homology                           ▝▀▚▀▀▀▀▀▚▖
points-around-line-shape-distance                                 ▝▀▞▖
points-around-polyline-shape-distance                             ▝▀▚▚
points-around-star-shape-distance                                 ▝▀▀▚▚
precedence-graph-simple-directed-graph                            ▝▀▀▚▚
protein-interaction-graph-simple-graph                            ▝▀▀▀▀▀▀▚▀▀▖
quaternion-group-group-theory-cayley-graph                        ▝▀▚▚
quaternion-group-group-theory-multiplication-table                ▝▀▀▀▄▚
relative-orientation-triangle-mesh-2d                             ▝▚▚
ring-topology-graph-simple-graph                                  ▝▀▞▖
round-robin-graph-simple-directed-graph                           ▝▀▀▀▚▚
scalar-vector-division-matrix-ops                                 ▝▚▚
scalar-vector-left-multiplication-matrix-ops                      ▝▚▚
scalar-vector-right-multiplication-matrix-ops                     ▝▞▖
siggraph-teaser-euclidean-teaser                                  ▝▀▞▖
star-topology-graph-simple-graph                                  ▝▀▚▚
tree-tree                                                         ▝▚▚
tree-venn                                                         ▝▀▚▚
tree-venn-3d                                                      ▝▀▞▄▖
triangle-centers-triangle-mesh-2d                                 ▝▚▚
two-triangles-triangle-mesh-3d                                    ▝▚▚
two-vectors-perp-vectors-dashed                                   ▝▞▖
union-graph-simple-graph                                          ▝▀▀▚▚
vector-vector-addition-matrix-ops                                 ▝▚▚
vector-vector-division-elementwise-matrix-ops                     ▝▚▚
vector-vector-multiplication-elementwise-matrix-ops               ▝▚▚
vector-vector-outerproduct-matrix-ops                             ▝▚▚
vector-vector-subtraction-matrix-ops                              ▝▚▚
vector-wedge-exterior-algebra                                     ▝▞▖
wet-floor-atoms-and-bonds                                         ▝▚▀▖
wheel-graphs-simple-graph                                         ▝▀▀▀▀▀▀▀▀▀▀▞▀▖
word-cloud-example-word-cloud                                     ▝▀▞▖
wos-laplace-estimator-walk-on-spheres                             ▝▀▚▚
wos-nested-estimator-walk-on-spheres                              ▝▀▀▞▚
wos-offcenter-estimator-walk-on-spheres                           ▝▀▞▚
wos-poisson-estimator-walk-on-spheres                             ▝▀▞▚

@wodeni wodeni marked this pull request as ready for review May 2, 2023 19:53
@wodeni wodeni requested a review from keenancrane May 2, 2023 19:53
@wodeni wodeni requested a review from samestep May 2, 2023 19:55
Copy link
Collaborator

@samestep samestep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks so much for doing this! A lot of the diagrams look really nice 😃

(although I guess we still haven't figured out the dark-mode problem haha)

@wodeni wodeni merged commit a09d193 into main May 2, 2023
10 checks passed
@wodeni wodeni deleted the triangle-mesh branch May 2, 2023 20:21
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.

None yet

2 participants