circuit-json-to-gltf 0.0.43 → 0.0.44

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 +0 -58
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15004,7 +15004,6 @@ var geom33 = __toESM(require_geom3(), 1);
15004
15004
  var import_measureBoundingBox3 = __toESM(require_measureBoundingBox2(), 1);
15005
15005
  var DEFAULT_BOARD_THICKNESS = 1.6;
15006
15006
  var DEFAULT_COMPONENT_HEIGHT = 2;
15007
- var COPPER_THICKNESS = 0.035;
15008
15007
  function convertRotationFromCadRotation(rot) {
15009
15008
  return {
15010
15009
  x: rot.x * Math.PI / 180,
@@ -15117,63 +15116,6 @@ async function convertCircuitJsonTo3D(circuitJson, options = {}) {
15117
15116
  }
15118
15117
  boxes.push(boardBox);
15119
15118
  }
15120
- const pcbPours = db.pcb_copper_pour?.list?.() ?? [];
15121
- for (const pour of pcbPours) {
15122
- const isBottomLayer = pour.layer === "bottom";
15123
- const y = isBottomLayer ? -(effectiveBoardThickness / 2) - COPPER_THICKNESS / 2 : effectiveBoardThickness / 2 + COPPER_THICKNESS / 2;
15124
- if (pour.shape === "rect") {
15125
- const box = {
15126
- center: {
15127
- x: pour.center.x,
15128
- y,
15129
- z: pour.center.y
15130
- },
15131
- size: {
15132
- x: pour.width,
15133
- y: COPPER_THICKNESS,
15134
- z: pour.height
15135
- },
15136
- rotation: { x: 0, y: 0, z: 0 },
15137
- color: pour.covered_with_solder_mask ? pcbColor : copperColor
15138
- };
15139
- if (pour.rotation && typeof pour.rotation === "number") {
15140
- box.rotation.y = -(pour.rotation * Math.PI) / 180;
15141
- }
15142
- boxes.push(box);
15143
- } else if (pour.shape === "polygon") {
15144
- const { points } = pour;
15145
- let center_x = 0;
15146
- let center_y = 0;
15147
- for (const p of points) {
15148
- center_x += p.x;
15149
- center_y += p.y;
15150
- }
15151
- center_x /= points.length;
15152
- center_y /= points.length;
15153
- const relativePoints = points.map((p) => [
15154
- p.x - center_x,
15155
- -(p.y - center_y)
15156
- ]);
15157
- if (arePointsClockwise(relativePoints)) {
15158
- relativePoints.reverse();
15159
- }
15160
- const shape2d = (0, import_primitives3.polygon)({ points: relativePoints });
15161
- let geom = (0, import_extrusions3.extrudeLinear)({ height: COPPER_THICKNESS }, shape2d);
15162
- geom = (0, import_transforms4.translate)([0, 0, -COPPER_THICKNESS / 2], geom);
15163
- geom = (0, import_transforms4.rotateX)(-Math.PI / 2, geom);
15164
- const triangles = geom3ToTriangles(geom);
15165
- const bbox = createBoundingBox((0, import_measureBoundingBox3.default)(geom));
15166
- const mesh = { triangles, boundingBox: bbox };
15167
- const box = {
15168
- center: { x: center_x, y, z: center_y },
15169
- size: { x: 1, y: 1, z: 1 },
15170
- // size doesn't matter much as we provide mesh
15171
- mesh,
15172
- color: pour.covered_with_solder_mask ? pcbColor : copperColor
15173
- };
15174
- boxes.push(box);
15175
- }
15176
- }
15177
15119
  const cadComponents = db.cad_component?.list?.() ?? [];
15178
15120
  const pcbComponentIdsWith3D = /* @__PURE__ */ new Set();
15179
15121
  for (const cad of cadComponents) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "circuit-json-to-gltf",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.43",
5
+ "version": "0.0.44",
6
6
  "scripts": {
7
7
  "test": "bun test tests/",
8
8
  "format": "biome format --write .",