Plotting multiple 2D alphaShape polygons with different z-values

조회 수: 3 (최근 30일)
I am trying to plot multiple 2D alphaShape polygons with different z-offsets.
Method I tried:
Since 2D alphaShape objects do not have z values, I attempted to add an array of constant z values alongside the x and y values and recreate the polygon with alphaShape. When I tried plotting it, it does not work.
I would greatly appreciate any help regarding this
shp = alphaShape(x_wkspace',y_wkspace',1);
vertices = shp.Points;
phi_array = ones(length(vertices),1) .* phi;
vertices_z = [vertices,phi_array];
updated_shp = alphaShape(vertices_z);
plot(updated_shp);

채택된 답변

Matt J
Matt J 2024년 2월 5일
편집: Matt J 2024년 2월 5일
th = (pi/12:pi/12:2*pi)';
x1 = [reshape(cos(th)*(1:5), numel(cos(th)*(1:5)),1); 0];
y1 = [reshape(sin(th)*(1:5), numel(sin(th)*(1:5)),1); 0];
x = [x1; x1+15];
y = [y1; y1];
phi=3;
shp=alphaShape(x,y);
TR = alphaTriangulation(shp);
z = x*0+phi;
trisurf(TR, x,y,z);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bounding Regions에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by