Selecting point on centerline with patch object also being displayed on 3D plot (do not want to select point on patch)

6 views (last 30 days)
Hello,
I am plotting an STL as a patch and have a centerline of the STL object going through the patch. I would like to be able to click on a datapoint on the centerline while the STL patch is still being displayed. Ideally, I use the patch to help visually identify where I want to click a point on the centerline. Currently I'm trying to use 'datacursormode' to pick a point on a plot3 figure. Unfortunately, my current code lets me pick a point on both the centerline and the patch. I've tried various methods, including the setting of the centerline to a group with 'tag' but 'datacursormode' does not have a 'tag' property. Does anyone know how to click a datapoint on a line that goes through a patch object on a figure (without being able to select a point on the patch object)? My current code is as follows:
SomeFunction(STL) %Function plots stl to 3D plot as patch
abc = plot3(Centerline.x, Centerline.y, Centerline.z, 'ok', 'markersize', 2, 'tag','group1')
cursorMode = datacursormode(gcf);
hTarget = handle(abc);
hDatatip = cursorMode.createDatatip(hTarget);
set(cursorMode, 'enable','on')
pause
set(hDatatip,'Visible','off');

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!