patching the area between multiple points

조회 수: 10 (최근 30일)
Patrick Daly
Patrick Daly 2022년 12월 4일
편집: Matt J 2022년 12월 11일
ive been using the patch() function for filling in the area between points. however patch needs the right order of points in order to work as expected.
im working with a function that delivers a points on a plane and i want to fill in the space between the points. depending on the angle of the plane the points are in different positions relative to eath other. so one fixed order for my path() functions doesnt work for all angles.
i need a function that takes points and fills the space in between regardless of the order they are given in.
(for extra context: the points correspond to the orthogonal projection of the vertices of a floating cuboid, changing the angle of the plane changes the "shadow" of the cuboid on the plane. i want that shadow to be filled in.)

답변 (1개)

Matt J
Matt J 2022년 12월 4일
이동: Matt J 2022년 12월 4일
(for extra context: the points correspond to the orthogonal projection of the vertices of a floating cuboid, changing the angle of the plane changes the "shadow" of the cuboid on the plane. i want that shadow to be filled in.)
The orthogonal projection of a cuboid is convex, but some of the projected vertices of the cuboid will not in general be on the convex boundary of the projected region, so we need to exclude those. This is easily done with convhull
k=convhull(x,y);
patch(x(k),y(k))
  댓글 수: 10
Patrick Daly
Patrick Daly 2022년 12월 10일
ive got it now!
im doing a project for college and the task was to write my own gram schmidt function, thats why im using it.
Thanks for your help!
Matt J
Matt J 2022년 12월 11일
편집: Matt J 2022년 12월 11일
You're welcome, but please Accept-click the answer to indicate that your question has been resolved.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by