How to get selected faces in a plotted 3D geometry

조회 수: 21 (최근 30일)
Alexandre Piccini
Alexandre Piccini 2019년 6월 6일
댓글: Alexandre Piccini 2024년 4월 12일 13:59
Hello everyone.
I am coding a finite element method solver for my final project in engineering. I want to be able to select faces within a 3D geometry plotted to the user, more specifially in the mesh or maybe the originial geometry really. Think of the attached figure, but without the internal nodes being displayed, having patches filling the surfaces. The attached figure is still a preliminary figure for what's being done. I will still do some code to leave only the boundary nodes visible and yada yada.
Anyways, what would be enough for me is to be able to click on a patch at the figure window and have its id (or something equivalent) returned to a variable so I can keep track of the boundaries the user is selecting. Is there any method available to know which patch surface (or any other equivalent 3D surface) the user has selected? The same applies to boundary lines and points, but let's focus first on surfaces.
Thank you
Capturar.PNG
  댓글 수: 2
Xiwen
Xiwen 2024년 4월 8일 20:14
Hi, have you figure out this problem yet? I am looking for a solution. Thanks
Alexandre Piccini
Alexandre Piccini 2024년 4월 12일 13:59
@Xiwen You essentially have to use callbacks on the patch objects you create, which are functions you will embed into them. You can assign a behaviour that will be triggered by clicking on the patch (ButtonDownFcn), for instance. MATLAB being MATLAB, however, means you shouldn't get too excited adding a lot of functionality like that before things become really slow from the UI/UX perspective.
Do a Ctrl+F for "callback" on the page below:
https://www.mathworks.com/help/matlab/ref/matlab.graphics.primitive.patch-properties.html

댓글을 달려면 로그인하십시오.

답변 (1개)

darova
darova 2019년 6월 7일
Try to change
Untitled.png

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by