Is it possible to constrain an impoly within in impoly?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Right Grievous
il 29 Giu 2014
Commentato: Right Grievous
il 7 Lug 2014
Hi everybody,
I have a graph on which the user places a rectangle, I then want the user to be able to draw or modify another rectangle within the first, however, this second inner rectangle cannot exit the first at any point.
I'm using impoly as I'm familiar with it, however, these shapes may or may not be parallel to the axes (although they will be parallel to each other) so I don't think I can use makeConstrainToRectFcn as it only sets an x limit and a y limit.
Is there another way to constrain impoly? or is there a way I can have the inner polygon's vertices snapped to the first polygon's edges if they fall outside of it?
Thank you for any help,
Rod.
0 Commenti
Risposta accettata
Image Analyst
il 30 Giu 2014
Use imrect() instead of impoly(). And if you can't do it with constraintorect then don't worry about it and just AND the two rectangles together to get the new coordinates.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!