@tscircuit/3d-viewer 0.0.326 → 0.0.328

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 +328 -240
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -16132,10 +16132,16 @@ function MixedStlModel({
16132
16132
  var import_jscad_planner = __toESM(require_dist(), 1);
16133
16133
  var import_modeling = __toESM(require_src(), 1);
16134
16134
 
16135
- // node_modules/jscad-fiber/dist/chunk-GARWNMIM.js
16135
+ // node_modules/jscad-fiber/dist/chunk-3EKLBAF5.js
16136
16136
  var import_color = __toESM(require_color(), 1);
16137
+ var jscad = __toESM(require_src(), 1);
16137
16138
  import ReactReconciler from "react-reconciler";
16139
+ import {
16140
+ DefaultEventPriority,
16141
+ DiscreteEventPriority
16142
+ } from "react-reconciler/constants.js";
16138
16143
  import React4 from "react";
16144
+ import React42 from "react";
16139
16145
  import { jsx as jsx4 } from "react/jsx-runtime";
16140
16146
  import { jsx as jsx22 } from "react/jsx-runtime";
16141
16147
  import { jsx as jsx32 } from "react/jsx-runtime";
@@ -16167,6 +16173,15 @@ import { jsx as jsx28 } from "react/jsx-runtime";
16167
16173
  import { jsx as jsx29 } from "react/jsx-runtime";
16168
16174
  import { jsx as jsx30 } from "react/jsx-runtime";
16169
16175
  import React22 from "react";
16176
+ import React32 from "react";
16177
+ import * as THREE3 from "three";
16178
+ import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
16179
+ import {
16180
+ BufferAttribute,
16181
+ BufferGeometry,
16182
+ Matrix4
16183
+ } from "three";
16184
+ import { jsx as jsx31 } from "react/jsx-runtime";
16170
16185
  function flattenArray(arr) {
16171
16186
  return arr.reduce(
16172
16187
  (flat, item) => flat.concat(Array.isArray(item) ? flattenArray(item) : item),
@@ -16179,7 +16194,7 @@ var singleElementUnnest = (element) => {
16179
16194
  }
16180
16195
  return element;
16181
16196
  };
16182
- function createHostConfig(jscad5) {
16197
+ function createHostConfig(jscad22) {
16183
16198
  const createInstance = (type, props, rootContainerInstance, hostContext, internalInstanceHandle) => {
16184
16199
  const renderChildren = (children) => {
16185
16200
  if (!children) return [];
@@ -16221,43 +16236,43 @@ function createHostConfig(jscad5) {
16221
16236
  }
16222
16237
  switch (type) {
16223
16238
  case "cube":
16224
- return jscad5.primitives.cube({ size: props.size });
16239
+ return jscad22.primitives.cube({ size: props.size });
16225
16240
  case "sphere":
16226
- return jscad5.primitives.sphere({
16241
+ return jscad22.primitives.sphere({
16227
16242
  radius: props.radius,
16228
16243
  segments: props.segments
16229
16244
  });
16230
16245
  case "cuboid":
16231
- return jscad5.primitives.cuboid({
16246
+ return jscad22.primitives.cuboid({
16232
16247
  size: props.size
16233
16248
  });
16234
16249
  case "roundedCuboid":
16235
- return jscad5.primitives.roundedCuboid({
16250
+ return jscad22.primitives.roundedCuboid({
16236
16251
  size: props.size,
16237
16252
  roundRadius: props.roundRadius
16238
16253
  });
16239
16254
  case "geodesicSphere":
16240
- return jscad5.primitives.geodesicSphere({
16255
+ return jscad22.primitives.geodesicSphere({
16241
16256
  radius: props.radius,
16242
16257
  frequency: props.frequency
16243
16258
  });
16244
16259
  case "ellipsoid":
16245
- return jscad5.primitives.ellipsoid({
16260
+ return jscad22.primitives.ellipsoid({
16246
16261
  radius: props.radius
16247
16262
  });
16248
16263
  case "cylinder":
16249
- return jscad5.primitives.cylinder({
16264
+ return jscad22.primitives.cylinder({
16250
16265
  radius: props.radius,
16251
16266
  height: props.height
16252
16267
  });
16253
16268
  case "roundedCylinder":
16254
- return jscad5.primitives.roundedCylinder({
16269
+ return jscad22.primitives.roundedCylinder({
16255
16270
  radius: props.radius,
16256
16271
  height: props.height,
16257
16272
  roundRadius: props.roundRadius
16258
16273
  });
16259
16274
  case "cylinderElliptic":
16260
- return jscad5.primitives.cylinderElliptic({
16275
+ return jscad22.primitives.cylinderElliptic({
16261
16276
  radius: props.radius,
16262
16277
  height: props.height,
16263
16278
  startRadius: props.startRadius,
@@ -16266,7 +16281,7 @@ function createHostConfig(jscad5) {
16266
16281
  endAngle: props.endAngle
16267
16282
  });
16268
16283
  case "torus":
16269
- return jscad5.primitives.torus({
16284
+ return jscad22.primitives.torus({
16270
16285
  innerRadius: props.innerRadius,
16271
16286
  outerRadius: props.outerRadius,
16272
16287
  innerSegments: props.innerSegments,
@@ -16276,14 +16291,14 @@ function createHostConfig(jscad5) {
16276
16291
  startAngle: props.startAngle
16277
16292
  });
16278
16293
  case "jscadPolygon": {
16279
- return jscad5.primitives.polygon({
16294
+ return jscad22.primitives.polygon({
16280
16295
  points: props.points
16281
16296
  });
16282
16297
  }
16283
16298
  case "extrudeLinear": {
16284
16299
  const { children, ...extrudeProps } = props;
16285
16300
  const childrenGeometry = renderChildren(children);
16286
- const extrudedGeometry = jscad5.extrusions.extrudeLinear(
16301
+ const extrudedGeometry = jscad22.extrusions.extrudeLinear(
16287
16302
  {
16288
16303
  height: extrudeProps.height
16289
16304
  // twistAngle: extrudeProps.twistAngle,
@@ -16296,7 +16311,7 @@ function createHostConfig(jscad5) {
16296
16311
  case "extrudeRotate": {
16297
16312
  const { children, ...extrudeProps } = props;
16298
16313
  const childrenGeometry = renderChildren(children);
16299
- const extrudedGeometry = jscad5.extrusions.extrudeRotate(
16314
+ const extrudedGeometry = jscad22.extrusions.extrudeRotate(
16300
16315
  {
16301
16316
  angle: extrudeProps.angle
16302
16317
  // twistAngle: extrudeProps.twistAngle,
@@ -16309,7 +16324,7 @@ function createHostConfig(jscad5) {
16309
16324
  case "extrudeRectangular": {
16310
16325
  const { children, ...extrudeProps } = props;
16311
16326
  const childrenGeometry = renderChildren(children);
16312
- const extrudedGeometry = jscad5.extrusions.extrudeRectangular(
16327
+ const extrudedGeometry = jscad22.extrusions.extrudeRectangular(
16313
16328
  {
16314
16329
  size: extrudeProps.size,
16315
16330
  height: extrudeProps.height
@@ -16321,7 +16336,7 @@ function createHostConfig(jscad5) {
16321
16336
  case "extrudeHelical": {
16322
16337
  const { children, ...extrudeProps } = props;
16323
16338
  const childrenGeometry = renderChildren(children);
16324
- const extrudedGeometry = jscad5.extrusions.extrudeHelical(
16339
+ const extrudedGeometry = jscad22.extrusions.extrudeHelical(
16325
16340
  {
16326
16341
  height: extrudeProps.height,
16327
16342
  angle: extrudeProps.angle,
@@ -16336,7 +16351,7 @@ function createHostConfig(jscad5) {
16336
16351
  }
16337
16352
  case "extrudeFromSlices": {
16338
16353
  const { baseSlice, ...extrudeProps } = props;
16339
- const extrudedGeometry = jscad5.extrusions.extrudeFromSlices(
16354
+ const extrudedGeometry = jscad22.extrusions.extrudeFromSlices(
16340
16355
  extrudeProps,
16341
16356
  baseSlice
16342
16357
  );
@@ -16345,7 +16360,7 @@ function createHostConfig(jscad5) {
16345
16360
  case "project": {
16346
16361
  const { children, ...projectProps } = props;
16347
16362
  const childrenGeometry = renderChildren(children);
16348
- const projectedGeometry = jscad5.extrusions.project(
16363
+ const projectedGeometry = jscad22.extrusions.project(
16349
16364
  {
16350
16365
  axis: projectProps.axis,
16351
16366
  origin: projectProps.origin
@@ -16358,7 +16373,7 @@ function createHostConfig(jscad5) {
16358
16373
  const { children, ...colorizeProps } = props;
16359
16374
  const childrenGeometry = renderChildren(children);
16360
16375
  const color = colorizeProps.color;
16361
- const colorizedGeometry = jscad5.colors.colorize(
16376
+ const colorizedGeometry = jscad22.colors.colorize(
16362
16377
  color,
16363
16378
  singleElementUnnest(childrenGeometry)
16364
16379
  );
@@ -16382,7 +16397,7 @@ function createHostConfig(jscad5) {
16382
16397
  internalInstanceHandle
16383
16398
  )
16384
16399
  );
16385
- return geometries.reduce((acc, curr) => jscad5.booleans.union(acc, curr));
16400
+ return geometries.reduce((acc, curr) => jscad22.booleans.union(acc, curr));
16386
16401
  }
16387
16402
  case "subtract": {
16388
16403
  const { children } = props;
@@ -16422,12 +16437,12 @@ function createHostConfig(jscad5) {
16422
16437
  "One or more geometries could not be processed for subtraction."
16423
16438
  );
16424
16439
  }
16425
- return jscad5.booleans.subtract(baseGeometry, subtractGeometries);
16440
+ return jscad22.booleans.subtract(baseGeometry, subtractGeometries);
16426
16441
  }
16427
16442
  case "translate": {
16428
16443
  const { args, children } = props;
16429
16444
  const childrenGeometries = renderChildren(children);
16430
- return jscad5.transforms.translate(
16445
+ return jscad22.transforms.translate(
16431
16446
  args,
16432
16447
  singleElementUnnest(childrenGeometries)
16433
16448
  );
@@ -16435,7 +16450,7 @@ function createHostConfig(jscad5) {
16435
16450
  case "rotate": {
16436
16451
  const { children, ...rotateProps } = props;
16437
16452
  const childrenGeometries = renderChildren(children);
16438
- const rotateGeometry = jscad5.transforms.rotate(
16453
+ const rotateGeometry = jscad22.transforms.rotate(
16439
16454
  rotateProps.angles,
16440
16455
  singleElementUnnest(childrenGeometries)
16441
16456
  );
@@ -16455,7 +16470,7 @@ function createHostConfig(jscad5) {
16455
16470
  internalInstanceHandle
16456
16471
  )
16457
16472
  );
16458
- return jscad5.hulls.hull(geometries);
16473
+ return jscad22.hulls.hull(geometries);
16459
16474
  }
16460
16475
  case "hullChain": {
16461
16476
  const { children } = props;
@@ -16471,15 +16486,15 @@ function createHostConfig(jscad5) {
16471
16486
  internalInstanceHandle
16472
16487
  )
16473
16488
  );
16474
- return jscad5.hulls.hullChain(geometries);
16489
+ return jscad22.hulls.hullChain(geometries);
16475
16490
  }
16476
16491
  case "rectangle": {
16477
16492
  const { size: size2 } = props;
16478
- return jscad5.primitives.rectangle({ size: size2 });
16493
+ return jscad22.primitives.rectangle({ size: size2 });
16479
16494
  }
16480
16495
  case "circle": {
16481
16496
  const { radius } = props;
16482
- return jscad5.primitives.circle({ radius });
16497
+ return jscad22.primitives.circle({ radius });
16483
16498
  }
16484
16499
  default:
16485
16500
  throw new Error(`Unknown element type: ${type}`);
@@ -16491,6 +16506,7 @@ function createHostConfig(jscad5) {
16491
16506
  supportsMutation: true,
16492
16507
  supportsPersistence: false,
16493
16508
  supportsHydration: false,
16509
+ currentUpdatePriority: DefaultEventPriority,
16494
16510
  createInstance,
16495
16511
  createTextInstance() {
16496
16512
  throw new Error("Text elements are not supported in JSCAD");
@@ -16532,11 +16548,11 @@ function createHostConfig(jscad5) {
16532
16548
  getPublicInstance(instance) {
16533
16549
  return instance;
16534
16550
  },
16535
- getRootHostContext() {
16536
- return {};
16551
+ getRootHostContext(rootContainer) {
16552
+ return jscad22;
16537
16553
  },
16538
- getChildHostContext() {
16539
- return {};
16554
+ getChildHostContext(parentHostContext, type, rootContainer) {
16555
+ return parentHostContext;
16540
16556
  },
16541
16557
  shouldSetTextContent() {
16542
16558
  return false;
@@ -16557,6 +16573,15 @@ function createHostConfig(jscad5) {
16557
16573
  },
16558
16574
  getInstanceFromScope: () => null,
16559
16575
  detachDeletedInstance: () => {
16576
+ },
16577
+ resolveUpdatePriority: () => DiscreteEventPriority,
16578
+ setCurrentUpdatePriority: (priority) => {
16579
+ },
16580
+ getCurrentUpdatePriority: () => {
16581
+ return DefaultEventPriority;
16582
+ },
16583
+ maySuspendCommit() {
16584
+ return false;
16560
16585
  }
16561
16586
  };
16562
16587
  return hostConfig2;
@@ -16850,48 +16875,6 @@ var ExtrudeFromSlicesBase = ({
16850
16875
  var ExtrudeFromSlices = withOffsetProp(
16851
16876
  withColorProp(ExtrudeFromSlicesBase)
16852
16877
  );
16853
- function createJSCADRenderer(jscad5) {
16854
- const hostConfig2 = createHostConfig(jscad5);
16855
- function createJSCADRoot4(container) {
16856
- const reconciler2 = ReactReconciler(hostConfig2);
16857
- const root = reconciler2.createContainer(
16858
- container,
16859
- 0,
16860
- null,
16861
- false,
16862
- null,
16863
- "",
16864
- (error) => console.error(error),
16865
- null
16866
- );
16867
- return {
16868
- render(element) {
16869
- reconciler2.updateContainer(element, root, null, () => {
16870
- });
16871
- }
16872
- };
16873
- }
16874
- return { createJSCADRoot: createJSCADRoot4 };
16875
- }
16876
-
16877
- // node_modules/jscad-fiber/dist/three.js
16878
- var jscad = __toESM(require_src(), 1);
16879
- var jscad2 = __toESM(require_src(), 1);
16880
- import { useEffect as useEffect5, useMemo as useMemo3, useState as useState3 } from "react";
16881
- import ReactReconciler2 from "react-reconciler";
16882
- import * as THREE3 from "three";
16883
- import {
16884
- BufferAttribute,
16885
- BufferGeometry,
16886
- Matrix4
16887
- } from "three";
16888
- import React5, { useContext as useContext3 } from "react";
16889
- import React23 from "react";
16890
- import { jsx as jsx31 } from "react/jsx-runtime";
16891
- import React32 from "react";
16892
- import * as THREE22 from "three";
16893
- import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
16894
- import { jsx as jsx210 } from "react/jsx-runtime";
16895
16878
  function convertCSGToThreeGeom(csg) {
16896
16879
  if (csg.polygons) {
16897
16880
  const vertices = [];
@@ -16968,16 +16951,121 @@ function convertCSGToThreeGeom(csg) {
16968
16951
  console.error("Invalid CSG object: neither polygons nor sides found");
16969
16952
  return new BufferGeometry();
16970
16953
  }
16971
- var hostConfig = createHostConfig(jscad);
16954
+ var { createJSCADRoot } = createJSCADRenderer(jscad);
16955
+ function createJSCADRenderer(jscad22) {
16956
+ const hostConfig2 = createHostConfig(jscad22);
16957
+ function renderElementSync(element, container) {
16958
+ const createInstanceFromHostConfig = hostConfig2.createInstance;
16959
+ function processElement(elem) {
16960
+ if (Array.isArray(elem)) {
16961
+ return elem.flatMap((child) => processElement(child));
16962
+ }
16963
+ const { type, props } = elem;
16964
+ if (type === React42.Fragment || typeof type === "symbol" && String(type).includes("react.fragment")) {
16965
+ if (props && typeof props === "object" && "children" in props) {
16966
+ return processElement(props.children);
16967
+ }
16968
+ return [];
16969
+ }
16970
+ if (typeof type === "function") {
16971
+ try {
16972
+ const originalError = console.error;
16973
+ console.error = (...args) => {
16974
+ const message = args.join(" ");
16975
+ if (!message.includes("Invalid hook call")) {
16976
+ originalError(...args);
16977
+ }
16978
+ };
16979
+ try {
16980
+ const result = type(props);
16981
+ console.error = originalError;
16982
+ return processElement(result);
16983
+ } finally {
16984
+ console.error = originalError;
16985
+ }
16986
+ } catch (error) {
16987
+ if (props && typeof props === "object" && "children" in props) {
16988
+ return processElement(props.children);
16989
+ }
16990
+ if (error instanceof Error && error.message.includes("Invalid hook call")) {
16991
+ return [];
16992
+ }
16993
+ throw error;
16994
+ }
16995
+ }
16996
+ const instance = createInstanceFromHostConfig(
16997
+ type,
16998
+ props,
16999
+ container,
17000
+ jscad22,
17001
+ // hostContext
17002
+ null
17003
+ // internalInstanceHandle
17004
+ );
17005
+ return instance;
17006
+ }
17007
+ try {
17008
+ const result = processElement(element);
17009
+ if (Array.isArray(result)) {
17010
+ container.push(...result);
17011
+ } else {
17012
+ container.push(result);
17013
+ }
17014
+ } catch (error) {
17015
+ console.error("Sync render error:", error);
17016
+ throw error;
17017
+ }
17018
+ }
17019
+ function createJSCADRoot22(container, onError) {
17020
+ const reconciler2 = ReactReconciler(hostConfig2);
17021
+ const root = reconciler2.createContainer(
17022
+ container,
17023
+ 0,
17024
+ null,
17025
+ false,
17026
+ null,
17027
+ "",
17028
+ (error) => {
17029
+ console.error(error);
17030
+ if (onError) onError(error);
17031
+ },
17032
+ null
17033
+ );
17034
+ return {
17035
+ render(element, callback) {
17036
+ if (callback) {
17037
+ reconciler2.updateContainer(element, root, null, callback);
17038
+ } else {
17039
+ try {
17040
+ renderElementSync(element, container);
17041
+ } catch (error) {
17042
+ if (onError) onError(error);
17043
+ else throw error;
17044
+ }
17045
+ }
17046
+ }
17047
+ };
17048
+ }
17049
+ return { createJSCADRoot: createJSCADRoot22 };
17050
+ }
17051
+
17052
+ // node_modules/jscad-fiber/dist/three.js
17053
+ var jscad2 = __toESM(require_src(), 1);
17054
+ import { useEffect as useEffect5, useMemo as useMemo3, useState as useState3 } from "react";
17055
+ import ReactReconciler2 from "react-reconciler";
17056
+ import * as THREE4 from "three";
17057
+ import React5, { useContext as useContext3 } from "react";
17058
+ import React23 from "react";
17059
+ import { jsx as jsx33 } from "react/jsx-runtime";
17060
+ var hostConfig = createHostConfig(jscad2);
16972
17061
  var reconciler = ReactReconciler2(hostConfig);
16973
17062
  var ThreeContext2 = React5.createContext(null);
16974
17063
  var ThreeProvider = ThreeContext2.Provider;
16975
- var { createJSCADRoot } = createJSCADRenderer(jscad2);
16976
17064
 
16977
17065
  // src/three-components/JscadModel.tsx
16978
- import * as THREE4 from "three";
17066
+ import * as THREE5 from "three";
16979
17067
  import { useMemo as useMemo4, useEffect as useEffect6 } from "react";
16980
- import { jsx as jsx33 } from "react/jsx-runtime";
17068
+ import { jsx as jsx34 } from "react/jsx-runtime";
16981
17069
  var JscadModel = ({
16982
17070
  jscadPlan,
16983
17071
  positionOffset,
@@ -16990,16 +17078,16 @@ var JscadModel = ({
16990
17078
  const { threeGeom, material } = useMemo4(() => {
16991
17079
  const jscadObject = (0, import_jscad_planner.executeJscadOperations)(import_modeling.default, jscadPlan);
16992
17080
  const threeGeom2 = convertCSGToThreeGeom(jscadObject);
16993
- const material2 = new THREE4.MeshStandardMaterial({
17081
+ const material2 = new THREE5.MeshStandardMaterial({
16994
17082
  vertexColors: true,
16995
- side: THREE4.DoubleSide
17083
+ side: THREE5.DoubleSide
16996
17084
  // Ensure both sides are visible
16997
17085
  });
16998
17086
  return { threeGeom: threeGeom2, material: material2 };
16999
17087
  }, [jscadPlan]);
17000
17088
  const mesh = useMemo4(() => {
17001
17089
  if (!threeGeom) return null;
17002
- return new THREE4.Mesh(threeGeom, material);
17090
+ return new THREE5.Mesh(threeGeom, material);
17003
17091
  }, [threeGeom, material]);
17004
17092
  useEffect6(() => {
17005
17093
  if (!mesh || !rootObject) return;
@@ -17013,7 +17101,7 @@ var JscadModel = ({
17013
17101
  useMemo4(() => {
17014
17102
  if (!material) return;
17015
17103
  if (isHovered) {
17016
- const color = new THREE4.Color(material.color.getHex());
17104
+ const color = new THREE5.Color(material.color.getHex());
17017
17105
  material.emissive.copy(color);
17018
17106
  material.emissive.setRGB(0, 0, 1);
17019
17107
  material.emissiveIntensity = 0.2;
@@ -17022,7 +17110,7 @@ var JscadModel = ({
17022
17110
  }
17023
17111
  }, [isHovered, material]);
17024
17112
  if (!threeGeom) return null;
17025
- return /* @__PURE__ */ jsx33(
17113
+ return /* @__PURE__ */ jsx34(
17026
17114
  ContainerWithTooltip_default,
17027
17115
  {
17028
17116
  isHovered,
@@ -31710,9 +31798,9 @@ var require_react_reconciler_development = __commonJS2({
31710
31798
  return null;
31711
31799
  }
31712
31800
  }
31713
- var DiscreteEventPriority = SyncLane;
31801
+ var DiscreteEventPriority2 = SyncLane;
31714
31802
  var ContinuousEventPriority = InputContinuousLane;
31715
- var DefaultEventPriority = DefaultLane;
31803
+ var DefaultEventPriority2 = DefaultLane;
31716
31804
  var IdleEventPriority = IdleLane;
31717
31805
  var currentUpdatePriority = NoLane;
31718
31806
  function getCurrentUpdatePriority() {
@@ -31741,14 +31829,14 @@ var require_react_reconciler_development = __commonJS2({
31741
31829
  }
31742
31830
  function lanesToEventPriority(lanes) {
31743
31831
  var lane = getHighestPriorityLane(lanes);
31744
- if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
31745
- return DiscreteEventPriority;
31832
+ if (!isHigherEventPriority(DiscreteEventPriority2, lane)) {
31833
+ return DiscreteEventPriority2;
31746
31834
  }
31747
31835
  if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
31748
31836
  return ContinuousEventPriority;
31749
31837
  }
31750
31838
  if (includesNonIdleWork(lane)) {
31751
- return DefaultEventPriority;
31839
+ return DefaultEventPriority2;
31752
31840
  }
31753
31841
  return IdleEventPriority;
31754
31842
  }
@@ -31823,13 +31911,13 @@ var require_react_reconciler_development = __commonJS2({
31823
31911
  if (enableProfilerTimer) {
31824
31912
  var schedulerPriority;
31825
31913
  switch (eventPriority) {
31826
- case DiscreteEventPriority:
31914
+ case DiscreteEventPriority2:
31827
31915
  schedulerPriority = ImmediatePriority;
31828
31916
  break;
31829
31917
  case ContinuousEventPriority:
31830
31918
  schedulerPriority = UserBlockingPriority;
31831
31919
  break;
31832
- case DefaultEventPriority:
31920
+ case DefaultEventPriority2:
31833
31921
  schedulerPriority = NormalPriority;
31834
31922
  break;
31835
31923
  case IdleEventPriority:
@@ -32115,7 +32203,7 @@ var require_react_reconciler_development = __commonJS2({
32115
32203
  try {
32116
32204
  var isSync = true;
32117
32205
  var queue = syncQueue;
32118
- setCurrentUpdatePriority(DiscreteEventPriority);
32206
+ setCurrentUpdatePriority(DiscreteEventPriority2);
32119
32207
  for (; i < queue.length; i++) {
32120
32208
  var callback = queue[i];
32121
32209
  do {
@@ -42474,13 +42562,13 @@ var require_react_reconciler_development = __commonJS2({
42474
42562
  } else {
42475
42563
  var schedulerPriorityLevel;
42476
42564
  switch (lanesToEventPriority(nextLanes)) {
42477
- case DiscreteEventPriority:
42565
+ case DiscreteEventPriority2:
42478
42566
  schedulerPriorityLevel = ImmediatePriority;
42479
42567
  break;
42480
42568
  case ContinuousEventPriority:
42481
42569
  schedulerPriorityLevel = UserBlockingPriority;
42482
42570
  break;
42483
- case DefaultEventPriority:
42571
+ case DefaultEventPriority2:
42484
42572
  schedulerPriorityLevel = NormalPriority;
42485
42573
  break;
42486
42574
  case IdleEventPriority:
@@ -42755,7 +42843,7 @@ var require_react_reconciler_development = __commonJS2({
42755
42843
  var prevTransition = ReactCurrentBatchConfig$2.transition;
42756
42844
  try {
42757
42845
  ReactCurrentBatchConfig$2.transition = null;
42758
- setCurrentUpdatePriority(DefaultEventPriority);
42846
+ setCurrentUpdatePriority(DefaultEventPriority2);
42759
42847
  return fn();
42760
42848
  } finally {
42761
42849
  setCurrentUpdatePriority(previousPriority);
@@ -42781,7 +42869,7 @@ var require_react_reconciler_development = __commonJS2({
42781
42869
  var prevTransition = ReactCurrentBatchConfig$2.transition;
42782
42870
  try {
42783
42871
  ReactCurrentBatchConfig$2.transition = null;
42784
- setCurrentUpdatePriority(DiscreteEventPriority);
42872
+ setCurrentUpdatePriority(DiscreteEventPriority2);
42785
42873
  return fn(a, b, c, d);
42786
42874
  } finally {
42787
42875
  setCurrentUpdatePriority(previousPriority);
@@ -42801,7 +42889,7 @@ var require_react_reconciler_development = __commonJS2({
42801
42889
  var previousPriority = getCurrentUpdatePriority();
42802
42890
  try {
42803
42891
  ReactCurrentBatchConfig$2.transition = null;
42804
- setCurrentUpdatePriority(DiscreteEventPriority);
42892
+ setCurrentUpdatePriority(DiscreteEventPriority2);
42805
42893
  if (fn) {
42806
42894
  return fn();
42807
42895
  } else {
@@ -42826,7 +42914,7 @@ var require_react_reconciler_development = __commonJS2({
42826
42914
  var previousPriority = getCurrentUpdatePriority();
42827
42915
  try {
42828
42916
  ReactCurrentBatchConfig$2.transition = null;
42829
- setCurrentUpdatePriority(DiscreteEventPriority);
42917
+ setCurrentUpdatePriority(DiscreteEventPriority2);
42830
42918
  fn();
42831
42919
  } finally {
42832
42920
  setCurrentUpdatePriority(previousPriority);
@@ -43148,7 +43236,7 @@ var require_react_reconciler_development = __commonJS2({
43148
43236
  var prevTransition = ReactCurrentBatchConfig$2.transition;
43149
43237
  try {
43150
43238
  ReactCurrentBatchConfig$2.transition = null;
43151
- setCurrentUpdatePriority(DiscreteEventPriority);
43239
+ setCurrentUpdatePriority(DiscreteEventPriority2);
43152
43240
  commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority);
43153
43241
  } finally {
43154
43242
  ReactCurrentBatchConfig$2.transition = prevTransition;
@@ -43211,7 +43299,7 @@ var require_react_reconciler_development = __commonJS2({
43211
43299
  var prevTransition = ReactCurrentBatchConfig$2.transition;
43212
43300
  ReactCurrentBatchConfig$2.transition = null;
43213
43301
  var previousPriority = getCurrentUpdatePriority();
43214
- setCurrentUpdatePriority(DiscreteEventPriority);
43302
+ setCurrentUpdatePriority(DiscreteEventPriority2);
43215
43303
  var prevExecutionContext = executionContext;
43216
43304
  executionContext |= CommitContext;
43217
43305
  ReactCurrentOwner$2.current = null;
@@ -43313,7 +43401,7 @@ var require_react_reconciler_development = __commonJS2({
43313
43401
  function flushPassiveEffects() {
43314
43402
  if (rootWithPendingPassiveEffects !== null) {
43315
43403
  var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
43316
- var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
43404
+ var priority = lowerEventPriority(DefaultEventPriority2, renderPriority);
43317
43405
  var prevTransition = ReactCurrentBatchConfig$2.transition;
43318
43406
  var previousPriority = getCurrentUpdatePriority();
43319
43407
  try {
@@ -99014,7 +99102,7 @@ var require_dist2 = __commonJS2({
99014
99102
  Hull: () => Hull3,
99015
99103
  HullChain: () => HullChain2,
99016
99104
  JSCadThreeMesh: () => JSCadThreeMesh,
99017
- JsCadView: () => JsCadView,
99105
+ JsCadView: () => JsCadView2,
99018
99106
  Polygon: () => Polygon4,
99019
99107
  Project: () => Project2,
99020
99108
  Rectangle: () => Rectangle2,
@@ -99836,10 +99924,10 @@ var require_dist2 = __commonJS2({
99836
99924
  console.error("Invalid CSG object: neither polygons nor sides found");
99837
99925
  return new import_three22.BufferGeometry();
99838
99926
  }
99839
- var convert_csg_to_three_geom_default = convertCSGToThreeGeom2;
99927
+ var convert_csg_to_three_geom_default2 = convertCSGToThreeGeom2;
99840
99928
  var import_jsx_runtime312 = require_jsx_runtime();
99841
99929
  var { createJSCADRoot: createJSCADRoot4 } = createJSCADRenderer2(jscad5);
99842
- function JsCadView({
99930
+ function JsCadView2({
99843
99931
  children,
99844
99932
  wireframe,
99845
99933
  zAxisUp = false,
@@ -99856,7 +99944,7 @@ var require_dist2 = __commonJS2({
99856
99944
  processCGS2(child);
99857
99945
  }
99858
99946
  } else {
99859
- const geometry = convert_csg_to_three_geom_default(csg);
99947
+ const geometry = convert_csg_to_three_geom_default2(csg);
99860
99948
  if (csg.sides) {
99861
99949
  const material = new THREE27.LineBasicMaterial({
99862
99950
  vertexColors: true,
@@ -99943,14 +100031,14 @@ var require_dist2 = __commonJS2({
99943
100031
  return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { ref: containerRef, style: { width: "100%", minHeight: "400px" } });
99944
100032
  }
99945
100033
  var jscad22 = __toESM22(require_src2(), 1);
99946
- var import_react36 = require_react();
100034
+ var import_react37 = require_react();
99947
100035
  var import_react_reconciler3 = __toESM22(require_react_reconciler(), 1);
99948
100036
  var THREE28 = __toESM22(require_three(), 1);
99949
100037
  var hostConfig2 = createHostConfig2(jscad22);
99950
100038
  var reconciler2 = (0, import_react_reconciler3.default)(hostConfig2);
99951
100039
  function useJSCADRenderer(children) {
99952
- const container = (0, import_react36.useMemo)(() => [], []);
99953
- const root = (0, import_react36.useMemo)(() => {
100040
+ const container = (0, import_react37.useMemo)(() => [], []);
100041
+ const root = (0, import_react37.useMemo)(() => {
99954
100042
  const root2 = reconciler2.createContainer(
99955
100043
  container,
99956
100044
  0,
@@ -99963,13 +100051,13 @@ var require_dist2 = __commonJS2({
99963
100051
  );
99964
100052
  return root2;
99965
100053
  }, [container]);
99966
- const [mesh, setMesh] = (0, import_react36.useState)(null);
99967
- (0, import_react36.useEffect)(() => {
100054
+ const [mesh, setMesh] = (0, import_react37.useState)(null);
100055
+ (0, import_react37.useEffect)(() => {
99968
100056
  reconciler2.updateContainer(children, root, null, () => {
99969
100057
  });
99970
100058
  const scene = new THREE28.Scene();
99971
100059
  container.map((csg) => {
99972
- const geometry = convert_csg_to_three_geom_default(csg);
100060
+ const geometry = convert_csg_to_three_geom_default2(csg);
99973
100061
  if (csg.sides) {
99974
100062
  const material = new THREE28.LineBasicMaterial({
99975
100063
  vertexColors: true,
@@ -100366,7 +100454,7 @@ var A2512 = ({ color = "#333" }) => {
100366
100454
  ] });
100367
100455
  };
100368
100456
  var import_jscad_fiber10 = __toESM2(require_dist2(), 1);
100369
- var import_react13 = __toESM2(require_react(), 1);
100457
+ var import_react14 = __toESM2(require_react(), 1);
100370
100458
  var import_jsx_runtime102 = __toESM2(require_jsx_runtime(), 1);
100371
100459
  var import_jscad_fiber11 = __toESM2(require_dist2(), 1);
100372
100460
  var import_jsx_runtime112 = __toESM2(require_jsx_runtime(), 1);
@@ -101530,7 +101618,7 @@ var import_jsx_runtime292 = __toESM2(require_jsx_runtime(), 1);
101530
101618
  // src/three-components/FootprinterModel.tsx
101531
101619
  var import_jscad_planner2 = __toESM(require_dist(), 1);
101532
101620
  import { useMemo as useMemo5 } from "react";
101533
- import { Fragment as Fragment2, jsx as jsx34 } from "react/jsx-runtime";
101621
+ import { Fragment as Fragment2, jsx as jsx35 } from "react/jsx-runtime";
101534
101622
  var { createJSCADRoot: createJSCADRoot2 } = createJSCADRenderer(import_jscad_planner2.jscadPlanner);
101535
101623
  var FootprinterModel = ({
101536
101624
  positionOffset,
@@ -101544,11 +101632,11 @@ var FootprinterModel = ({
101544
101632
  if (!footprint) return null;
101545
101633
  const jscadOperations2 = [];
101546
101634
  const root = createJSCADRoot2(jscadOperations2);
101547
- root.render(/* @__PURE__ */ jsx34(Footprinter3d, { footprint }));
101635
+ root.render(/* @__PURE__ */ jsx35(Footprinter3d, { footprint }));
101548
101636
  return jscadOperations2;
101549
101637
  }, [footprint]);
101550
101638
  if (!jscadOperations) return null;
101551
- return /* @__PURE__ */ jsx34(Fragment2, { children: jscadOperations.map((operation, index) => /* @__PURE__ */ jsx34(
101639
+ return /* @__PURE__ */ jsx35(Fragment2, { children: jscadOperations.map((operation, index) => /* @__PURE__ */ jsx35(
101552
101640
  JscadModel,
101553
101641
  {
101554
101642
  positionOffset,
@@ -101568,7 +101656,7 @@ var tuple = (...args) => args;
101568
101656
  // src/react-three/Html.tsx
101569
101657
  import { useRef as useRef2, useEffect as useEffect7, useState as useState4 } from "react";
101570
101658
  import ReactDOM from "react-dom";
101571
- import * as THREE5 from "three";
101659
+ import * as THREE6 from "three";
101572
101660
  var Html = ({ children, position, style }) => {
101573
101661
  const { camera, renderer } = useThree();
101574
101662
  const el = useRef2(document.createElement("div"));
@@ -101586,7 +101674,7 @@ var Html = ({ children, position, style }) => {
101586
101674
  }, [renderer, children]);
101587
101675
  useFrame(() => {
101588
101676
  if (!camera || !el.current || !renderer) return;
101589
- const vector = new THREE5.Vector3(...position);
101677
+ const vector = new THREE6.Vector3(...position);
101590
101678
  vector.project(camera);
101591
101679
  const x = Math.round((vector.x + 1) * renderer.domElement.width / 2);
101592
101680
  const y = Math.round((-vector.y + 1) * renderer.domElement.height / 2);
@@ -101602,7 +101690,7 @@ var Html = ({ children, position, style }) => {
101602
101690
  };
101603
101691
 
101604
101692
  // src/AnyCadComponent.tsx
101605
- import { Fragment as Fragment3, jsx as jsx35, jsxs } from "react/jsx-runtime";
101693
+ import { Fragment as Fragment3, jsx as jsx36, jsxs } from "react/jsx-runtime";
101606
101694
  var AnyCadComponent = ({
101607
101695
  cad_component: cad_component2,
101608
101696
  circuitJson
@@ -101635,7 +101723,7 @@ var AnyCadComponent = ({
101635
101723
  ) : void 0;
101636
101724
  let modelComponent = null;
101637
101725
  if (url) {
101638
- modelComponent = /* @__PURE__ */ jsx35(
101726
+ modelComponent = /* @__PURE__ */ jsx36(
101639
101727
  MixedStlModel,
101640
101728
  {
101641
101729
  url,
@@ -101652,7 +101740,7 @@ var AnyCadComponent = ({
101652
101740
  cad_component2.cad_component_id
101653
101741
  );
101654
101742
  } else if (cad_component2.model_jscad) {
101655
- modelComponent = /* @__PURE__ */ jsx35(
101743
+ modelComponent = /* @__PURE__ */ jsx36(
101656
101744
  JscadModel,
101657
101745
  {
101658
101746
  jscadPlan: cad_component2.model_jscad,
@@ -101664,7 +101752,7 @@ var AnyCadComponent = ({
101664
101752
  cad_component2.cad_component_id
101665
101753
  );
101666
101754
  } else if (cad_component2.footprinter_string) {
101667
- modelComponent = /* @__PURE__ */ jsx35(
101755
+ modelComponent = /* @__PURE__ */ jsx36(
101668
101756
  FootprinterModel,
101669
101757
  {
101670
101758
  positionOffset: cad_component2.position ? [
@@ -101682,7 +101770,7 @@ var AnyCadComponent = ({
101682
101770
  }
101683
101771
  return /* @__PURE__ */ jsxs(Fragment3, { children: [
101684
101772
  modelComponent,
101685
- isHovered && hoverPosition ? /* @__PURE__ */ jsx35(
101773
+ isHovered && hoverPosition ? /* @__PURE__ */ jsx36(
101686
101774
  Html,
101687
101775
  {
101688
101776
  position: hoverPosition,
@@ -101710,12 +101798,12 @@ import {
101710
101798
  useMemo as useMemo13,
101711
101799
  useState as useState7
101712
101800
  } from "react";
101713
- import * as THREE10 from "three";
101801
+ import * as THREE11 from "three";
101714
101802
 
101715
101803
  // package.json
101716
101804
  var package_default = {
101717
101805
  name: "@tscircuit/3d-viewer",
101718
- version: "0.0.325",
101806
+ version: "0.0.327",
101719
101807
  main: "./dist/index.js",
101720
101808
  module: "./dist/index.js",
101721
101809
  type: "module",
@@ -101759,9 +101847,9 @@ var package_default = {
101759
101847
  },
101760
101848
  devDependencies: {
101761
101849
  "@tscircuit/circuit-json-util": "^0.0.64",
101762
- "@tscircuit/props": "^0.0.282",
101850
+ "@tscircuit/props": "^0.0.283",
101763
101851
  "jscad-electronics": "^0.0.29",
101764
- "jscad-fiber": "^0.0.83",
101852
+ "jscad-fiber": "^0.0.84",
101765
101853
  "jscad-planner": "^0.0.13",
101766
101854
  "react-use-gesture": "^9.1.3",
101767
101855
  "@tscircuit/core": "^0.0.616",
@@ -101800,7 +101888,7 @@ var package_default = {
101800
101888
 
101801
101889
  // src/three-components/cube-with-labeled-sides.tsx
101802
101890
  import { useEffect as useEffect9, useMemo as useMemo8 } from "react";
101803
- import * as THREE6 from "three";
101891
+ import * as THREE7 from "three";
101804
101892
 
101805
101893
  // src/react-three/Text.tsx
101806
101894
  import { useEffect as useEffect8, useMemo as useMemo7 } from "react";
@@ -101856,15 +101944,15 @@ var Text = ({
101856
101944
  };
101857
101945
 
101858
101946
  // src/three-components/cube-with-labeled-sides.tsx
101859
- import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs2 } from "react/jsx-runtime";
101947
+ import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs2 } from "react/jsx-runtime";
101860
101948
  if (typeof window !== "undefined") {
101861
- window.TSCI_MAIN_CAMERA_ROTATION = new THREE6.Euler(0, 0, 0);
101949
+ window.TSCI_MAIN_CAMERA_ROTATION = new THREE7.Euler(0, 0, 0);
101862
101950
  }
101863
101951
  function computePointInFront(rotationVector, distance2) {
101864
- const quaternion = new THREE6.Quaternion().setFromEuler(
101865
- new THREE6.Euler(rotationVector.x, rotationVector.y, rotationVector.z)
101952
+ const quaternion = new THREE7.Quaternion().setFromEuler(
101953
+ new THREE7.Euler(rotationVector.x, rotationVector.y, rotationVector.z)
101866
101954
  );
101867
- const forwardVector = new THREE6.Vector3(0, 0, 1);
101955
+ const forwardVector = new THREE7.Vector3(0, 0, 1);
101868
101956
  forwardVector.applyQuaternion(quaternion);
101869
101957
  const result = forwardVector.multiplyScalar(distance2);
101870
101958
  return result;
@@ -101873,7 +101961,7 @@ var CubeWithLabeledSides = ({}) => {
101873
101961
  const { camera, scene } = useThree();
101874
101962
  useEffect9(() => {
101875
101963
  if (!scene) return;
101876
- const ambientLight = new THREE6.AmbientLight(16777215, Math.PI / 2);
101964
+ const ambientLight = new THREE7.AmbientLight(16777215, Math.PI / 2);
101877
101965
  scene.add(ambientLight);
101878
101966
  return () => {
101879
101967
  scene.remove(ambientLight);
@@ -101887,16 +101975,16 @@ var CubeWithLabeledSides = ({}) => {
101887
101975
  camera.lookAt(0, 0, 0);
101888
101976
  });
101889
101977
  const group = useMemo8(() => {
101890
- const g = new THREE6.Group();
101978
+ const g = new THREE7.Group();
101891
101979
  g.rotation.fromArray([Math.PI / 2, 0, 0]);
101892
- const box = new THREE6.Mesh(
101893
- new THREE6.BoxGeometry(1, 1, 1),
101894
- new THREE6.MeshStandardMaterial({ color: "white" })
101980
+ const box = new THREE7.Mesh(
101981
+ new THREE7.BoxGeometry(1, 1, 1),
101982
+ new THREE7.MeshStandardMaterial({ color: "white" })
101895
101983
  );
101896
101984
  g.add(box);
101897
- const edges = new THREE6.LineSegments(
101898
- new THREE6.EdgesGeometry(new THREE6.BoxGeometry(1, 1, 1)),
101899
- new THREE6.LineBasicMaterial({ color: 0, linewidth: 2 })
101985
+ const edges = new THREE7.LineSegments(
101986
+ new THREE7.EdgesGeometry(new THREE7.BoxGeometry(1, 1, 1)),
101987
+ new THREE7.LineBasicMaterial({ color: 0, linewidth: 2 })
101900
101988
  );
101901
101989
  g.add(edges);
101902
101990
  return g;
@@ -101909,7 +101997,7 @@ var CubeWithLabeledSides = ({}) => {
101909
101997
  };
101910
101998
  }, [scene, group]);
101911
101999
  return /* @__PURE__ */ jsxs2(Fragment4, { children: [
101912
- /* @__PURE__ */ jsx36(
102000
+ /* @__PURE__ */ jsx37(
101913
102001
  Text,
101914
102002
  {
101915
102003
  parent: group,
@@ -101919,7 +102007,7 @@ var CubeWithLabeledSides = ({}) => {
101919
102007
  children: "Front"
101920
102008
  }
101921
102009
  ),
101922
- /* @__PURE__ */ jsx36(
102010
+ /* @__PURE__ */ jsx37(
101923
102011
  Text,
101924
102012
  {
101925
102013
  parent: group,
@@ -101930,7 +102018,7 @@ var CubeWithLabeledSides = ({}) => {
101930
102018
  children: "Back"
101931
102019
  }
101932
102020
  ),
101933
- /* @__PURE__ */ jsx36(
102021
+ /* @__PURE__ */ jsx37(
101934
102022
  Text,
101935
102023
  {
101936
102024
  parent: group,
@@ -101941,7 +102029,7 @@ var CubeWithLabeledSides = ({}) => {
101941
102029
  children: "Right"
101942
102030
  }
101943
102031
  ),
101944
- /* @__PURE__ */ jsx36(
102032
+ /* @__PURE__ */ jsx37(
101945
102033
  Text,
101946
102034
  {
101947
102035
  parent: group,
@@ -101952,7 +102040,7 @@ var CubeWithLabeledSides = ({}) => {
101952
102040
  children: "Left"
101953
102041
  }
101954
102042
  ),
101955
- /* @__PURE__ */ jsx36(
102043
+ /* @__PURE__ */ jsx37(
101956
102044
  Text,
101957
102045
  {
101958
102046
  parent: group,
@@ -101963,7 +102051,7 @@ var CubeWithLabeledSides = ({}) => {
101963
102051
  children: "Top"
101964
102052
  }
101965
102053
  ),
101966
- /* @__PURE__ */ jsx36(
102054
+ /* @__PURE__ */ jsx37(
101967
102055
  Text,
101968
102056
  {
101969
102057
  parent: group,
@@ -101987,8 +102075,8 @@ import {
101987
102075
  useImperativeHandle,
101988
102076
  useMemo as useMemo9
101989
102077
  } from "react";
101990
- import * as THREE7 from "three";
101991
- import { jsx as jsx37 } from "react/jsx-runtime";
102078
+ import * as THREE8 from "three";
102079
+ import { jsx as jsx38 } from "react/jsx-runtime";
101992
102080
  var Canvas = forwardRef(
101993
102081
  ({ children, scene: sceneProps, camera: cameraProps, style }, ref) => {
101994
102082
  const mountRef = useRef4(null);
@@ -102012,22 +102100,22 @@ var Canvas = forwardRef(
102012
102100
  },
102013
102101
  []
102014
102102
  );
102015
- const scene = useMemo9(() => new THREE7.Scene(), []);
102103
+ const scene = useMemo9(() => new THREE8.Scene(), []);
102016
102104
  if (sceneProps?.up) {
102017
102105
  scene.up.set(sceneProps.up.x, sceneProps.up.y, sceneProps.up.z);
102018
102106
  }
102019
- const rootObject = useRef4(new THREE7.Object3D());
102107
+ const rootObject = useRef4(new THREE8.Object3D());
102020
102108
  useImperativeHandle(ref, () => rootObject.current);
102021
102109
  useEffect10(() => {
102022
102110
  if (!mountRef.current) return;
102023
- const renderer = new THREE7.WebGLRenderer({ antialias: true, alpha: true });
102111
+ const renderer = new THREE8.WebGLRenderer({ antialias: true, alpha: true });
102024
102112
  renderer.setSize(
102025
102113
  mountRef.current.clientWidth,
102026
102114
  mountRef.current.clientHeight
102027
102115
  );
102028
102116
  renderer.setPixelRatio(window.devicePixelRatio);
102029
102117
  mountRef.current.appendChild(renderer.domElement);
102030
- const camera = new THREE7.PerspectiveCamera(
102118
+ const camera = new THREE8.PerspectiveCamera(
102031
102119
  75,
102032
102120
  mountRef.current.clientWidth / mountRef.current.clientHeight,
102033
102121
  0.1,
@@ -102054,7 +102142,7 @@ var Canvas = forwardRef(
102054
102142
  removeFrameListener
102055
102143
  });
102056
102144
  let animationFrameId;
102057
- const clock = new THREE7.Clock();
102145
+ const clock = new THREE8.Clock();
102058
102146
  const animate = () => {
102059
102147
  const time2 = clock.getElapsedTime();
102060
102148
  const delta = clock.getDelta();
@@ -102084,7 +102172,7 @@ var Canvas = forwardRef(
102084
102172
  scene.remove(rootObject.current);
102085
102173
  };
102086
102174
  }, [scene, addFrameListener, removeFrameListener]);
102087
- return /* @__PURE__ */ jsx37("div", { ref: mountRef, style: { width: "100%", height: "100%", ...style }, children: contextState && /* @__PURE__ */ jsx37(ThreeContext.Provider, { value: contextState, children: /* @__PURE__ */ jsx37(HoverProvider, { children }) }) });
102175
+ return /* @__PURE__ */ jsx38("div", { ref: mountRef, style: { width: "100%", height: "100%", ...style }, children: contextState && /* @__PURE__ */ jsx38(ThreeContext.Provider, { value: contextState, children: /* @__PURE__ */ jsx38(HoverProvider, { children }) }) });
102088
102176
  }
102089
102177
  );
102090
102178
 
@@ -102146,7 +102234,7 @@ var OrbitControls3 = ({
102146
102234
 
102147
102235
  // src/react-three/Grid.tsx
102148
102236
  import { useEffect as useEffect12, useMemo as useMemo11 } from "react";
102149
- import * as THREE8 from "three";
102237
+ import * as THREE9 from "three";
102150
102238
  var vertexShader = `
102151
102239
  varying vec3 worldPosition;
102152
102240
  void main() {
@@ -102192,24 +102280,24 @@ var Grid = ({
102192
102280
  const { scene, camera } = useThree();
102193
102281
  const size2 = 1e3;
102194
102282
  const gridMesh = useMemo11(() => {
102195
- const geometry = new THREE8.PlaneGeometry(size2, size2);
102283
+ const geometry = new THREE9.PlaneGeometry(size2, size2);
102196
102284
  geometry.rotateX(-Math.PI / 2);
102197
- const material = new THREE8.ShaderMaterial({
102285
+ const material = new THREE9.ShaderMaterial({
102198
102286
  vertexShader,
102199
102287
  fragmentShader,
102200
102288
  uniforms: {
102201
102289
  cellSize: { value: cellSize },
102202
102290
  sectionSize: { value: sectionSize },
102203
- gridColor: { value: new THREE8.Color(15658734) },
102204
- sectionColor: { value: new THREE8.Color(13421823) },
102291
+ gridColor: { value: new THREE9.Color(15658734) },
102292
+ sectionColor: { value: new THREE9.Color(13421823) },
102205
102293
  fadeDistance: { value: 100 },
102206
102294
  // Fade out based on sectionSize
102207
102295
  fadeStrength: { value: 1.5 }
102208
102296
  },
102209
102297
  transparent: true,
102210
- side: THREE8.DoubleSide
102298
+ side: THREE9.DoubleSide
102211
102299
  });
102212
- const mesh = new THREE8.Mesh(geometry, material);
102300
+ const mesh = new THREE9.Mesh(geometry, material);
102213
102301
  if (rotation2) {
102214
102302
  mesh.rotation.fromArray(rotation2);
102215
102303
  }
@@ -102238,15 +102326,15 @@ var Grid = ({
102238
102326
 
102239
102327
  // src/react-three/Lights.tsx
102240
102328
  import { useEffect as useEffect13, useMemo as useMemo12 } from "react";
102241
- import * as THREE9 from "three";
102329
+ import * as THREE10 from "three";
102242
102330
  var Lights = () => {
102243
102331
  const { scene } = useThree();
102244
102332
  const ambientLight = useMemo12(
102245
- () => new THREE9.AmbientLight(16777215, Math.PI / 2),
102333
+ () => new THREE10.AmbientLight(16777215, Math.PI / 2),
102246
102334
  []
102247
102335
  );
102248
102336
  const pointLight = useMemo12(() => {
102249
- const light = new THREE9.PointLight(16777215, Math.PI / 4);
102337
+ const light = new THREE10.PointLight(16777215, Math.PI / 4);
102250
102338
  light.position.set(-10, -10, 10);
102251
102339
  light.decay = 0;
102252
102340
  return light;
@@ -102264,7 +102352,7 @@ var Lights = () => {
102264
102352
  };
102265
102353
 
102266
102354
  // src/CadViewerContainer.tsx
102267
- import { jsx as jsx38, jsxs as jsxs3 } from "react/jsx-runtime";
102355
+ import { jsx as jsx39, jsxs as jsxs3 } from "react/jsx-runtime";
102268
102356
  var RotationTracker = () => {
102269
102357
  const { camera } = useThree();
102270
102358
  useFrame(() => {
@@ -102295,7 +102383,7 @@ var CadViewerContainer = forwardRef2(
102295
102383
  return desired > 10 ? desired : 10;
102296
102384
  }, [boardDimensions]);
102297
102385
  return /* @__PURE__ */ jsxs3("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
102298
- /* @__PURE__ */ jsx38(
102386
+ /* @__PURE__ */ jsx39(
102299
102387
  "div",
102300
102388
  {
102301
102389
  style: {
@@ -102305,7 +102393,7 @@ var CadViewerContainer = forwardRef2(
102305
102393
  width: 120,
102306
102394
  height: 120
102307
102395
  },
102308
- children: /* @__PURE__ */ jsx38(
102396
+ children: /* @__PURE__ */ jsx39(
102309
102397
  Canvas,
102310
102398
  {
102311
102399
  camera: {
@@ -102313,7 +102401,7 @@ var CadViewerContainer = forwardRef2(
102313
102401
  position: [1, 1, 1]
102314
102402
  },
102315
102403
  style: { zIndex: 10 },
102316
- children: /* @__PURE__ */ jsx38(CubeWithLabeledSides, {})
102404
+ children: /* @__PURE__ */ jsx39(CubeWithLabeledSides, {})
102317
102405
  }
102318
102406
  )
102319
102407
  }
@@ -102322,11 +102410,11 @@ var CadViewerContainer = forwardRef2(
102322
102410
  Canvas,
102323
102411
  {
102324
102412
  ref,
102325
- scene: { up: new THREE10.Vector3(0, 0, 1) },
102413
+ scene: { up: new THREE11.Vector3(0, 0, 1) },
102326
102414
  camera: { up: [0, 0, 1], position: initialCameraPosition },
102327
102415
  children: [
102328
- /* @__PURE__ */ jsx38(RotationTracker, {}),
102329
- isInteractionEnabled && /* @__PURE__ */ jsx38(
102416
+ /* @__PURE__ */ jsx39(RotationTracker, {}),
102417
+ isInteractionEnabled && /* @__PURE__ */ jsx39(
102330
102418
  OrbitControls3,
102331
102419
  {
102332
102420
  autoRotate: !autoRotateDisabled,
@@ -102339,8 +102427,8 @@ var CadViewerContainer = forwardRef2(
102339
102427
  dampingFactor: 0.1
102340
102428
  }
102341
102429
  ),
102342
- /* @__PURE__ */ jsx38(Lights, {}),
102343
- /* @__PURE__ */ jsx38(
102430
+ /* @__PURE__ */ jsx39(Lights, {}),
102431
+ /* @__PURE__ */ jsx39(
102344
102432
  Grid,
102345
102433
  {
102346
102434
  rotation: [Math.PI / 2, 0, 0],
@@ -102372,7 +102460,7 @@ var CadViewerContainer = forwardRef2(
102372
102460
  ]
102373
102461
  }
102374
102462
  ),
102375
- clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx38(
102463
+ clickToInteractEnabled && !isInteractionEnabled && /* @__PURE__ */ jsx39(
102376
102464
  "button",
102377
102465
  {
102378
102466
  type: "button",
@@ -102391,7 +102479,7 @@ var CadViewerContainer = forwardRef2(
102391
102479
  alignItems: "center",
102392
102480
  justifyContent: "center"
102393
102481
  },
102394
- children: /* @__PURE__ */ jsx38(
102482
+ children: /* @__PURE__ */ jsx39(
102395
102483
  "div",
102396
102484
  {
102397
102485
  style: {
@@ -103628,8 +103716,8 @@ var useBoardGeomBuilder = (circuitJson) => {
103628
103716
 
103629
103717
  // src/three-components/Error3d.tsx
103630
103718
  import { useState as useState10, useCallback as useCallback4, useEffect as useEffect17, useMemo as useMemo15 } from "react";
103631
- import * as THREE11 from "three";
103632
- import { Fragment as Fragment5, jsx as jsx39, jsxs as jsxs4 } from "react/jsx-runtime";
103719
+ import * as THREE12 from "three";
103720
+ import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs4 } from "react/jsx-runtime";
103633
103721
  var Error3d = ({
103634
103722
  error,
103635
103723
  cad_component: cad_component2
@@ -103662,7 +103750,7 @@ var Error3d = ({
103662
103750
  return [0, 0, 0];
103663
103751
  }, [cad_component2]);
103664
103752
  const group = useMemo15(() => {
103665
- const g = new THREE11.Group();
103753
+ const g = new THREE12.Group();
103666
103754
  g.position.fromArray(position);
103667
103755
  return g;
103668
103756
  }, [position]);
@@ -103682,8 +103770,8 @@ var Error3d = ({
103682
103770
  onUnhover: handleUnhover,
103683
103771
  object: group,
103684
103772
  children: [
103685
- /* @__PURE__ */ jsx39(ErrorBox, { parent: group }),
103686
- /* @__PURE__ */ jsx39(
103773
+ /* @__PURE__ */ jsx40(ErrorBox, { parent: group }),
103774
+ /* @__PURE__ */ jsx40(
103687
103775
  Text,
103688
103776
  {
103689
103777
  parent: group,
@@ -103698,7 +103786,7 @@ var Error3d = ({
103698
103786
  ]
103699
103787
  }
103700
103788
  ),
103701
- isHovered && hoverPosition ? /* @__PURE__ */ jsx39(
103789
+ isHovered && hoverPosition ? /* @__PURE__ */ jsx40(
103702
103790
  Html,
103703
103791
  {
103704
103792
  position: hoverPosition,
@@ -103722,9 +103810,9 @@ var Error3d = ({
103722
103810
  };
103723
103811
  var ErrorBox = ({ parent }) => {
103724
103812
  const mesh = useMemo15(() => {
103725
- const m = new THREE11.Mesh(
103726
- new THREE11.BoxGeometry(0.5, 0.5, 0.5),
103727
- new THREE11.MeshStandardMaterial({
103813
+ const m = new THREE12.Mesh(
103814
+ new THREE12.BoxGeometry(0.5, 0.5, 0.5),
103815
+ new THREE12.MeshStandardMaterial({
103728
103816
  depthTest: false,
103729
103817
  transparent: true,
103730
103818
  color: "red",
@@ -103746,7 +103834,7 @@ var ErrorBox = ({ parent }) => {
103746
103834
 
103747
103835
  // src/three-components/STLModel.tsx
103748
103836
  import { useState as useState11, useEffect as useEffect18, useMemo as useMemo16 } from "react";
103749
- import * as THREE12 from "three";
103837
+ import * as THREE13 from "three";
103750
103838
  import { STLLoader } from "three-stdlib";
103751
103839
  function STLModel({
103752
103840
  stlUrl,
@@ -103764,12 +103852,12 @@ function STLModel({
103764
103852
  }, [stlUrl]);
103765
103853
  const mesh = useMemo16(() => {
103766
103854
  if (!geom) return null;
103767
- const material = new THREE12.MeshStandardMaterial({
103768
- color: Array.isArray(color) ? new THREE12.Color(color[0], color[1], color[2]) : color,
103855
+ const material = new THREE13.MeshStandardMaterial({
103856
+ color: Array.isArray(color) ? new THREE13.Color(color[0], color[1], color[2]) : color,
103769
103857
  transparent: opacity !== 1,
103770
103858
  opacity
103771
103859
  });
103772
- return new THREE12.Mesh(geom, material);
103860
+ return new THREE13.Mesh(geom, material);
103773
103861
  }, [geom, color, opacity]);
103774
103862
  useEffect18(() => {
103775
103863
  if (!rootObject || !mesh) return;
@@ -103806,7 +103894,7 @@ var ThreeErrorBoundary = class extends React12.Component {
103806
103894
  };
103807
103895
 
103808
103896
  // src/CadViewerJscad.tsx
103809
- import { jsx as jsx40, jsxs as jsxs5 } from "react/jsx-runtime";
103897
+ import { jsx as jsx41, jsxs as jsxs5 } from "react/jsx-runtime";
103810
103898
  var CadViewerJscad = forwardRef3(
103811
103899
  ({
103812
103900
  soup,
@@ -103864,7 +103952,7 @@ var CadViewerJscad = forwardRef3(
103864
103952
  boardDimensions,
103865
103953
  onUserInteraction,
103866
103954
  children: [
103867
- boardStls.map(({ stlUrl, color }, index) => /* @__PURE__ */ jsx40(
103955
+ boardStls.map(({ stlUrl, color }, index) => /* @__PURE__ */ jsx41(
103868
103956
  STLModel,
103869
103957
  {
103870
103958
  stlUrl,
@@ -103873,11 +103961,11 @@ var CadViewerJscad = forwardRef3(
103873
103961
  },
103874
103962
  stlUrl
103875
103963
  )),
103876
- cad_components.map((cad_component2) => /* @__PURE__ */ jsx40(
103964
+ cad_components.map((cad_component2) => /* @__PURE__ */ jsx41(
103877
103965
  ThreeErrorBoundary,
103878
103966
  {
103879
- fallback: ({ error }) => /* @__PURE__ */ jsx40(Error3d, { cad_component: cad_component2, error }),
103880
- children: /* @__PURE__ */ jsx40(
103967
+ fallback: ({ error }) => /* @__PURE__ */ jsx41(Error3d, { cad_component: cad_component2, error }),
103968
+ children: /* @__PURE__ */ jsx41(
103881
103969
  AnyCadComponent,
103882
103970
  {
103883
103971
  cad_component: cad_component2,
@@ -103902,17 +103990,17 @@ import { useEffect as useEffect20, useMemo as useMemo19, useState as useState14
103902
103990
  // src/hooks/useManifoldBoardBuilder.ts
103903
103991
  import { useState as useState13, useEffect as useEffect19, useMemo as useMemo18, useRef as useRef7 } from "react";
103904
103992
  import { su as su12 } from "@tscircuit/circuit-json-util";
103905
- import * as THREE19 from "three";
103993
+ import * as THREE20 from "three";
103906
103994
 
103907
103995
  // src/utils/manifold-mesh-to-three-geometry.ts
103908
- import * as THREE13 from "three";
103996
+ import * as THREE14 from "three";
103909
103997
  function manifoldMeshToThreeGeometry(manifoldMesh) {
103910
- const geometry = new THREE13.BufferGeometry();
103998
+ const geometry = new THREE14.BufferGeometry();
103911
103999
  geometry.setAttribute(
103912
104000
  "position",
103913
- new THREE13.Float32BufferAttribute(manifoldMesh.vertProperties, 3)
104001
+ new THREE14.Float32BufferAttribute(manifoldMesh.vertProperties, 3)
103914
104002
  );
103915
- geometry.setIndex(new THREE13.Uint32BufferAttribute(manifoldMesh.triVerts, 1));
104003
+ geometry.setIndex(new THREE14.Uint32BufferAttribute(manifoldMesh.triVerts, 1));
103916
104004
  if (manifoldMesh.runIndex && manifoldMesh.runIndex.length > 1 && manifoldMesh.runOriginalID) {
103917
104005
  for (let i = 0; i < manifoldMesh.runIndex.length - 1; i++) {
103918
104006
  const start = manifoldMesh.runIndex[i];
@@ -103926,7 +104014,7 @@ function manifoldMeshToThreeGeometry(manifoldMesh) {
103926
104014
  }
103927
104015
 
103928
104016
  // src/utils/trace-texture.ts
103929
- import * as THREE14 from "three";
104017
+ import * as THREE15 from "three";
103930
104018
  import { su as su5 } from "@tscircuit/circuit-json-util";
103931
104019
  function isWireRoutePoint(point2) {
103932
104020
  return point2 && point2.route_type === "wire" && typeof point2.layer === "string" && typeof point2.width === "number";
@@ -104009,10 +104097,10 @@ function createTraceTextureForLayer({
104009
104097
  }
104010
104098
  });
104011
104099
  ctx.globalCompositeOperation = "source-over";
104012
- const texture = new THREE14.CanvasTexture(canvas);
104100
+ const texture = new THREE15.CanvasTexture(canvas);
104013
104101
  texture.generateMipmaps = true;
104014
- texture.minFilter = THREE14.LinearMipmapLinearFilter;
104015
- texture.magFilter = THREE14.LinearFilter;
104102
+ texture.minFilter = THREE15.LinearMipmapLinearFilter;
104103
+ texture.magFilter = THREE15.LinearFilter;
104016
104104
  texture.anisotropy = 16;
104017
104105
  texture.needsUpdate = true;
104018
104106
  return texture;
@@ -104020,7 +104108,7 @@ function createTraceTextureForLayer({
104020
104108
 
104021
104109
  // src/utils/silkscreen-texture.ts
104022
104110
  var import_text2 = __toESM(require_text(), 1);
104023
- import * as THREE15 from "three";
104111
+ import * as THREE16 from "three";
104024
104112
  import { su as su6 } from "@tscircuit/circuit-json-util";
104025
104113
  function createSilkscreenTextureForLayer({
104026
104114
  layer,
@@ -104149,10 +104237,10 @@ function createSilkscreenTextureForLayer({
104149
104237
  ctx.stroke();
104150
104238
  });
104151
104239
  });
104152
- const texture = new THREE15.CanvasTexture(canvas);
104240
+ const texture = new THREE16.CanvasTexture(canvas);
104153
104241
  texture.generateMipmaps = true;
104154
- texture.minFilter = THREE15.LinearMipmapLinearFilter;
104155
- texture.magFilter = THREE15.LinearFilter;
104242
+ texture.minFilter = THREE16.LinearMipmapLinearFilter;
104243
+ texture.magFilter = THREE16.LinearFilter;
104156
104244
  texture.anisotropy = 16;
104157
104245
  texture.needsUpdate = true;
104158
104246
  return texture;
@@ -104225,8 +104313,8 @@ function processNonPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, m
104225
104313
 
104226
104314
  // src/utils/manifold/process-plated-holes.ts
104227
104315
  import { su as su8 } from "@tscircuit/circuit-json-util";
104228
- import * as THREE16 from "three";
104229
- var COPPER_COLOR = new THREE16.Color(...colors.copper);
104316
+ import * as THREE17 from "three";
104317
+ var COPPER_COLOR = new THREE17.Color(...colors.copper);
104230
104318
  function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, manifoldInstancesForCleanup) {
104231
104319
  const platedHoleBoardDrills = [];
104232
104320
  const pcbPlatedHoles = su8(circuitJson).pcb_plated_hole.list();
@@ -104375,7 +104463,7 @@ function processPlatedHolesForManifold(Manifold, circuitJson, pcbThickness, mani
104375
104463
 
104376
104464
  // src/utils/manifold/process-vias.ts
104377
104465
  import { su as su9 } from "@tscircuit/circuit-json-util";
104378
- import * as THREE17 from "three";
104466
+ import * as THREE18 from "three";
104379
104467
 
104380
104468
  // src/utils/via-geoms.ts
104381
104469
  function createViaCopper({
@@ -104408,7 +104496,7 @@ function createViaCopper({
104408
104496
  }
104409
104497
 
104410
104498
  // src/utils/manifold/process-vias.ts
104411
- var COPPER_COLOR2 = new THREE17.Color(...colors.copper);
104499
+ var COPPER_COLOR2 = new THREE18.Color(...colors.copper);
104412
104500
  function processViasForManifold(Manifold, circuitJson, pcbThickness, manifoldInstancesForCleanup) {
104413
104501
  const viaBoardDrills = [];
104414
104502
  const pcbVias = su9(circuitJson).pcb_via.list();
@@ -104454,7 +104542,7 @@ function processViasForManifold(Manifold, circuitJson, pcbThickness, manifoldIns
104454
104542
 
104455
104543
  // src/utils/manifold/process-smt-pads.ts
104456
104544
  import { su as su10 } from "@tscircuit/circuit-json-util";
104457
- import * as THREE18 from "three";
104545
+ import * as THREE19 from "three";
104458
104546
 
104459
104547
  // src/utils/pad-geoms.ts
104460
104548
  function createPadManifoldOp({
@@ -104471,7 +104559,7 @@ function createPadManifoldOp({
104471
104559
  }
104472
104560
 
104473
104561
  // src/utils/manifold/process-smt-pads.ts
104474
- var COPPER_COLOR3 = new THREE18.Color(...colors.copper);
104562
+ var COPPER_COLOR3 = new THREE19.Color(...colors.copper);
104475
104563
  function processSmtPadsForManifold(Manifold, circuitJson, pcbThickness, manifoldInstancesForCleanup) {
104476
104564
  const smtPadGeoms = [];
104477
104565
  const smtPads = su10(circuitJson).pcb_smtpad.list();
@@ -104754,7 +104842,7 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
104754
104842
  const matColorArray = boardMaterialColors[boardData.material] ?? colors.fr4Green;
104755
104843
  currentGeoms.board = {
104756
104844
  geometry: finalBoardGeom,
104757
- color: new THREE19.Color(
104845
+ color: new THREE20.Color(
104758
104846
  matColorArray[0],
104759
104847
  matColorArray[1],
104760
104848
  matColorArray[2]
@@ -104827,16 +104915,16 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
104827
104915
  };
104828
104916
 
104829
104917
  // src/utils/manifold/create-three-geometry-meshes.ts
104830
- import * as THREE20 from "three";
104918
+ import * as THREE21 from "three";
104831
104919
  function createGeometryMeshes(geoms) {
104832
104920
  const meshes = [];
104833
104921
  if (!geoms) return meshes;
104834
104922
  if (geoms.board && geoms.board.geometry) {
104835
- const mesh = new THREE20.Mesh(
104923
+ const mesh = new THREE21.Mesh(
104836
104924
  geoms.board.geometry,
104837
- new THREE20.MeshStandardMaterial({
104925
+ new THREE21.MeshStandardMaterial({
104838
104926
  color: geoms.board.color,
104839
- side: THREE20.DoubleSide,
104927
+ side: THREE21.DoubleSide,
104840
104928
  flatShading: true
104841
104929
  })
104842
104930
  );
@@ -104846,11 +104934,11 @@ function createGeometryMeshes(geoms) {
104846
104934
  const createMeshesFromArray = (geomArray) => {
104847
104935
  if (geomArray) {
104848
104936
  geomArray.forEach((comp) => {
104849
- const mesh = new THREE20.Mesh(
104937
+ const mesh = new THREE21.Mesh(
104850
104938
  comp.geometry,
104851
- new THREE20.MeshStandardMaterial({
104939
+ new THREE21.MeshStandardMaterial({
104852
104940
  color: comp.color,
104853
- side: THREE20.DoubleSide,
104941
+ side: THREE21.DoubleSide,
104854
104942
  flatShading: true
104855
104943
  // Consistent with board
104856
104944
  })
@@ -104867,21 +104955,21 @@ function createGeometryMeshes(geoms) {
104867
104955
  }
104868
104956
 
104869
104957
  // src/utils/manifold/create-three-texture-meshes.ts
104870
- import * as THREE21 from "three";
104958
+ import * as THREE22 from "three";
104871
104959
  function createTextureMeshes(textures, boardData, pcbThickness) {
104872
104960
  const meshes = [];
104873
104961
  if (!textures || !boardData || pcbThickness === null) return meshes;
104874
104962
  const createTexturePlane = (texture, yOffset, isBottomLayer, keySuffix) => {
104875
104963
  if (!texture) return null;
104876
- const planeGeom = new THREE21.PlaneGeometry(boardData.width, boardData.height);
104877
- const material = new THREE21.MeshBasicMaterial({
104964
+ const planeGeom = new THREE22.PlaneGeometry(boardData.width, boardData.height);
104965
+ const material = new THREE22.MeshBasicMaterial({
104878
104966
  map: texture,
104879
104967
  transparent: true,
104880
- side: THREE21.DoubleSide,
104968
+ side: THREE22.DoubleSide,
104881
104969
  depthWrite: false
104882
104970
  // Important for layers to avoid z-fighting issues with board itself
104883
104971
  });
104884
- const mesh = new THREE21.Mesh(planeGeom, material);
104972
+ const mesh = new THREE22.Mesh(planeGeom, material);
104885
104973
  mesh.position.set(boardData.center.x, boardData.center.y, yOffset);
104886
104974
  if (isBottomLayer) {
104887
104975
  mesh.rotation.set(Math.PI, 0, 0);
@@ -104923,7 +105011,7 @@ function createTextureMeshes(textures, boardData, pcbThickness) {
104923
105011
  }
104924
105012
 
104925
105013
  // src/CadViewerManifold.tsx
104926
- import { jsx as jsx41, jsxs as jsxs6 } from "react/jsx-runtime";
105014
+ import { jsx as jsx43, jsxs as jsxs6 } from "react/jsx-runtime";
104927
105015
  var BoardMeshes = ({
104928
105016
  geometryMeshes,
104929
105017
  textureMeshes
@@ -105028,7 +105116,7 @@ var CadViewerManifold = ({
105028
105116
  );
105029
105117
  }
105030
105118
  if (!manifoldJSModule) {
105031
- return /* @__PURE__ */ jsx41("div", { style: { padding: "1em" }, children: "Loading Manifold module..." });
105119
+ return /* @__PURE__ */ jsx43("div", { style: { padding: "1em" }, children: "Loading Manifold module..." });
105032
105120
  }
105033
105121
  if (builderError) {
105034
105122
  return /* @__PURE__ */ jsxs6(
@@ -105048,7 +105136,7 @@ var CadViewerManifold = ({
105048
105136
  );
105049
105137
  }
105050
105138
  if (builderIsLoading) {
105051
- return /* @__PURE__ */ jsx41("div", { style: { padding: "1em" }, children: "Processing board geometry..." });
105139
+ return /* @__PURE__ */ jsx43("div", { style: { padding: "1em" }, children: "Processing board geometry..." });
105052
105140
  }
105053
105141
  return /* @__PURE__ */ jsxs6(
105054
105142
  CadViewerContainer,
@@ -105059,18 +105147,18 @@ var CadViewerManifold = ({
105059
105147
  boardDimensions,
105060
105148
  onUserInteraction,
105061
105149
  children: [
105062
- /* @__PURE__ */ jsx41(
105150
+ /* @__PURE__ */ jsx43(
105063
105151
  BoardMeshes,
105064
105152
  {
105065
105153
  geometryMeshes,
105066
105154
  textureMeshes
105067
105155
  }
105068
105156
  ),
105069
- cadComponents.map((cad_component2) => /* @__PURE__ */ jsx41(
105157
+ cadComponents.map((cad_component2) => /* @__PURE__ */ jsx43(
105070
105158
  ThreeErrorBoundary,
105071
105159
  {
105072
- fallback: ({ error }) => /* @__PURE__ */ jsx41(Error3d, { cad_component: cad_component2, error }),
105073
- children: /* @__PURE__ */ jsx41(
105160
+ fallback: ({ error }) => /* @__PURE__ */ jsx43(Error3d, { cad_component: cad_component2, error }),
105161
+ children: /* @__PURE__ */ jsx43(
105074
105162
  AnyCadComponent,
105075
105163
  {
105076
105164
  cad_component: cad_component2,
@@ -105189,7 +105277,7 @@ var useContextMenu = ({ containerRef }) => {
105189
105277
  };
105190
105278
 
105191
105279
  // src/CadViewer.tsx
105192
- import { jsx as jsx43, jsxs as jsxs7 } from "react/jsx-runtime";
105280
+ import { jsx as jsx44, jsxs as jsxs7 } from "react/jsx-runtime";
105193
105281
  var CadViewer = (props) => {
105194
105282
  const [engine, setEngine] = useState16("manifold");
105195
105283
  const containerRef = useRef9(null);
@@ -105234,14 +105322,14 @@ var CadViewer = (props) => {
105234
105322
  style: { width: "100%", height: "100%", position: "relative" },
105235
105323
  ...contextMenuEventHandlers,
105236
105324
  children: [
105237
- engine === "jscad" ? /* @__PURE__ */ jsx43(
105325
+ engine === "jscad" ? /* @__PURE__ */ jsx44(
105238
105326
  CadViewerJscad,
105239
105327
  {
105240
105328
  ...props,
105241
105329
  autoRotateDisabled: props.autoRotateDisabled || !autoRotate,
105242
105330
  onUserInteraction: handleUserInteraction
105243
105331
  }
105244
- ) : /* @__PURE__ */ jsx43(
105332
+ ) : /* @__PURE__ */ jsx44(
105245
105333
  CadViewerManifold_default,
105246
105334
  {
105247
105335
  ...props,
@@ -105266,7 +105354,7 @@ var CadViewer = (props) => {
105266
105354
  },
105267
105355
  children: [
105268
105356
  "Engine: ",
105269
- /* @__PURE__ */ jsx43("b", { children: engine === "jscad" ? "JSCAD" : "Manifold" })
105357
+ /* @__PURE__ */ jsx44("b", { children: engine === "jscad" ? "JSCAD" : "Manifold" })
105270
105358
  ]
105271
105359
  }
105272
105360
  ),
@@ -105312,7 +105400,7 @@ var CadViewer = (props) => {
105312
105400
  "Switch to ",
105313
105401
  engine === "jscad" ? "Manifold" : "JSCAD",
105314
105402
  " Engine",
105315
- /* @__PURE__ */ jsx43(
105403
+ /* @__PURE__ */ jsx44(
105316
105404
  "span",
105317
105405
  {
105318
105406
  style: {
@@ -105348,12 +105436,12 @@ var CadViewer = (props) => {
105348
105436
  onMouseOver: (e) => e.currentTarget.style.background = "#2d313a",
105349
105437
  onMouseOut: (e) => e.currentTarget.style.background = "transparent",
105350
105438
  children: [
105351
- /* @__PURE__ */ jsx43("span", { style: { marginRight: 8 }, children: autoRotate ? "\u2714" : "" }),
105439
+ /* @__PURE__ */ jsx44("span", { style: { marginRight: 8 }, children: autoRotate ? "\u2714" : "" }),
105352
105440
  "Auto rotate"
105353
105441
  ]
105354
105442
  }
105355
105443
  ),
105356
- /* @__PURE__ */ jsx43(
105444
+ /* @__PURE__ */ jsx44(
105357
105445
  "div",
105358
105446
  {
105359
105447
  style: {
@@ -105464,7 +105552,7 @@ async function load3DModel(url) {
105464
105552
  }
105465
105553
 
105466
105554
  // src/utils/render-component.tsx
105467
- import { jsx as jsx44 } from "react/jsx-runtime";
105555
+ import { jsx as jsx45 } from "react/jsx-runtime";
105468
105556
  var { createJSCADRoot: createJSCADRoot3 } = createJSCADRenderer(import_jscad_planner3.jscadPlanner);
105469
105557
  async function renderComponent(component, scene) {
105470
105558
  const url = component.model_obj_url ?? component.model_stl_url;
@@ -105522,7 +105610,7 @@ async function renderComponent(component, scene) {
105522
105610
  if (component.footprinter_string) {
105523
105611
  const jscadOperations = [];
105524
105612
  const root = createJSCADRoot3(jscadOperations);
105525
- root.render(/* @__PURE__ */ jsx44(Footprinter3d, { footprint: component.footprinter_string }));
105613
+ root.render(/* @__PURE__ */ jsx45(Footprinter3d, { footprint: component.footprinter_string }));
105526
105614
  for (const operation of jscadOperations) {
105527
105615
  const jscadObject = (0, import_jscad_planner3.executeJscadOperations)(import_modeling2.default, operation);
105528
105616
  const threeGeom = convertCSGToThreeGeom(jscadObject);