Fix offset handling in polygon normalized_form()
This commit is contained in:
		
							parent
							
								
									73193473df
								
							
						
					
					
						commit
						7c7a7e916c
					
				| @ -379,8 +379,9 @@ class Polygon(Shape): | |||||||
|     def normalized_form(self, norm_value: float) -> normalized_shape_tuple: |     def normalized_form(self, norm_value: float) -> normalized_shape_tuple: | ||||||
|         # Note: this function is going to be pretty slow for many-vertexed polygons, relative to |         # Note: this function is going to be pretty slow for many-vertexed polygons, relative to | ||||||
|         #   other shapes |         #   other shapes | ||||||
|         offset = self.vertices.mean(axis=0) + self.offset |         meanv = self.vertices.mean(axis=0) | ||||||
|         zeroed_vertices = self.vertices - offset |         zeroed_vertices = self.vertices - meanv | ||||||
|  |         offset = meanv + self.offset | ||||||
| 
 | 
 | ||||||
|         scale = zeroed_vertices.std() |         scale = zeroed_vertices.std() | ||||||
|         normed_vertices = zeroed_vertices / scale |         normed_vertices = zeroed_vertices / scale | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user