How to improve plotting speed of large STL models using patch?

14 次查看(过去 30 天)
I am developing an application in appdesigner where I'm dealing with large STL models with more than 1 million faces in each model. However, when I'm trying to plot one or more models together using Patch, it takes quite a long time to plot. Is there any method to increase the speed of plotting?
I'm using a system with i7 8th gen processor and Nvidia MX150 2GB graphics card.

回答(1 个)

chicken vector
chicken vector 2023-6-2
To really help you would be convenient to see what you are dealing with and what have you tried, but one thing I can say for sure, MATLAB is not very good when dealing with rendered images, and the best way to achieve high rendering speeds is to change programming language.
If you really ahve to do this on MATLAB you can try this FEX function that reads STL files and gives you the output as patches in MATLAB.
To speed things up you can build your database in a .mat file with all the patch outputs of your STL models.
  2 个评论
Arkaniva Sarkar
Arkaniva Sarkar 2023-6-2
Reading the STL doesn't take time, but plotting does. I'm using the following code to plot:
for i = 1:length(full_path_of_stl_models) %array containing full path of the stl models
TR = stlread(full_path_of_stl_models(i)) %reading stl
plt(i) = patch('Faces',TR.ConnectivityList,'Vertices',TR.Points) %plotting
end
% where, size(TR.ConnectivityList,1) is always greater than 1000000
chicken vector
chicken vector 2023-6-2
Maybe someone else will be able to help you more but Matlab is not built for this so, in the end, I don't think you can obtain what you are looking for. Good luck nontheless.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by