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!