具有闭合多边形和岛屿的折线偏移 [英] Polyline offset with closed polygon and islands

查看:21
本文介绍了具有闭合多边形和岛屿的折线偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组未排序的线段,彼此之间没有任何绑定.每条线用 2 个点 (x,y) 描述.我可以搜索具有相同点的线,这意味着它们应该相连.

I have unsorted set of line segments without any binding to each other. Each line described with 2 points (x,y). I can search for lines with the same points, which means they should be connected.

每条线都有一个粗细属性.我需要将每条路径偏移这个厚度,并创建 4 个点来描述最终的 plygon(对于每条线).

Every line have a thickness attribute. I need to offset each path by this thickness, and create 4 points describing the final plygon (for each line).

截图 1

现在我需要改进它以正确处理角(连接).但不知道该怎么做.

now I need to refine it to handle corners (joins) correctly. but have no idea how to do it.

预期结果:截图 2

推荐答案

参见 此处 了解使用多边形的骨架偏移多边形的一种方法(这就是您在此处尝试执行的操作).

See here for one method of offsetting a polygon using it's skeleton (which is what you are trying to do here).

这篇关于具有闭合多边形和岛屿的折线偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆