Determining the new faces (subpolygons) when vertical lines intersect polygon

Hi everyone,
If a polygon is inside a rectangle, and a set of vertical parallel lines where each of them pass through one vertex creating new faces.
Is there algorithm to determining the points of the new faces, when a vertical parallel lines cut polygon that lies inside rectangle?

 Réponse acceptée

If you want to do it numerically, sure. Just turn it into an array (an image) and use find() to find the intersections in each column. If you want to do it analytically, then it seems to be a theoretical math or geometry problem - not sure it's a MATLAB problem.

7 commentaires

By the way, hash tags are not used in Answers. Spaces will connect all your tags into one big long tag. Use commas to separate tags. You might want to fix your tags.
Is there a way to get the color of each pixel( which is for my problem each vertex)? I don't want to save the figure then turn it to a matrix because I will lose the coordinates right ?
Assuming you plotted it with patch() or fill() or something like that then you have the coordinates of the polygon you plotted. You can use inpolygon() to determine if a point is inside or outside the polygon. The colors there can be determined. The color right exactly on the infinitesimally thin boundary is, of course, indeterminate.
OK - I fixed your tags for you.
Thank you so much. and I want to ask is it possible to blind color in matlab? I mean if I have a rectangle in yellow color, and a circle in read, and they are intersect, is there a function or way to make the intersection to orange?
No, not unless you make it an image - a true color RGB image with pixels.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by