Clear Filters
Clear Filters

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

8 views (last 30 days)
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.

Answers (1)

chicken vector
chicken vector on 2 Jun 2023
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.
Arkaniva Sarkar
Arkaniva Sarkar on 2 Jun 2023
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
% where, size(TR.ConnectivityList,1) is always greater than 1000000
chicken vector
chicken vector on 2 Jun 2023
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.

Sign in to comment.




Community Treasure Hunt

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

Start Hunting!