summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-11-30 11:22:18 +0100
committerJesper Jensen <jesper@jnsn.dev>2025-11-30 11:22:18 +0100
commite22588e908a9a2b172a8965cfd8767305dcb3459 (patch)
tree369bd419c4df089f535535a3781a99315a999d35 /src
parentf8463d52a7c6cb6de6fde0f2472c44cf35e2452a (diff)
Move around some macro defs
Diffstat (limited to 'src')
-rw-r--r--src/main.c36
-rw-r--r--src/solve.c6
2 files changed, 5 insertions, 37 deletions
diff --git a/src/main.c b/src/main.c
index 964c5c0..6fc50c0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,42 +10,6 @@
#include "cad/solve.h"
#include "cad/svg.h"
-#define SETSIGN(b, v) ((v) * ((2 * (b)) - 1))
-
-#define DEG(x) ((x) * M_PI / 180.0)
-
-#define PP_DISTANCE(C1, C2, D) \
- { \
- .type = CT_POINT_POINT_DISTANCE, \
- .v = D, \
- .c1 = C1, \
- .c2 = C2, \
- }
-
-#define PL_DISTANCE(C1, C2, D) \
- { \
- .type = CT_POINT_LINE_DISTANCE, \
- .v = D, \
- .c1 = C1, \
- .c2 = C2, \
- }
-
-#define POINT_ON_LINE(C1, C2) \
- PL_DISTANCE(C1, C2, 0)
-
-#define LL_ANGLE(C1, C2, D) \
- { \
- .type = CT_LINE_LINE_ANGLE, \
- .v = D, \
- .c1 = C1, \
- .c2 = C2, \
- }
-
-#define CEND() \
- { \
- .type = CT_END, \
- }
-
void plot_point(struct point p) {
printf("<circle cx=\"%f\" cy=\"%f\" r=\".4\" fill=\"black\" />\n", p.pos[0], -p.pos[1]);
}
diff --git a/src/solve.c b/src/solve.c
index 2a4fa57..b82d8e8 100644
--- a/src/solve.c
+++ b/src/solve.c
@@ -40,7 +40,7 @@ void add_constraint(struct constraints *c, struct constraint *new) {
}
-// @IMPROVE: We should do something better than this. I don't really know what.
+// @COMPL: We should do something better than this. I don't really know what.
struct frontier {
struct component *elems[64];
size_t n;
@@ -108,6 +108,10 @@ static void build_angle_point_line(struct drawing *drawing, struct constraint *c
});
}
+// CLEANUP: None of this makes any sense. We shouldn't have to resolve the
+// angles separately. We should just be building up the subgraphs correctly,
+// and then the solutions for angles will pop out by themselves. So remove this
+// once we get subgraph solving working
struct angle_search_frame {
size_t constraint_i;
struct component *head;