Open hooyuser opened 1 month ago
This is planned, but doing this for non-rectangular regions is not trivial.
I guess you mean path-clipping (boolean operations on paths)?
Thank you for your quick response!
Yes, I was referring to path-clipping similar to what is shown in the examples on this TikZ page. However, even just implementing clipping for rectangular regions will help a lot for my current needs.
Could you please elaborate on whether it's possible to set up a rectangular clipping region for groups with the current version of CeTZ? Any guidance or workarounds would also be greatly appreciated.
With the current version of cetz it is possible but not implemented. You have to implement some form of path clipping. There is a closed PR #535 that implements this by using a wasm library.
Given the complexities of general clipping, I'm curious to learn how to implement rectangular clipping first. Could you provide some guidance or hints?
It’s a pity about the licensing issues that led to the closure of PR #535, especially considering the effort that must have gone into it. While I haven’t looked into this extensively, a preliminary search suggested that there may be some other suitable path-clipping libraries like Clipper2 or Graphite compatible with LGPL. I thought this might be worth mentioning for future considerations.
Hi, I was wondering if there is a possibility to implement clipping regions for groups, similar to how it's handled in TikZ. In TikZ, we can define a clipping path within a scope to constrain the visible area of contained elements, as demonstrated below:
Would it be possible to introduce a similar feature for groups in CeTZ, allowing users to define clipping regions that limit rendering to specified boundaries? This feature would be incredibly helpful for complex diagrams where elements outside a certain area need to be hidden.