Closed Rewasvat closed 1 month ago
Hello! I just added bindings for add_concave_poly_filled in this commit: https://github.com/pthom/imgui_bundle/commit/e5375f22fc722a86af9e3f17fbcc9607d18c0bb4
Wheels are being built and should be available here in a few hours: https://github.com/pthom/imgui_bundle/actions/runs/9172317864
Example usage:
from imgui_bundle import imgui, hello_imgui, ImVec2, ImVec4
def gui():
imgui.text("Hello, world!")
imgui.get_window_draw_list().add_concave_poly_filled(
[
ImVec2(0, 0),
ImVec2(100, 0),
ImVec2(200, 100),
ImVec2(300, 0),
ImVec2(400, 0),
ImVec2(400, 100),
ImVec2(300, 200),
ImVec2(400, 300),
ImVec2(400, 400),
ImVec2(300, 400),
ImVec2(200, 300),
ImVec2(100, 400),
ImVec2(0, 400),
ImVec2(0, 300),
ImVec2(100, 200),
ImVec2(0, 100),
],
imgui.color_convert_float4_to_u32(ImVec4(0, 1, 0, 1)),
)
def main():
hello_imgui.run(gui)
if __name__ == "__main__":
main()
That was fast, thanks!
Seeing the commit diff I thought path_fill_concave
wasn't binded, but I finally got around downloading the new wheel you built and path_fill_concave
is there.
Tested it out here and it's working. Thanks again =)
Thanks for keeping me informed.
I have to do some custom rendering, and had to draw a concave polygon.
Checking your Imgui Manual in the custom rendering example, it shows its possible.
However I'm using in python, and the
path_fill_concave
/add_concave_poly_filled
that exist (with their proper names) in C++ don't exist in the python bindings.Is there any way I can do this with the python bindings? Or was there some reason to not bind the concave functions?
I know I can split the poly into several convex ones and draw those, but it would be much simpler if I could just draw the concave poly directly.