Error using patch Value must be of numeric type and greater than 1.
Show older comments
Hi, i need to figure some stl files and it's giving me an error
Error using patch
Value must be of numeric type and greater than 1.
Error in rysujPATCH (line 63)
czlon11=patch('Faces',C11.Faces,'Vertices',C11.Vertices,'FaceColor',C11.FaceColor);
matrixes are included
this is the code
%%
% Rysuj czlony
P2=C2.Vertices';
P3=C3.Vertices';
% ustawianie czlonow
P2=F12(0)*[P2; ones(1, size(P2, 2))];
%
C2R=C2;
%
C2R.Vertices=P2(1:3,1:size(P2, 2))';
%
P3=F12(0)*F23(0)*[P3;ones(1,size(P3, 2))];
%
C3R=C3;
C3R.Vertices=P3(1:3,1:size(P3, 2))';
%% rysowanie
figure(1);
axis([-100,400,-100,400,-100,700]);
grid on;
hold on;
%
czlon11=patch('Faces',C11.Faces,'Vertices',C11.Vertices,'FaceColor',C11.FaceColor);
%%
%czlon12=patch(C12);
czlon12=patch('Faces',C12.Faces,'Vertices',C12.Vertices,'FaceColor',C12.FaceColor);
%
%czlon2=patch(C2R);
czlon2=patch('Faces',C2R.Faces,'Vertices',C2R.Vertices,'FaceColor',C2.FaceColor);
%
%czlon3=patch(C3R);
czlon3=patch('Faces',C3R.Faces,'Vertices',C3R.Vertices,'FaceColor',C3.FaceColor);
clear P2 P3 C2R C3R
I've already add +1 to whole faces matrix and still no luck.
Please help
EDIT: I've exported the stl files from SOLIDWORKS 2024
6 Comments
Dyuman Joshi
on 20 Jan 2024
Edited: Dyuman Joshi
on 20 Jan 2024
What are these commands supposed to do?
F12(0)
F23(0)
Are these parameters arrays or functions?
TheIOzikI
on 20 Jan 2024
Dyuman Joshi
on 20 Jan 2024
What are C12 and C23?
Please provide everything needed to run your code.
TheIOzikI
on 20 Jan 2024
Dyuman Joshi
on 20 Jan 2024
C23 is not defined in the file attached.
TheIOzikI
on 20 Jan 2024
Accepted Answer
More Answers (0)
Categories
Find more on Polygons 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!









