cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
733 stars 34 forks source link

debug: Tag debug shapes #593

Open johannes-wolf opened 1 month ago

johannes-wolf commented 1 month ago

Tag debug paths as such and skip them in merge-path.

Debug shapes bring other problems, maybe we should remove the feature or remove documentation about it.

Fixes #575

fenjalien commented 1 month ago

This is would also resolve #463 if you used the ignore key instead

johannes-wolf commented 1 month ago

They are different. Marks must be considered for bbox calculation and intersection (?), debug shapes not. Although, this is not yet implemented in this PR.

fenjalien commented 1 month ago

I don't think marks should be considered for intersections and would they be big enough to really count towards a bounding box?

Besides that, if we do have separate keys for debug, marks, hidden and ignore, would there be a way to combine them into one field? Maybe a "type" or "class" key that holds "debug" or "mark", it could even be an array to hold multiple if needed. It could even be a bytefield... We'll be needing something similar for modifiers anyway.

johannes-wolf commented 1 month ago

I don't think marks should be considered for intersections and would they be big enough to really count towards a bounding box?

Besides that, if we do have separate keys for debug, marks, hidden and ignore, would there be a way to combine them into one field? Maybe a "type" or "class" key that holds "debug" or "mark", it could even be an array to hold multiple if needed. It could even be a bytefield... We'll be needing something similar for modifiers anyway.

Yes, I think some kind of "class" is good. We could then provide a function for filtering out certain elements. Maybe just a tags list of strings/ints?

fenjalien commented 1 month ago

If we are still aiming for modifiers in 0.3.0, can this be blocked until modifiers are implemented? Then we can use whatever system works for modifiers.

johannes-wolf commented 1 month ago

If we are still aiming for modifiers in 0.3.0, can this be blocked until modifiers are implemented? Then we can use whatever system works for modifiers.

Yes. Although path-replacing modifiers need no special handling, as they just replace the original path.