You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
^Rectangleleft: leftMost x right: rightMost x top: top y bottom: bottom y
86
86
]
87
87
88
+
{ #category : #converting }
89
+
GPolygon>>fitInExtent: extent [
90
+
"I take as parameter a point and will fit the polygon in a rectangle whose dimensions is defined by the extent.
91
+
92
+
To do that, I will first fit my vertices in a square of lenght of 1, then I will multiply my vertices by the extent required."
93
+
94
+
| maxverticesInSquareOfSizeOne |
95
+
max := (self vertices collect:#x) max max: ((self vertices collect:#y )) max. "We do not take `self vertices max` because we want to preserve proportions"
96
+
"Fit the polygon in a square of size 1 by doing a division of it's vertices by 2 times the value of the furthest point from the center of the polygon."
0 commit comments