This function replaces loops through a data set of triangles, subdivides them, then updates the triangle ids and rhombus ids.

substitution(df)

Arguments

df

A data set of triangles

Value

A data set of subdivided triangles

Details

The data set has to have shape, point1_x, point1_y, point2_x, point2_y, point3_x, and point3_y. These columns will be updated. In addition to those, any column titles triangle or rhombus will be updated to serve as identification columns.

There is a section of this code that will snap the points to a grid in an attempt to fix numerical stability issues. There is potential for this to cause errors but almost always fixes more problems than it creates.

Examples

return_rhombus(0, 0, -90 + 36, 1, "T") %>% substitution()