2D custom shape to 3d model

for my school project i want to make a drawing app in canvas with multiple fuctions, lines, shapes, etc., but all in black color so shapes cover each other. I have already made that, but here it stops. After drawing i want to extrude that custom shape from canvas and make 3D model so i can export it to .stl and 3d print it. Do you have any ideas how i can do that. I was thinking about using three.js. This app will be used to draw cake-topper or any other shape you want to 3d print. Thanks for replaying.