Export 3D MATLAB figure to EM Simulation Software (CST).
16 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Pratyush Swain
2024-3-15
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Splines 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!