Skip to content

Commit

Permalink
Fix tanArcTo (#3318)
Browse files Browse the repository at this point in the history
* updated tangentArc math

* Add a test case showing tan arc then xLineTo

* Fix compile errors

* Tweaking the math

* Use + on angles

* atan2 outputs radians, not degrees

* Track ccw and center of all tan arcs

* re-sequenced atan2 arcTan

* Remove print statements

* Update the test

* Update kittycad in tauri

* New arc fields

---------

Co-authored-by: Jordan Noone <jordan@kittycad.io>
  • Loading branch information
adamchalmers and JordanNoone authored Aug 7, 2024
1 parent 6773dbe commit 6f4bbdb
Show file tree
Hide file tree
Showing 49 changed files with 3,508 additions and 834 deletions.
8 changes: 8 additions & 0 deletions docs/kcl/angleToMatchLengthX.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ const extrusion = extrude(5, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -458,6 +462,10 @@ const extrusion = extrude(5, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
8 changes: 8 additions & 0 deletions docs/kcl/angleToMatchLengthY.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ const extrusion = extrude(5, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -462,6 +466,10 @@ const extrusion = extrude(5, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLine.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -377,6 +381,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -584,6 +592,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -789,6 +801,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLineOfXLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ const extrusion = extrude(10, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -376,6 +380,10 @@ const extrusion = extrude(10, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -583,6 +591,10 @@ const extrusion = extrude(10, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -788,6 +800,10 @@ const extrusion = extrude(10, sketch001)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLineOfYLength.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -378,6 +382,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -585,6 +593,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -790,6 +802,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLineThatIntersects.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -470,6 +474,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -677,6 +685,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -882,6 +894,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLineToX.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -375,6 +379,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -582,6 +590,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -787,6 +799,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/angledLineToY.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -375,6 +379,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -582,6 +590,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -787,6 +799,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/arc.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ const exampleSketch = startSketchOn('XZ')
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -388,6 +392,10 @@ const exampleSketch = startSketchOn('XZ')
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -595,6 +603,10 @@ const exampleSketch = startSketchOn('XZ')
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -800,6 +812,10 @@ const exampleSketch = startSketchOn('XZ')
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
16 changes: 16 additions & 0 deletions docs/kcl/bezierCurve.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -381,6 +385,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -588,6 +596,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down Expand Up @@ -793,6 +805,10 @@ const example = extrude(10, exampleSketch)
type: "TangentialArcTo",
} |
{
// arc's direction
ccw: string,
// the arc's center
center: [number, number],
// The from point.
from: [number, number],
// The tag of the path.
Expand Down
Loading

0 comments on commit 6f4bbdb

Please sign in to comment.