Adding or combining two or more patches (or faces) and creating one new solid 2D patch with new vertices

조회 수: 6 (최근 30일)
Hello everyone,
I need a help with adding two patches together (such as shown) and generating one new larger patch with known vertices. In other words, I want to create a new 2D patch by overlaying smaller segment patches on top of each other. My goal is to calculate the overall area of the larger patch. Here is an example of two single patches that I would like to combine:
>> x=[0 1 3 2];y=[1 0 2 3];
x1=[0 1 3 2];y1=[2 3 1 0];
A=patch(x,y,[0 0 1]);
B=patch(x1,y1,[0 0 1]);
axis equal
I would like to have all 12 vertices or the area of the combined patch
Thank you

답변 (1개)

KSSV
KSSV 2016년 10월 1일
편집: KSSV 2016년 10월 1일
From the figure the twelve vertices are (0,1),(1,0),(1.5,0.5),(2,0),(3,1),(2.5,1.5),(3,2),(2,3),(1.5,2.5),(1,3),(0,2),(0.5,1.5).
If you have vertices, you can calculate area using polyarea. doc polyarea
  댓글 수: 1
Farzad Hosseinali
Farzad Hosseinali 2016년 10월 1일
Yes Sir,
Thank you for your response. However, I am trying to find a general solution for multiple (maybe ~1000) patches that overlap each other in random directions. This is just an example for one overlap between two geometries. Once there are 1000 overlaps , I cannot manually find the vertices.
Regards

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by