필터 지우기
필터 지우기

2D to 3D extrusion

조회 수: 7 (최근 30일)
Mohamed Alhajeri
Mohamed Alhajeri 2021년 3월 7일
댓글: darova 2021년 3월 9일
After creating a polyshape from a set of input vertices (x,y) using the polyshape function, I need to extrude and plot the shape (with z value) such that it becomes 3D. Is there any available functions to do that? if not please help me in developing the next lines of code to do so.
The following is the simple way in which I wrote the starting lines of code upto creating a 2D polygon.
clc; clear;
[x y] = ginput(5);
plot(x,y,'r*');
hold on
p1 = polyshape(x,y)
plot(p1)

채택된 답변

darova
darova 2021년 3월 8일
Here is an example (not tested)
clc; clear;
[x y] = ginput(5);
z0 = 5;
patch(x,y,'r') % face wall
patch(x,y,x*0+z0,'r') % back wall
surface([x(:) x(:)],[y(:) y(:)],[x(:)*0 x(:)*0+z0],'facecolor','r')
  댓글 수: 2
Mohamed Alhajeri
Mohamed Alhajeri 2021년 3월 9일
Thanks for the help, I got the basic idea how to proceed in my code. One more thing, can we use boolean operations with surfaces like subtracting, union etc with two or more surfaces?
darova
darova 2021년 3월 9일
No, we can't there are no built-it function for this. BUt you can search at fileexchange

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by