Is it possible to draw partially filed polygons?
1 次查看(过去 30 天)
显示 更早的评论
Anybody know of an easy way to draw partially filled polygons?
I'm working on a visual flow model for water district and need to show changing storage status of multiple reservoirs (both surface and groundwater). Each has a maximum capacity that would be represented by the full polygon. As the model goes into action and water gets drawn down, I'd like to represent current storage in each reservoir as a fill percentage of its full shape. Looking for an easy way to do this and not finding anything like it in the docs. Any ideas?
Thanks!
Mike
0 个评论
采纳的回答
Walter Roberson
2016-10-17
No, there is no routine provided for this. You need to calculate the height at which the fill percentage is reached, then create a new polygon and fill that.
Calculating the height at which the fill percentage is reached is not trivial for irregularly shaped polygons, especially if the polygons are not convex. For example,
| |
| |
| _____ |
| | |_____|
|_______|
the area on the right cannot fill until the water has raised to a certain level, but once it has raised to that level the water does not start rising again until the right fills up.
You can easily see that you could create two chambers of the same volume with a small gap connecting them near the top; if the fill is into one side only then "almost half full" for the reservoir as a whole would involve having one side completely filled while the other was empty.
If you were to restrict to convex polygons the calculations are easier but still need to proceed piecewise to each change in angle of the sides.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computational Geometry 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!