How do i merge 2 overlapping polygon points?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Oian

Hi all,

(Hopefully) simple question: How do i merge 2 overlapping polygon points?

As you can see, The Polygons in the middle are overlapping (100%). I want to merge those, so then if i drag them, both images/textures will be affected at the same time.

I´ve tried the Geometry Singleton with its merge_polygons function:

But there is a problem. The polygon attribute does not give the position, but their coordinates in the UV map (i think).

So, do you know any other way of achieving this? Thanks!

How were those polygons created? The vertex data assigned to a polygon can define the shape anywhere in space (simply via the coordinates). However, it’s also possible to create the vertex data based at some origin (likely 0,0) and then move the shape in space via either the offset property or the underlying transform’s position. Since your polygon data appears to be origin-based, I’d guess the positions are controlled by the vector found in one of the mentioned properties.

I’d assume you could add the appropriate vector value to each of the vertices and then use those modified vertices in the call to merge_polygons(). Assuming that works, you’d likely need to subtract that vector from the resulting merged polygon vertices when done.

That said, I’m really just guessing here… :slight_smile:

jgodfrey | 2023-02-11 00:38

Hi, these Polygons were created simply by creating a Polygon2D Node and using the in-editor polygon tools.

However i actually managed a workaround, where i just move all 4 overlapping points at the same time. Not the most optimal but it works for now!

Oian | 2023-02-11 09:57