- The output of surf2solid is not a triangulation object
- inputs of stlwrite are in the wrong order
stl write triangulation error.
7 次查看(过去 30 天)
显示 更早的评论
getting the error message
'input argument must be a triangulation object'
this is the code
sidelength = input('Enter Side length: ');
height = input('Enter Height: ');
ax = axes();
xlim(ax, [-20 20]);
ylim(ax, [-20 20]);
zlim(ax, [-20 20]);
view(ax, 3);
hold(ax, 'on');
x6 = (sidelength*3.078)/2;
a = ((2+sqrt(3))*(sidelength))/2; %point to point to determine midpoint starting location for new shape
a8 = (3.236*sidelength);
a1 = (a)*0.9;
h1 = -height;
angle1 = atand(height/x6);
angle2 = 90-angle1;
L = sidelength/2;
L1 = -1*(sidelength/2);
L12 = ((L)*0.9);% Y axis scaled 1:10
L123 = ((L1)*0.9);
angle_12 = 150;
d = (-1*height)*0.1; % Z axis scaled 1:10
b1 = (((sqrt(6)+sqrt(2))/2)*(sidelength));
c1 = ((sqrt(3)+1)*sidelength)*0.5;
c11 = (c1)*0.9;
c2 = -(1.902*sidelength)*0.5;
hold on
x = [c1, c11, a1, a1, a, a];
y = [c1, c11, L12, L123, L1, L];
z = [0, d, d, d, 0, 0];
c = [1; 1; 1; 1; 1; 1];
surf2solid(x,y,z,'thickness',0.1); axis image; camlight;
S = surf2solid(x,y,z,'thickness',0.1);
stlwrite('test.stl',S)
0 个评论
采纳的回答
Fabio Freschi
2023-10-25
编辑:Fabio Freschi
2023-10-25
There are two errors
sidelength = input('Enter Side length: ');
height = input('Enter Height: ');
ax = axes();
xlim(ax, [-20 20]);
ylim(ax, [-20 20]);
zlim(ax, [-20 20]);
view(ax, 3);
hold(ax, 'on');
x6 = (sidelength*3.078)/2;
a = ((2+sqrt(3))*(sidelength))/2; %point to point to determine midpoint starting location for new shape
a8 = (3.236*sidelength);
a1 = (a)*0.9;
h1 = -height;
angle1 = atand(height/x6);
angle2 = 90-angle1;
L = sidelength/2;
L1 = -1*(sidelength/2);
L12 = ((L)*0.9);% Y axis scaled 1:10
L123 = ((L1)*0.9);
angle_12 = 150;
d = (-1*height)*0.1; % Z axis scaled 1:10
b1 = (((sqrt(6)+sqrt(2))/2)*(sidelength));
c1 = ((sqrt(3)+1)*sidelength)*0.5;
c11 = (c1)*0.9;
c2 = -(1.902*sidelength)*0.5;
hold on
x = [c1, c11, a1, a1, a, a];
y = [c1, c11, L12, L123, L1, L];
z = [0, d, d, d, 0, 0];
c = [1; 1; 1; 1; 1; 1];
surf2solid(x,y,z,'thickness',0.1); axis image; camlight;
% below the changes
[T,P] = surf2solid(x,y,z,'thickness',0.1);
S = triangulation(T,P);
stlwrite(S,'test.stl')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!