Problem in “combination of grids – the code”

I tried to follow Eric (see his comments on “dualization method for the Stampfli tiling“). But the program crashed sometimes because it generated grid lines with endpoints that are both the same and length equal to zero. There seems to be a bug in “combination of grids – the code“.

I could not find the bug but I patched the problem, see my comment in “combination of grids – the code“. Make shure to use this new patched version. This code is at the heart of the method. Unfortunately, apart from this bug it is a numerical nightmare too. I am happy when I get results and I am glad that my life does not depend on this code.

Note added the 19th november:

One might try to improve the method addGridLine in “class Grid – the code” to be able to directly generate combined grids instead of making several grids and combining them afterwards. It should first check if a new grid line comes too close to an already existing grid point. Then this point would cut the line into two segments being one endpoint of each segment. These line segments would not intersect with grid lines that end at the same point. Intersections with other grid lines are still possible. Intersection points cut them into even smaller segments.

Note that this causes a new problem because the direction of the grid lines are slightly changed. The topological structure can still be found as before but the direction of the dual lines cannot be got anymore from the grid lines. Thus we have now to store their unperturbed direction, changing the class Lines. But going a bit further this would also make it possible to morph the tilings, such as in “morphing the tilings of octagons and squares“.

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: Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.