[Proposal]: Open up Graphics backend and allow custom shapes, add support for multi-contour Path shape #7532
Replies: 6 comments
-
@bigtimebuddy @ivanpopelyshev Thoughts? |
Beta Was this translation helpful? Give feedback.
-
This is a little unclear what you're asking, there are a few ideas in here I don't understand the full scope of all of them. However, I don't have any problem with adjusting those backend/typing pieces you point out, like making a Shape interface, etc. Those seem pretty basic. As for your other ideas (adding Path, etc), I ask that you make small PRs so we can consider those things separately. |
Beta Was this translation helpful? Give feedback.
-
Thoughts: yeah, we have to do it, but what I recommend is to make another Graphics element. More advanced, more optimized. Dont touch what we have right now. |
Beta Was this translation helpful? Give feedback.
-
Then swap Graphics and new implementation in major version, like we did with Mesh in v5. |
Beta Was this translation helpful? Give feedback.
-
@ivanpopelyshev I disagree, because we won't be changing anything with the |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
When writing @pixi-essentials/svg's <path /> implementation, I had difficulty integrating my custom
Path
shape b/c:GraphicsGeometry#calculateBounds
)Shape
is not an interface, rather a union. I had to force castShape
intoPath
and vice versa.SHAPES
enum is not exported from @pixi/graphicsWe should standardize these "backend" pieces so that
Graphics
can properly be extended.Also, I was thinking of bringing in @pixi-essentials/svg's
Path
shape intoGraphics
. It supports multiple contours, and a fill-rule. Stroking is a bit complicated b/c I have to callbuildLine
on each contour (by overridingGraphicsGeometry#processLine
).It uses libtess for tessellation and is much more robust.
Unrelated Rant:
Graphics#currentPath
should actually be calledGraphics#currentPoly
. I literally named the path objectcurrentPath2
in @pixi-essentials/svg haha.You can see the implementation here:
Beta Was this translation helpful? Give feedback.
All reactions