Programmatically finding faces, edges, etc for an imported geometry
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Is it possible to identify, based on location, faces of an imported geometry in the pde toolbox? Without looking at the plot visually.
0 Kommentare
Akzeptierte Antwort
Jack
am 9 Mär. 2025
Hey Jasdeep,
Yes, you can programmatically find faces, edges, and vertices of an imported geometry in the PDE Toolbox using the findFaces and findEdges functions along with geometric queries.
Finding Faces Based on Location
If your geometry is stored in model.Geometry, you can use findFaces to locate faces that contain a specific point:
model = createpde();
importGeometry(model, 'your_geometry.stl'); % Import your file
% Example: Find face containing a point (x, y, z)
queryPoint = [1, 2, 3]; % Modify as needed
faceID = findFaces(model.Geometry, 'Point', queryPoint);
disp(['Face ID at location: ', num2str(faceID)]);
Finding Edges Based on Location
To get edges near a specific location, use findEdges:
edgeID = findEdges(model.Geometry, 'NearestPoint', queryPoint);
disp(['Edge ID near location: ', num2str(edgeID)]);
Finding Face IDs Without Visual Inspection
If you need to check all faces and their approximate locations:
numFaces = model.Geometry.NumFaces;
for i = 1:numFaces
disp(['Face ', num2str(i), ' centroid: ', num2str(centroid(model.Geometry, i))]);
end
This should let you programmatically identify faces and edges without manually checking the plot.
Follow me so you can message me anytime with future MATLAB questions. If this helps, please accept the answer as well.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!