If you want to make a 3D project, I highly recommend using the "Pen" Tool in the "Extensions" tab. feel free to use this code, although quite messy and unoptimised