Skip to content

Commit

Permalink
fix(polygon): Weight common axes by segment length rather than integer
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Mar 4, 2025
1 parent 2249150 commit 018b6db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ladybug_geometry/geometry2d/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2276,10 +2276,10 @@ def common_axes(polygons, direction, min_distance, merge_distance, angle_toleran
rel_axes, axes_value = [], []
for axis in all_axes:
axis_val = 0
for pt in mid_pts:
for pt, seg in zip(mid_pts, rel_segs):
close_pt = closest_point2d_on_line2d_infinite(pt, axis)
if close_pt.distance_to_point(pt) <= min_distance:
axis_val += 1
axis_val += seg.length
if axis_val != 0:
rel_axes.append(axis)
axes_value.append(axis_val)
Expand Down

0 comments on commit 018b6db

Please sign in to comment.