gpt4 book ai didi

c# - 将折线转换为具有宽度的多边形

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:07:46 25 4
gpt4 key购买 nike

当我尝试解析 Gerber RS274X 文件并将其转换为 GDSII 文件时,我遇到了某个问题。

If you stroke a solid circle along a certain path (a polyline), what you get is a solid shape, which can be subsequently converted to a closed polygon. My question would be is there a library or reliable algorithm to automate this process,where the input would be a string of points signifying the polyline, the output would be the resulting polygon.

下面是我上传的一张图片来解释我的问题。

enter image description here

最佳答案

可以通过在每个输入点周围的圆中放置所需数量的均匀分布的点,然后找到线段上每对圆的凸包来计算您寻找的形状。这些多边形的 union 将构成您想要的多边形。

a number of algorithms可以找到一组点的凸包,还有libraries which provide implementations .

关于c# - 将折线转换为具有宽度的多边形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19781481/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com