DiscussionsIssue archiveOther usage issues

Archived discussion

Snap to midpoint

Other usage issuesWed, 06/25/2014 - 01:371 reply

Browse this forum
QuestionAuthor

Hello. Say I make an edge using e.g. BRepBuilderAPI_MakeEdge. I would like to have the mouse snap to the endpoints AND to the midpoint of this edge. How can I do this?

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

Hi John,

Tring to move cursor to those key points' GDI positions is not a good choice in my experience, you can try to change cursor type instead, such changing "Arrow" to "Point".
To catch those snapping message, you can use soft picking method. In your mouse moving procedure, transform all 3D key points to 2D GDI points (using OPenGL API), and try to find the nearest one ( under the threshold also), then change the cursor type.

Ding