I'm a newbie to this forum and more or less to OpenCascade as well.
I'm working on a university project which aims to develop a basic CAD module as a preprocessor for a simulation environment. At this point we are able to draw points and lines and we are in a phase to start implementing some snapping algorithms.
I already know the code of Sketcher (developed by Sergei Maslov) which has some sort of Snapping but I thought I want to do something else.
My problem is: during sketching, and if snapping is activated, I want to snap to a point. So whenever I move the mouse I say:
I call the DetectedInteractive function, which returns me the AIS_Point, over which the mouse is. I convert this point to a Geom_CartesianPoint and then hand it to the algorithm that creates the line. But for some reason the created line (neither the starting nor the endpoint) would not snap to the point which was downcasted from the detected AIS_Point. It seems that if the mouse is over the sensitive area of the point, it is stuck there, and do not want to give the coordinates of the point, but the coordinates of the point where it touched the area... I can even show this: if you modify the code: