Make vertices at intersections of two overlapping polygons

Let us know if you have a nice R.U.B.E script to share!
bvargish
Posts: 26
Joined: Fri Oct 02, 2015 4:17 pm

Re: Make vertices at intersections of two overlapping polygo

Post by bvargish »

Thanks again for your insight! As always, very helpful!

I was thinking I'd use an open loop for a static ground shape like the one below. I highlighted where the line would be. I could add points to close it up, but nothing will ever hit the bottom of the line so I figured less points would be better. As you can see, the tool I used in Flash is far from optimized! 13 polygons were used to create the ground when really all I need is a line!
Capture.PNG
Capture.PNG (117.33 KiB) Viewed 16951 times
As far as my plus shape question, I thought maybe the weld jointed together shapes would be more optimized from a performance standpoint because it looked like the merged shape had more polygons in it based on the faint lines that form a Z within it as below. I'm sure joints carry a little weight, though, so I'm guessing I'd be better off with the merged shape created by your script.
Capture2.PNG
Capture2.PNG (7.85 KiB) Viewed 16951 times
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Make vertices at intersections of two overlapping polygo

Post by iforce2d »

Yes, less polygons overall will give better performance. In a case like that you might want to keep the original two rectangles.
Post Reply