This function removes triangles that won't appear in a specified rectangle.
The purpose is to reduce the number of triangles to subdivide if they won't be
seen in the final output. If a triangle is fully above, below, or to the side
of the rectangle defined by input parameters, then it is removed from the data set.
The parameters lower_x
with lower_y
are the bottom
left corner and upper_x
with upper_y
are the top right corner.
Please not this might not remove all triangles that won't be seen as some can
extend across the diagonals and be missed by this filtering.
clean(df, lower_x, lower_y, upper_x, upper_y)
df | A dataset of triangles |
---|---|
lower_x | x position of the bottom left corner |
lower_y | y position of the bottom left corner |
upper_x | x position of the top right corner |
upper_y | y position of the top right corner |
A data set of filtered triangles