-
Hey, I'm currently trying to use manim to create animations for my upcoming seminar talk, where I talk about the packing anchored rectangles problem (https://doi.org/10.1007/s00493-015-3006-1). I'm completely new to manim and only used it for 3 days now, so I'm glad for any help. What can you see in my render: The actual thing is the coordinate system with the square and dots. In the packing anchored rectangles problem, you can 'draw' rectangles from each dot towards the top right, while staying inside the outer square and not overlapping with any other dot/rectangle. I want to render the greedy approach for this problem, which is starting from the top-right corner towards the bottom left and drawing the largest possible rectangle for each dot. PackingGreedyRectangles.mp4TL;DR: How can you determine disconnected shapes from a booleanOps object? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, I found a solution for myself, sleeping over it really does help! Well today I looked again and saw that at least for my orthogonal shapes each line consists of 4 points, not sure if this holds true for more complex shapes. Well, so iterated along pairs of 4 points to get all the lines, then connected the lines into shapes by checking when a closed loop occurs. Afterwards, I just check which of the shapes contains my starting point to get the shape that I need. Well then have a nice day everyone. |
Beta Was this translation helpful? Give feedback.
Ok, I found a solution for myself, sleeping over it really does help!
Yesterday I already read that the booleanOps are represented as Bézier curves. Didn't think hard enough about it...
Well today I looked again and saw that at least for my orthogonal shapes each line consists of 4 points, not sure if this holds true for more complex shapes. Well, so iterated along pairs of 4 points to get all the lines, then connected the lines into shapes by checking when a closed loop occurs. Afterwards, I just check which of the shapes contains my starting point to get the shape that I need.
Well then have a nice day everyone.