Skip to content

Random non-intersecting walk through triangulation #57

Answered by gwlucastrig
micycle1 asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I made some progress. The main problem was in the way your code used getForward() in the do-while loop. A lesser problem was in your post loop test where you checked for attempts>50 it should have been attempts == 50. I also had to add some checks for "ghost" vertices (the null vertex) for cases where the pinwheel would rotate to an edge outside the tin... When I designed the pinwheel, I debated about whether it should do that, but decided that I needed to capability for other purposes.

Here's my code:

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
imp…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@micycle1
Comment options

Answer selected by micycle1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants