折线抵消闭合的多边形和岛屿折线、多边形、岛屿

2023-09-09 21:18:28 作者:玛丽莲萌鹿⌒_⌒

予有未分类的组线段没有任何彼此结合。每行描述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).