class Grid

These objects can contain the points, lines and polygons of a tiling in “gridPoints”, “gridLines” and “gridPolygons” as well as the points, lines and polygons of its dual in “dualPoints”, “dualLines” and “dualPolygons”. Often they contain only points and lines of a tiling and the other data is left empty. Several such tilings are then put together using a procedure not contained here.

An important method is “addGridLine(a,b)”, where a and b are vectors for the endpoints of a line. These vectors are translated and rotated. Thus, we can for example easily generate two hexagon grids with different orientation. Then points at these places are looked up or created in “gridPoints”. A new line is finally created for “gridLines” and put in the list of connections of the endpoints.

Finally, “makeDual()” is very important. It creates the dual tiling.

This entry was posted in programming and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s