{"record":{"id":"33579849bea0c75f","repo":"aosabook/500lines","slug":"unimplemented","errorCode":null,"errorMessage":"Unimplemented","messagePattern":"Unimplemented","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"incomplete/rasterizer/rasterizer/poly.py","lineNumber":52,"sourceCode":"def Rectangle(v1, v2, color=None):\n    return Quad([Vector(min(v1.x, v2.x), min(v1.y, v2.y)),\n                 Vector(max(v1.x, v2.x), min(v1.y, v2.y)),\n                 Vector(max(v1.x, v2.x), max(v1.y, v2.y)),\n                 Vector(min(v1.x, v2.x), max(v1.y, v2.y))],\n                color=color)\n\ndef LineSegment(v1, v2, thickness, color=None):\n    d = v2 - v1\n    d.x, d.y = -d.y, d.x\n    d *= thickness / d.length() / 2\n    return Quad([v1 + d, v1 - d, v2 - d, v2 + d], color=color)\n\n# A simple polygon\n# It will work by triangulating a polygon (via simple, slow ear-clipping)\n# and then rendering it by a CSG union of the triangles\nclass Poly(Shape):\n    def __init__(self, *args, **kwargs):\n        raise Exception(\"Unimplemented\")\n","sourceCodeStart":34,"sourceCodeEnd":53,"githubUrl":"https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/incomplete/rasterizer/rasterizer/poly.py#L34-L53","documentation":"Error \"Unimplemented\" thrown in aosabook/500lines.","triggerScenarios":"Thrown at incomplete/rasterizer/rasterizer/poly.py:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not instantiate Poly directly; it is a placeholder that raises on construction.","Implement the ear-clipping triangulation described in the comment, then render the union of triangles.","Meanwhile use the implemented shapes (ConvexPoly, Quad, Ellipse) instead of Poly."],"exampleFix":"ConvexPoly([Vector(0,0), Vector(1,0), Vector(0,1)])  # use a supported polygon class","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fba689d101eb5600f5c8f4d7fd79912498e950e2","analyzedAt":"2026-08-13T06:26:32.792Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}