Export 3D MATLAB figure to EM Simulation Software (CST).
4 views (last 30 days)
Show older comments
Hello,
I would like to create a cone using a square mesh and export it to CST software. I am familiar with using the triangulation function to create an STL file for a triangular mesh, but I'm unsure how to proceed with a polygonal mesh. Could you please guide me on how to generate an OBJ file for a cone made of a square mesh that can be imported into CST software?
Here is a code for a cone I want to export:
clear all
clc
res=0.5;
x=-5:res:5;
y=-5:res:5;
Z0=10;
alpha=20;
[X,Y]=meshgrid(x,y);
R=sqrt(X.^2+Y.^2);
Z=Z0-R*cotd(alpha);
figure()
f=surf(X,Y,Z)
axis equal
Thank you in advance!
0 Comments
Answers (1)
Pratyush Swain
on 15 Mar 2024
Hi Michael,
Exporting 3D MATLAB Figure to the .obj file format is not directly supported.Please refer to this third-party library from FILE Exchange on MATLAB Central: https://www.mathworks.com/matlabcentral/fileexchange/27982-wavefront-obj-toolbox which has a function “write_wobj(OBJ,filename)” that can export 3D figure as an .obj file.
Additionally you can also refer to following resources:
1 - https://www.mathworks.com/matlabcentral/fileexchange/72906-save-wavefront-obj-files-simple-or-colour
2- https://www.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-write-ascii-or-binary-stl-files
Hope this helps.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!