summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2026-03-28 10:56:36 +0100
committerJesper Jensen <jesper@jnsn.dev>2026-03-28 10:56:36 +0100
commit770216abb4bde565f824eb9010ae641ae118bb2d (patch)
tree0d3cd984e9631c384e874d396d03bee616c771e8 /examples
parentebb61f7bec9a6affa2be7b0eeb94bb737b9edcb2 (diff)
Fix initial offset calculation
Diffstat (limited to 'examples')
-rw-r--r--examples/triangle_tip.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/triangle_tip.c b/examples/triangle_tip.c
index 9d2d5ce..b6fcf99 100644
--- a/examples/triangle_tip.c
+++ b/examples/triangle_tip.c
@@ -39,8 +39,8 @@ int main(int argc, char *argv[]) {
struct component p5 = {.type = COM_POINT};
struct component t1base = {.type = COM_LINE};
+ struct component t1bas2 = {.type = COM_LINE};
struct component t2base = {.type = COM_LINE};
- struct component t2side = {.type = COM_LINE};
add_constraint(&constraints, (struct constraint[]){
// Make a triangle
@@ -51,21 +51,19 @@ int main(int argc, char *argv[]) {
POINT_ON_LINE(&p1, &t1base),
POINT_ON_LINE(&p2, &t1base),
+ POINT_ON_LINE(&p1, &t1bas2),
+ LL_ANGLE(&t1base, &t1bas2, DEG(-10)),
+
// With another triangle sharing a point
PP_DISTANCE(&p4, &p5, 30),
PP_DISTANCE(&p3, &p4, 30),
PP_DISTANCE(&p5, &p3, 30),
- // LL_ANGLE(&t2side, &t2base, DEG(120)),
-
- POINT_ON_LINE(&p3, &t2side),
- POINT_ON_LINE(&p4, &t2side),
-
POINT_ON_LINE(&p4, &t2base),
POINT_ON_LINE(&p5, &t2base),
// The edge they don't share is constrained
- LL_ANGLE(&t1base, &t2base, DEG(70)),
+ LL_ANGLE(&t1bas2, &t2base, DEG(70)),
CEND(),
});