-
Notifications
You must be signed in to change notification settings - Fork 16
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
Ability to create filled polygon #27
Comments
It isn't currently possible, sadly, without implementing your own custom Pipeline. I discovered that as well recently. Luckily, it's actually a pretty straightforward add, and I'm happy to undertake it. @cloudhead Would you be OK with a PR adding an enum option to If you have another idea for an approach I'd be happy to do that approach instead. |
I started trying to do this change, and the suggestion I had really isn't good at all. I would actually propose a different approach, but I haven't come up with a good design idea. One of the challenges is that Shape defines methods to alter stroke and fill on each of the types of shapes, and if you are looking to convert triangles from something like lyon into polygons, that's not exactly what you're looking for. I'm torn between a couple of different approaches to this and am open to other ideas. One approach that could work would be to define a CustomShape trait that could be added as another enum option on Shape. I'm hesitant to propose approaches that would switch Lastly, I've been thinking maybe a custom lyon-"optimized" Pipeline wouldn't be a bad approach to more complicated shape drawing -- and this final approach can be done as a separate crate. |
I actually had this planned a while ago, and was thinking of doing something like I think a separate pipeline is probably the way to go here, and you can then depend on |
I've published rgx-lyon, @frewsxcv, and in the examples folder there's an example using lyon's Path to render a triangle. I'm new to publishing, so if you have any feedback at all don't hesitate to file an issue over on that repo. Hope this helps! I think this issue still is a good one to keep open, as it might be worth having something built-in. |
Great! |
Hi! I'm interested in creating a filled in polygon from a series of lines. I noticed rgx has the ability to create lines, so I could create the outline of a polygon from a series of lines, but not sure about filling it in. Is this currently possible? If it's possible, I'm willing to add an example to the
examples/
folder to demonstrate it!The text was updated successfully, but these errors were encountered: