Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个“FlattenedPathGeometry”,我希望能够从基于特定 Point.Y 的路径中获取特定 point.X
基本上我只需要任何给定 Y 的 X 值。
提前感谢您的帮助。
GetFlatnedPathGeometry 给你一个多边形,所以基本上你必须考虑循环所有点并计算到你的点的最小距离。如果您可以对几何形状或您的点做出任何假设,则可以加快搜索速度。
例如,如果路径很长,您可以通过将形状与以您的点为中心的圆形/正方形相交来加快速度。这限制了要测试的形状的点数,但要注意交叉方法非常昂贵。您必须使用秒表测量性能,以了解您的情况更好。