[gtk/path-ops: 5/8] Add an outline of the algorithm
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/path-ops: 5/8] Add an outline of the algorithm
- Date: Fri, 25 Mar 2022 16:57:19 +0000 (UTC)
commit 6cd2323560e24306720c804447ad439fba07bcda
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Mar 25 10:06:28 2022 -0400
Add an outline of the algorithm
gsk/gskpathsimplify.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/gsk/gskpathsimplify.c b/gsk/gskpathsimplify.c
index b79af4cca7..e86a4a8c66 100644
--- a/gsk/gskpathsimplify.c
+++ b/gsk/gskpathsimplify.c
@@ -551,6 +551,20 @@ compare_angle (gconstpointer p1,
return f1 < f2 ? -1 : (f1 > f2 ? 1 : 0);
}
+/*
+ * The general plan of operation is as follows:
+ * - Collect all the segments in a list
+ * - Add all segment-segment intersections, splitting the segments
+ * as needed, and keep Connection structs that recorder which
+ * segements are meeting at which intersections
+ * - Classify each segment as boundary or not. This is where
+ * the different boolean ops differ from each other
+ * - Sort the edges at each connection, counterclockwise
+ * - Walk the edge-connection graph, taking the proper turns at
+ * each connection, to reassemble contours
+ * - Continue doing so until all boundary segments have been
+ * added to a contour
+ */
static GskPath *
gsk_path_op (PathOp operation,
GskPath *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]