PDETool Dividing up a polygon created by polyshape with an internal boundary

2 次查看(过去 30 天)
I have a 2D polygon, created with 'polyshape' and would like to separate it with an internal boundary (an irregular open polygon) in two regions which have different material properties. 'Addboundary' does not do the job. I want to use the result in 'triangulation' and 'geometryFromMesh'.
  2 个评论
Heinrich Villinger
Heinrich Villinger 2018-7-14
Here is a little bit of code trying to illustrate the problem. The hope was that addboundary cuts my polygon in half so that in the end I have two regions to which I can assign material properties. But it doesn't work that way. Setting the 'simplify' option to false doesn't change anything. Thanks for your help.
% test of addboundary
% vertices of a polygon
x=[0,1,1,0]; y=[0,0,1,1];
%create polygon with polyshape
polygon=polyshape(x,y)
% plot polygon
figure(1),plot(polygon)
% define boundary
xBoundary=[0,0.25,0.5,0.75,1];yBoundary=[0.5,0.25,0.5,0.75,0.5];
% add boundary
polygonWithBoundary=addboundary(polygon,xBoundary,yBoundary)
% plot result of addboundary
% addboundary obviously adds a closed polgon and not a boundary (open polygon)
plot(polygonWithBoundary)

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by