ScratchData LogoScratchData
Back to ChromeCat_test's profile

Subtractive Triangle Fill v1

CHChromeCat_test•Created May 24, 2021
Subtractive Triangle Fill v1
36
27
254 views
View on Scratch

Instructions

The idea behind this is to draw a triangle by drawing a line which covers the triangle and lies on one edge. Then subtracting the overlap with two other lines. This means you can fill a triangle with 100% accuracy with just 3 lines. If you want to visually see how it calculates the subtractive lines see this Geogebra applet: https://www.geogebra.org/m/p2dantt5 For info on how the algorithm works please see inside.

Description

The maths was immensely difficult to figure out. You'll quickly notice this too if you read how it works or look at the code. -------------------- Known bugs ------------------- - Right angled triangles do not render properly, likely due to division by zero edge case. - sprite does not draw pen lines which go off the screen

Project Details

Project ID535147615
CreatedMay 24, 2021
Last ModifiedJuly 8, 2022
SharedJune 7, 2021
Visibilityvisible
CommentsAllowed