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

2 views (last 30 days)
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 Comments
Heinrich Villinger
Heinrich Villinger on 14 Jul 2018
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)

Sign in to comment.

Answers (0)

Categories

Find more on Elementary Polygons in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!