Decompose the Border Into Primitives
00:39 Its goal is to decompose the border into a relevant geometric primitive that you can draw. First, you locate the other corners of the current square’s border by translating the point that was provided to you as a function parameter.
01:03 Next, you create the four sides of the border by connecting the corners into lines accordingly. Once you have all the sides and corners, you can construct the polygon, polyline, or lines associated with the given border pattern.
01:37 As you may remember, there are sixteen unique patterns, which your function needs to recognize and map to the correct primitives. There’s only one pattern consisting of all four sides, which you can turn into a polygon.
Become a Member to join the conversation.