UPDATE: I have improved on this filler at https://scratch.mit.edu/projects/106065472/ . Click the flag to spawn a random quad, and drag the dots to change it. For some reason there's a bug for the filler for some concaves. 8/4/15:Added a filler for most/all concaves and for all self-intersecting ones. Also added some more settings 8/3/15:Added a filler for some concaves 8/2/15:Added a filler for probably most/all convex quads 7/31/15:Fixed another bug 7/28/15: Added a setting to verify whether or not a random quad should be spawned when the green flag is clicked. Press space to show and hide settings. 7/27/15: Added second triangle for most quads and corrected a bug
This breaks up the quadrilateral into (a) triangle(s), where one side of the triangle is horizontal, and this is for filling in the quadrilateral using only horizontal lines, so no lines overlap, to get a uniformly translucent quad. So far I've done the first triangle. Crossing quadrilaterals are easy-all you need to do is to find the intersection of the crossing sides, and then you fill two triangles that are on the points of the quadrilateral, and the intersection point of the crossing sides. The inner loop needs a lot of if statements to check for concave quads, and knowing how to draw the inner triangle depending on which vertex is concave.