@tscircuit/core 0.0.927 → 0.0.928

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15993,8 +15993,20 @@ var generateCutoutsAndMousebitesForOutline = (outline, options) => {
15993
15993
  const vec_out_p2 = Flatten.vector(p2, Flatten.point(p_next_.x, p_next_.y));
15994
15994
  const p2_cross = segmentVec.cross(vec_out_p2);
15995
15995
  const is_p2_convex = is_ccw ? p2_cross > 1e-9 : p2_cross < -1e-9;
15996
- start_ext = is_p1_convex ? cutoutWidth : 0;
15997
- end_ext = is_p2_convex ? cutoutWidth : 0;
15996
+ if (is_p1_convex) {
15997
+ let angle = vec_in_p1.angleTo(segmentVec);
15998
+ if (angle > Math.PI) angle = 2 * Math.PI - angle;
15999
+ start_ext = cutoutWidth * Math.tan(angle / 2);
16000
+ } else {
16001
+ start_ext = 0;
16002
+ }
16003
+ if (is_p2_convex) {
16004
+ let angle = segmentVec.angleTo(vec_out_p2);
16005
+ if (angle > Math.PI) angle = 2 * Math.PI - angle;
16006
+ end_ext = cutoutWidth * Math.tan(angle / 2);
16007
+ } else {
16008
+ end_ext = 0;
16009
+ }
15998
16010
  }
15999
16011
  const cutoutParts = [
16000
16012
  { start: 0 - start_ext, end: gapStartDist },
@@ -19534,7 +19546,7 @@ import { identity as identity5 } from "transformation-matrix";
19534
19546
  var package_default = {
19535
19547
  name: "@tscircuit/core",
19536
19548
  type: "module",
19537
- version: "0.0.926",
19549
+ version: "0.0.927",
19538
19550
  types: "dist/index.d.ts",
19539
19551
  main: "dist/index.js",
19540
19552
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.927",
4
+ "version": "0.0.928",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -59,7 +59,7 @@
59
59
  "bun-match-svg": "0.0.12",
60
60
  "calculate-elbow": "^0.0.12",
61
61
  "chokidar-cli": "^3.0.0",
62
- "circuit-json": "^0.0.333",
62
+ "circuit-json": "^0.0.335",
63
63
  "circuit-json-to-bpc": "^0.0.13",
64
64
  "circuit-json-to-connectivity-map": "^0.0.23",
65
65
  "circuit-json-to-gltf": "^0.0.31",