Plotting a square circle on blocked Euler

I am creating a CAD type application on the basis of THREE, I can’t deal with a blocked plane.
Namely, I have a viewport that rotates in the x and y axis, all elements are grouped into three.js groups, they rotate correctly after clicking the left mouse button and holding the button, we drag the canvas on the canvas, it works correctly something like OrbitControl. Now I have the option to plot a quadratic and wheels.
So after pressing the square icon on the viewport I draw a square on a plane parallel to the monitor screen.
And it’s the same with the wheel and the line.
I could not cope with plotting on a plane parallel to the monitor but by turning the euler I did it both for the circle and for the square.
Now the next stage of creation is drawing a circle and a square on the locked plane what it means.
And when you press the lock icon, the application reads the rotation euler and saves it in a variable, then when drawing a circle or square, it takes the angle from the saved variable (Euler rotation angle) and draws it at the given rotation angle. Both the square and the circle are correctly drawn in my 0.00 Euler position, while every other tilt of the viewport plane causes the squares to be drawn incorrectly.
The application is available at
Please help !!!