Luna is an object-oriented, 2D vector drawing toolkit with multiple backends. It has been designed to simplify the procedural creation of figures, like the figure below:
The source code can be retrieved from the public repository.
This project was not finished and has been abandoned. It may be useful in its current state as a starting point, but it likely has large functionality gaps which prevent it from being generally useful.