initial commit

This commit is contained in:
2026-02-10 13:34:22 +03:30
parent a4335d69df
commit 9850ed177c

View File

@@ -113,12 +113,28 @@ class DiagramExtractor:
# Extract edges in plot region # Extract edges in plot region
plot_edges = edges[plot_top:plot_bottom, plot_left:plot_right] plot_edges = edges[plot_top:plot_bottom, plot_left:plot_right]
# Remove axes from edges # Remove borders and axis lines to avoid captions/ticks
plot_edges[0:5, :] = 0 border_margin = 12
plot_edges[-5:, :] = 0 axis_band = 6
plot_edges[:, 0:5] = 0
plot_edges[:, -5:] = 0 plot_edges[0:border_margin, :] = 0
plot_edges[-border_margin:, :] = 0
plot_edges[:, 0:border_margin] = 0
plot_edges[:, -border_margin:] = 0
x_axis_rel = x_axis_y - plot_top
y_axis_rel = y_axis_x - plot_left
if 0 <= x_axis_rel < plot_edges.shape[0]:
start = max(0, x_axis_rel - axis_band)
end = min(plot_edges.shape[0], x_axis_rel + axis_band + 1)
plot_edges[start:end, :] = 0
if 0 <= y_axis_rel < plot_edges.shape[1]:
start = max(0, y_axis_rel - axis_band)
end = min(plot_edges.shape[1], y_axis_rel + axis_band + 1)
plot_edges[:, start:end] = 0
# Find coordinates of edges (curve points) # Find coordinates of edges (curve points)
curve_coords = np.where(plot_edges > 0) curve_coords = np.where(plot_edges > 0)