constctx = webvis.getContext();constviewer = ctx.getViewer();// Create a new 2D drawing by entering the drawing mode, interacting with the viewer and finally leaving the drawing mode:viewer.enterDrawingMode(); // after that you can draw on top of your 3D modelviewer.leaveDrawingMode(); // leaves the 2D drawing mode by committing the drawings and returns the processed 2D drawing data// You can also cancel any started drawing:viewer.enterDrawingMode();viewer.cancelDrawingMode(); // leaves the 2D drawing mode and discards all uncomitted drawings
The ViewerDrawingAPI provides basic functionalities to control the 2D drawing mode and the processed output.
See the ViewerDrawingProcessOptions for the various configuration options for creating a drawing.