converting 3-d geometric shapes to pde.DiscreteGeometry class

2 views (last 30 days)
Is that possible to draw 3-d geometric shapes (paraboloid for example) using surf or plot and convert them to pde.DiscreteGeometry class?

Answers (1)

akshatsood
akshatsood on 28 Aug 2023
Edited: akshatsood on 12 Jan 2024
Hi Mohamed,
I understand that you wish to plot 3d geometric shapes using surf or plot and convert to pde.DiscreteGeometry class. Given below is an example code to plot a paraboloid using the surf function.
% create a 3D sphere
[X, Y, Z] = sphere;
% plot the sphere
figure;
surfObj = surf(X, Y, Z);
axis equal;
% Add labels and a title
xlabel('X-axis');
ylabel('Y-axis');
zlabel('Z-axis');
title('3D Sphere');
In respone to your question, you can leverage surf2stl to write STL file from surface data (via passing the "surfObj" to the function). Once you have the STL file, you can use the importGeometry function from the Partial Differential Equations toolbox to create the geometry object.
I hope this helps.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!