Amy's Final Project

Code Requirements

1) parse svg file
1a) pick out the viewBox coords as the min and max x and y coords
1b) pick out the polyline points
2) set up the coordinate system - offset the y coords of the polyline points so that the increasing directions of the axes are up and to the right; taking care not the flip the shape
3) DEFER - assume points are given in the intended order - reorganize points so they are travelled in the clockwise direction
4) calculate m and b for each pair of points; this may require a special bit to indicate the case of a vertical line, where m is infinite
5) treating each pair of points as a vector, find the interior normal point for each vector
6) determine inequality which satisfies interior normal point
7) output a list of inequality equations

Ideally, these operations should be written as python functions so that it may be called by cam.py and further used for tool collision detection.

the code

Here it is, seg.py.

the output


diamond.svg


square.svg


overlay.svg


subtract.svg


edit