Skip to content

Commit 018b6db

Browse files
committed
fix(polygon): Weight common axes by segment length rather than integer
1 parent 2249150 commit 018b6db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ladybug_geometry/geometry2d/polygon.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2276,10 +2276,10 @@ def common_axes(polygons, direction, min_distance, merge_distance, angle_toleran
22762276
rel_axes, axes_value = [], []
22772277
for axis in all_axes:
22782278
axis_val = 0
2279-
for pt in mid_pts:
2279+
for pt, seg in zip(mid_pts, rel_segs):
22802280
close_pt = closest_point2d_on_line2d_infinite(pt, axis)
22812281
if close_pt.distance_to_point(pt) <= min_distance:
2282-
axis_val += 1
2282+
axis_val += seg.length
22832283
if axis_val != 0:
22842284
rel_axes.append(axis)
22852285
axes_value.append(axis_val)

0 commit comments

Comments
 (0)