Skip to content

Commit

Permalink
fix: ensure snap_align operator supports meshes with vastly different…
Browse files Browse the repository at this point in the history
… edge lengths
  • Loading branch information
tristan-hm committed May 11, 2022
1 parent 374ad50 commit e9de396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/snap_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def invoke(self, context, event):
face_matrix = create_rotation_matrix_from_face(world_matrix, face)
face_points.append((world_matrix @ v3_average([v.co for v in face.verts]), face_matrix))

shortest_edge_length = min(edge_lengths)
self.snap_distance_factor = shortest_edge_length / 2.0
average_edge_length = sum(edge_lengths) / len(edge_lengths)
self.snap_distance_factor = average_edge_length / 2.0

self.points_cache = vert_points + edge_points + face_points

Expand Down

0 comments on commit e9de396

Please sign in to comment.