@jwc/jscad-raspberrypi 3.2.0 → 3.3.0

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 (36) hide show
  1. package/.vscode/settings.json +4 -1
  2. package/dist/examples/active-cooling-fan.jscad +210 -171
  3. package/dist/examples/bplus.jscad +209 -170
  4. package/dist/examples/bplus3.jscad +209 -170
  5. package/dist/examples/camera-module-v1.jscad +209 -170
  6. package/dist/examples/camera-module-v2.jscad +209 -170
  7. package/dist/examples/example.jscad +215 -176
  8. package/dist/examples/hat-standoff.jscad +209 -170
  9. package/dist/examples/hat.jscad +209 -170
  10. package/dist/examples/hq_camera-module.jscad +211 -172
  11. package/dist/examples/hyper-pixel-4-rectangular.jscad +2781 -0
  12. package/dist/examples/miniPiTFT.jscad +209 -170
  13. package/dist/examples/pi-tft22.jscad +209 -170
  14. package/dist/examples/pi-tft24 copy.jscad +2750 -0
  15. package/dist/examples/pi-tft24.jscad +209 -170
  16. package/dist/examples/pi4.jscad +210 -171
  17. package/dist/examples/pi5.jscad +215 -179
  18. package/dist/examples/spacer.jscad +209 -170
  19. package/dist/index.js +112 -125
  20. package/dist/v1compat.js +112 -125
  21. package/examples/active-cooling-fan.jscad +1 -1
  22. package/examples/example.jscad +6 -6
  23. package/examples/hq_camera-module.jscad +2 -2
  24. package/examples/hyper-pixel-4-rectangular.jscad +10 -0
  25. package/examples/pi4.jscad +1 -1
  26. package/examples/pi5.jscad +6 -9
  27. package/package.json +3 -3
  28. package/prettier.config.js +7 -0
  29. package/src/active-cooling-fan.js +0 -139
  30. package/src/boardutils.js +11 -4
  31. package/src/bplus.js +102 -62
  32. package/src/hq_camera-module.js +24 -20
  33. package/src/hyper-pixel-4-rectangular.js +58 -0
  34. package/src/index.js +2 -1
  35. package/src/miniPiTFT.js +1 -1
  36. package/src/rpi-parts.js +23 -5
@@ -3,15 +3,12 @@ function main() {
3
3
 
4
4
  var pi = RaspberryPi.BPlus(5, 25);
5
5
 
6
- pi.add(
7
- RaspberryPi.PiTFT24({}, pi.parts.mb).snap(
8
- 'mb',
9
- pi.parts.spacer,
10
- 'z',
11
- 'outside-'
12
- ),
13
- 'screen'
14
- );
6
+ // pi.add(
7
+ // RaspberryPi.PiTFT24({}, pi.parts.mb),
8
+ // 'screen',
9
+ // true,
10
+ // 'screen'
11
+ // );
15
12
 
16
13
  return pi.combineAll().Center();
17
14
  }
@@ -152,7 +149,7 @@ function initJscadutils(_CSG, options = {}) {
152
149
  return divxyz;
153
150
  },
154
151
  get div() {
155
- return div$1;
152
+ return div;
156
153
  },
157
154
  get mulxyz() {
158
155
  return mulxyz;
@@ -284,104 +281,98 @@ function initJscadutils(_CSG, options = {}) {
284
281
  return addConnector;
285
282
  }
286
283
  });
287
- function _typeof(obj) {
288
- "@babel/helpers - typeof";
289
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
290
- _typeof = function(obj) {
291
- return typeof obj;
292
- };
293
- } else {
294
- _typeof = function(obj) {
295
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
296
- };
297
- }
298
- return _typeof(obj);
299
- }
300
- function _defineProperty(obj, key, value) {
301
- if (key in obj) {
302
- Object.defineProperty(obj, key, {
303
- value,
304
- enumerable: true,
305
- configurable: true,
306
- writable: true
307
- });
308
- } else {
309
- obj[key] = value;
310
- }
311
- return obj;
284
+ function _arrayLikeToArray(r, a) {
285
+ (null == a || a > r.length) && (a = r.length);
286
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
287
+ return n;
312
288
  }
313
- function ownKeys(object, enumerableOnly) {
314
- var keys = Object.keys(object);
315
- if (Object.getOwnPropertySymbols) {
316
- var symbols = Object.getOwnPropertySymbols(object);
317
- if (enumerableOnly) symbols = symbols.filter(function(sym) {
318
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
319
- });
320
- keys.push.apply(keys, symbols);
321
- }
322
- return keys;
323
- }
324
- function _objectSpread2(target) {
325
- for (var i = 1; i < arguments.length; i++) {
326
- var source = arguments[i] != null ? arguments[i] : {};
327
- if (i % 2) {
328
- ownKeys(Object(source), true).forEach(function(key) {
329
- _defineProperty(target, key, source[key]);
330
- });
331
- } else if (Object.getOwnPropertyDescriptors) {
332
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
333
- } else {
334
- ownKeys(Object(source)).forEach(function(key) {
335
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
336
- });
289
+ function _arrayWithHoles(r) {
290
+ if (Array.isArray(r)) return r;
291
+ }
292
+ function _defineProperty(e, r, t) {
293
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
294
+ value: t,
295
+ enumerable: !0,
296
+ configurable: !0,
297
+ writable: !0
298
+ }) : e[r] = t, e;
299
+ }
300
+ function _iterableToArrayLimit(r, l) {
301
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
302
+ if (null != t) {
303
+ var e, n, i, u, a = [], f = !0, o = !1;
304
+ try {
305
+ if (i = (t = t.call(r)).next, 0 === l) {
306
+ if (Object(t) !== t) return;
307
+ f = !1;
308
+ } else for (;!(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) ;
309
+ } catch (r) {
310
+ o = !0, n = r;
311
+ } finally {
312
+ try {
313
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
314
+ } finally {
315
+ if (o) throw n;
316
+ }
337
317
  }
318
+ return a;
338
319
  }
339
- return target;
340
320
  }
341
- function _slicedToArray(arr, i) {
342
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
321
+ function _nonIterableRest() {
322
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
343
323
  }
344
- function _arrayWithHoles(arr) {
345
- if (Array.isArray(arr)) return arr;
324
+ function ownKeys(e, r) {
325
+ var t = Object.keys(e);
326
+ if (Object.getOwnPropertySymbols) {
327
+ var o = Object.getOwnPropertySymbols(e);
328
+ r && (o = o.filter(function(r) {
329
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
330
+ })), t.push.apply(t, o);
331
+ }
332
+ return t;
346
333
  }
347
- function _iterableToArrayLimit(arr, i) {
348
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
349
- var _arr = [];
350
- var _n = true;
351
- var _d = false;
352
- var _e = undefined;
353
- try {
354
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
355
- _arr.push(_s.value);
356
- if (i && _arr.length === i) break;
357
- }
358
- } catch (err) {
359
- _d = true;
360
- _e = err;
361
- } finally {
362
- try {
363
- if (!_n && _i["return"] != null) _i["return"]();
364
- } finally {
365
- if (_d) throw _e;
366
- }
334
+ function _objectSpread2(e) {
335
+ for (var r = 1; r < arguments.length; r++) {
336
+ var t = null != arguments[r] ? arguments[r] : {};
337
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
338
+ _defineProperty(e, r, t[r]);
339
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
340
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
341
+ });
367
342
  }
368
- return _arr;
343
+ return e;
344
+ }
345
+ function _slicedToArray(r, e) {
346
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
347
+ }
348
+ function _toPrimitive(t, r) {
349
+ if ("object" != typeof t || !t) return t;
350
+ var e = t[Symbol.toPrimitive];
351
+ if (void 0 !== e) {
352
+ var i = e.call(t, r || "default");
353
+ if ("object" != typeof i) return i;
354
+ throw new TypeError("@@toPrimitive must return a primitive value.");
355
+ }
356
+ return ("string" === r ? String : Number)(t);
369
357
  }
370
- function _unsupportedIterableToArray(o, minLen) {
371
- if (!o) return;
372
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
373
- var n = Object.prototype.toString.call(o).slice(8, -1);
374
- if (n === "Object" && o.constructor) n = o.constructor.name;
375
- if (n === "Map" || n === "Set") return Array.from(o);
376
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
358
+ function _toPropertyKey(t) {
359
+ var i = _toPrimitive(t, "string");
360
+ return "symbol" == typeof i ? i : i + "";
377
361
  }
378
- function _arrayLikeToArray(arr, len) {
379
- if (len == null || len > arr.length) len = arr.length;
380
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
381
- return arr2;
362
+ function _typeof(o) {
363
+ "@babel/helpers - typeof";
364
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
365
+ return typeof o;
366
+ } : function(o) {
367
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
368
+ }, _typeof(o);
382
369
  }
383
- function _nonIterableRest() {
384
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
370
+ function _unsupportedIterableToArray(r, a) {
371
+ if (r) {
372
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
373
+ var t = {}.toString.call(r).slice(8, -1);
374
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
375
+ }
385
376
  }
386
377
  var toRadians = function toRadians(deg) {
387
378
  return deg / 180 * Math.PI;
@@ -441,7 +432,7 @@ function initJscadutils(_CSG, options = {}) {
441
432
  solve90ac,
442
433
  solveab
443
434
  });
444
- var div = function div(a, f) {
435
+ var div$1 = function div(a, f) {
445
436
  return a.map(function(e) {
446
437
  return e / f;
447
438
  });
@@ -496,7 +487,7 @@ function initJscadutils(_CSG, options = {}) {
496
487
  };
497
488
  var array = Object.freeze({
498
489
  __proto__: null,
499
- div,
490
+ div: div$1,
500
491
  addValue,
501
492
  addArray,
502
493
  add,
@@ -846,7 +837,7 @@ function initJscadutils(_CSG, options = {}) {
846
837
  var _scadApi$text = scadApi__default["default"].text, vector_text = _scadApi$text.vector_text, vector_char = _scadApi$text.vector_char;
847
838
  var union = scadApi__default["default"].booleanOps.union;
848
839
  init(CSG);
849
- var debug = Debug("jscadUtils:group");
840
+ var debug$3 = Debug("jscadUtils:group");
850
841
  function JsCadUtilsGroup() {
851
842
  var names = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
852
843
  var parts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -857,7 +848,7 @@ function initJscadutils(_CSG, options = {}) {
857
848
  this.holes = holes;
858
849
  }
859
850
  JsCadUtilsGroup.prototype.add = function(object, name, hidden, subparts, parts) {
860
- debug("add", object, name, hidden, subparts, parts);
851
+ debug$3("add", object, name, hidden, subparts, parts);
861
852
  var self = this;
862
853
  if (object.parts) {
863
854
  if (name) {
@@ -892,13 +883,14 @@ function initJscadutils(_CSG, options = {}) {
892
883
  if (pieces.length === 0) {
893
884
  throw new Error("no pieces found in ".concat(self.name, " pieces: ").concat(pieces, " parts: ").concat(Object.keys(self.parts), " names: ").concat(self.names));
894
885
  }
895
- debug("combine", self.names, self.parts);
886
+ debug$3("combine", self.names, self.parts);
896
887
  var g = union(mapPick(self.parts, pieces, function(value, key, index, object) {
888
+ debug$3("combine mapPick", value, key, object);
897
889
  return map ? map(value, key, index, object) : identity(value);
898
890
  }, self.name));
899
891
  return g.subtractIf(self.holes && Array.isArray(self.holes) ? union(self.holes) : self.holes, self.holes && !options.noholes);
900
892
  } catch (err) {
901
- debug("combine error", this, pieces, options, err);
893
+ debug$3("combine error", this, pieces, options, err);
902
894
  throw error('group::combine error "'.concat(err.message || err.toString(), '"\nthis: ').concat(this, '\npieces: "').concat(pieces, '"\noptions: ').concat(JSON.stringify(options, null, 2), "\nstack: ").concat(err.stack, "\n"), "JSCAD_UTILS_GROUP_ERROR");
903
895
  }
904
896
  };
@@ -922,7 +914,7 @@ function initJscadutils(_CSG, options = {}) {
922
914
  return self;
923
915
  };
924
916
  JsCadUtilsGroup.prototype.clone = function(name, map) {
925
- debug("clone", name, _typeof(name), map);
917
+ debug$3("clone", name, _typeof(name), map);
926
918
  var self = this;
927
919
  if (typeof name == "function") {
928
920
  map = name;
@@ -973,7 +965,7 @@ function initJscadutils(_CSG, options = {}) {
973
965
  });
974
966
  return self;
975
967
  } catch (err) {
976
- debug("snap error", this, part, to, axis, delta, err);
968
+ debug$3("snap error", this, part, to, axis, delta, err);
977
969
  throw error('group::snap error "'.concat(err.message || err.toString(), '"\nthis: ').concat(this, '\npart: "').concat(part, '"\nto: ').concat(to, '\naxis: "').concat(axis, '"\norientation: "').concat(orientation, '"\ndelta: "').concat(delta, '"\nstack: ').concat(err.stack, "\n"), "JSCAD_UTILS_GROUP_ERROR");
978
970
  }
979
971
  };
@@ -988,7 +980,7 @@ function initJscadutils(_CSG, options = {}) {
988
980
  });
989
981
  return self;
990
982
  } catch (err) {
991
- debug("align error", this, part, to, axis, delta, err);
983
+ debug$3("align error", this, part, to, axis, delta, err);
992
984
  throw error('group::align error "'.concat(err.message || err.toString(), '"\nthis: ').concat(this, '\npart: "').concat(part, '"\nto: ').concat(to, '\naxis: "').concat(axis, '"\ndelta: "').concat(delta, '"\nstack: ').concat(err.stack, "\n"), "JSCAD_UTILS_GROUP_ERROR");
993
985
  }
994
986
  };
@@ -1004,7 +996,7 @@ function initJscadutils(_CSG, options = {}) {
1004
996
  JsCadUtilsGroup.prototype.connectTo = function connectTo(partName, connectorName, to, toConnectorName) {
1005
997
  var mirror = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1006
998
  var normalrotation = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
1007
- debug("connectTo", {
999
+ debug$3("connectTo", {
1008
1000
  partName,
1009
1001
  connectorName,
1010
1002
  to,
@@ -1016,12 +1008,12 @@ function initJscadutils(_CSG, options = {}) {
1016
1008
  var myConnector = connectorName.split(".").reduce(function(a, v) {
1017
1009
  return a[v];
1018
1010
  }, self.parts[partName].properties);
1019
- debug("toConnector", to instanceof CSG.Connector);
1011
+ debug$3("toConnector", to instanceof CSG.Connector);
1020
1012
  var toConnector = toConnectorName.split(".").reduce(function(a, v) {
1021
1013
  return a[v];
1022
1014
  }, to.properties);
1023
1015
  var matrix = myConnector.getTransformationTo(toConnector, mirror, normalrotation);
1024
- debug("connectTo", matrix);
1016
+ debug$3("connectTo", matrix);
1025
1017
  self.map(function(part) {
1026
1018
  return part.transform(matrix);
1027
1019
  });
@@ -1041,7 +1033,7 @@ function initJscadutils(_CSG, options = {}) {
1041
1033
  JsCadUtilsGroup.prototype.translate = function translate(x, y, z) {
1042
1034
  var self = this;
1043
1035
  var t = Array.isArray(x) ? x : [ x, y, z ];
1044
- debug("translate", t);
1036
+ debug$3("translate", t);
1045
1037
  self.map(function(part) {
1046
1038
  return part.translate(t);
1047
1039
  });
@@ -1065,7 +1057,7 @@ function initJscadutils(_CSG, options = {}) {
1065
1057
  var a = [];
1066
1058
  p.forEach(function(name) {
1067
1059
  if (!self.parts[name]) {
1068
- debug("array error", _this, parts);
1060
+ debug$3("array error", _this, parts);
1069
1061
  throw error('group::array error "'.concat(name, '" not found.\nthis: ').concat(_this, '\nparts: "').concat(parts, '"\n'), "JSCAD_UTILS_GROUP_ERROR");
1070
1062
  }
1071
1063
  a.push(map(CSG.fromPolygons(self.parts[name].toPolygons()), name));
@@ -1081,14 +1073,14 @@ function initJscadutils(_CSG, options = {}) {
1081
1073
  });
1082
1074
  };
1083
1075
  JsCadUtilsGroup.prototype.toString = function() {
1084
- return '{\n name: "'.concat(this.name, '",\n names: "').concat(this.names.join(","), '", \n parts: "').concat(Object.keys(this.parts), '",\n holes: "').concat(this.holes, '"\n}');
1076
+ return '{\n name: "'.concat(this.name, '",\n names: "').concat(this.names.join(","), '", \n parts: "').concat(Object.keys(this.parts), '",\n holes: ').concat(Array.isArray(this.holes) ? this.holes.length : this.holes ? 1 : 0, "\n}");
1085
1077
  };
1086
1078
  JsCadUtilsGroup.prototype.setName = function(name) {
1087
1079
  this.name = name;
1088
1080
  return this;
1089
1081
  };
1090
1082
  function Group(objectNames, addObjects) {
1091
- debug("Group", objectNames, addObjects);
1083
+ debug$3("Group", objectNames, addObjects);
1092
1084
  var self = {
1093
1085
  name: "",
1094
1086
  names: [],
@@ -1121,7 +1113,7 @@ function initJscadutils(_CSG, options = {}) {
1121
1113
  }
1122
1114
  return new JsCadUtilsGroup(self.names, self.parts, self.holes);
1123
1115
  }
1124
- var debug$1 = Debug("jscadUtils:util");
1116
+ var debug$2 = Debug("jscadUtils:util");
1125
1117
  var NOZZEL_SIZE = .4;
1126
1118
  var nearest = {
1127
1119
  under: function under(desired) {
@@ -1156,7 +1148,7 @@ function initJscadutils(_CSG, options = {}) {
1156
1148
  return ((n = +n) || 1 / n) < 0;
1157
1149
  }
1158
1150
  function print(msg, o) {
1159
- debug$1(msg, JSON.stringify(o.getBounds()), JSON.stringify(this.size(o.getBounds())));
1151
+ debug$2(msg, JSON.stringify(o.getBounds()), JSON.stringify(this.size(o.getBounds())));
1160
1152
  }
1161
1153
  function jscadToString(o) {
1162
1154
  if (_typeof(o) == "object") {
@@ -1217,7 +1209,7 @@ function initJscadutils(_CSG, options = {}) {
1217
1209
  });
1218
1210
  }
1219
1211
  function unitAxis(length, radius, centroid) {
1220
- debug$1("unitAxis", length, radius, centroid);
1212
+ debug$2("unitAxis", length, radius, centroid);
1221
1213
  centroid = centroid || [ 0, 0, 0 ];
1222
1214
  var unitaxis = unitCube(length, radius).setColor(1, 0, 0).union([ unitCube(length, radius).rotateY(90).setColor(0, 1, 0), unitCube(length, radius).rotateX(90).setColor(0, 0, 1) ]);
1223
1215
  unitaxis.properties.origin = new CSG.Connector([ 0, 0, 0 ], [ 1, 0, 0 ], [ 0, 1, 0 ]);
@@ -1270,7 +1262,7 @@ function initJscadutils(_CSG, options = {}) {
1270
1262
  }, []);
1271
1263
  }
1272
1264
  function divA(a, f) {
1273
- return div(a, f);
1265
+ return div$1(a, f);
1274
1266
  }
1275
1267
  function divxyz(size, x, y, z) {
1276
1268
  return {
@@ -1279,7 +1271,7 @@ function initJscadutils(_CSG, options = {}) {
1279
1271
  z: size.z / z
1280
1272
  };
1281
1273
  }
1282
- function div$1(size, d) {
1274
+ function div(size, d) {
1283
1275
  return this.divxyz(size, d, d, d);
1284
1276
  }
1285
1277
  function mulxyz(size, x, y, z) {
@@ -1430,7 +1422,7 @@ function initJscadutils(_CSG, options = {}) {
1430
1422
  }) : t;
1431
1423
  }
1432
1424
  function snap(moveobj, withobj, axis, orientation, delta) {
1433
- debug$1("snap", moveobj, withobj, axis, orientation, delta);
1425
+ debug$2("snap", moveobj, withobj, axis, orientation, delta);
1434
1426
  var t = calcSnap(moveobj, withobj, axis, orientation, delta);
1435
1427
  return moveobj.translate(t);
1436
1428
  }
@@ -1438,7 +1430,7 @@ function initJscadutils(_CSG, options = {}) {
1438
1430
  return moveobj.translate(calcFlush(moveobj, withobj, axis, mside, wside));
1439
1431
  }
1440
1432
  function axisApply(axes, valfun, a) {
1441
- debug$1("axisApply", axes, valfun, a);
1433
+ debug$2("axisApply", axes, valfun, a);
1442
1434
  var retval = a || [ 0, 0, 0 ];
1443
1435
  var lookup = {
1444
1436
  x: 0,
@@ -1582,7 +1574,7 @@ function initJscadutils(_CSG, options = {}) {
1582
1574
  }));
1583
1575
  var theRotationAxis = rotationAxes[rotateaxis];
1584
1576
  var cutplane = CSG.OrthoNormalBasis.GetCartesian(info.orthoNormalCartesian[0], info.orthoNormalCartesian[1]).translate(cutDelta).rotate(rotationCenter, theRotationAxis, angle);
1585
- debug$1("bisect", debug$1.enabled && {
1577
+ debug$2("bisect", debug$2.enabled && {
1586
1578
  axis,
1587
1579
  offset,
1588
1580
  angle,
@@ -1663,21 +1655,18 @@ function initJscadutils(_CSG, options = {}) {
1663
1655
  return CSG.fromPolygons(polygons);
1664
1656
  }
1665
1657
  function slices2poly(slices, options, axis) {
1666
- debug$1("slices2poly", slices, options, axis);
1658
+ debug$2("slices2poly", slices, options, axis);
1667
1659
  options = Object.assign({
1668
1660
  twistangle: 0,
1669
1661
  twiststeps: 0
1670
1662
  }, options);
1671
1663
  var twistangle = options && parseFloat(options.twistangle) || 0;
1672
- var twiststeps = options && parseInt(options.twiststeps) || CSG.defaultResolution3D;
1673
- if (twistangle == 0 || twiststeps < 1) {
1674
- twiststeps = 1;
1675
- }
1664
+ options && parseInt(options.twiststeps) || CSG.defaultResolution3D;
1676
1665
  var normalVector = options.si.normalVector;
1677
1666
  var polygons = [];
1678
1667
  var first$1 = first(slices);
1679
1668
  var last$1 = last(slices);
1680
- debug$1("slices2poly first", first$1, first$1.offset, "last", last$1);
1669
+ debug$2("slices2poly first", first$1, first$1.offset, "last", last$1);
1681
1670
  var up = first$1.offset[axis] > last$1.offset[axis];
1682
1671
  polygons = polygons.concat(first$1.poly._toPlanePolygons({
1683
1672
  translation: first$1.offset,
@@ -1763,7 +1752,7 @@ function initJscadutils(_CSG, options = {}) {
1763
1752
  var b = object.getBounds();
1764
1753
  var absoluteRadius = Math.abs(radius);
1765
1754
  var si = sliceParams(orientation, radius, b);
1766
- debug$1("reShape", absoluteRadius, si);
1755
+ debug$2("reShape", absoluteRadius, si);
1767
1756
  if (si.axis !== "z") throw new Error('reShape error: CAG._toPlanePolytons only uses the "z" axis. You must use the "z" axis for now.');
1768
1757
  var cutplane = CSG.OrthoNormalBasis.GetCartesian(si.orthoNormalCartesian[0], si.orthoNormalCartesian[1]).translate(si.cutDelta);
1769
1758
  var slice = object.sectionCut(cutplane);
@@ -1774,7 +1763,7 @@ function initJscadutils(_CSG, options = {}) {
1774
1763
  return si.positive ? absoluteRadius : 0;
1775
1764
  });
1776
1765
  var plane = si.positive ? cutplane.plane : cutplane.plane.flipped();
1777
- debug$1("reShape first/last", first, last);
1766
+ debug$2("reShape first/last", first, last);
1778
1767
  var slices = slicer(first, last, slice, radius);
1779
1768
  var delta = slices2poly(slices, Object.assign(options, {
1780
1769
  si
@@ -1838,7 +1827,7 @@ function initJscadutils(_CSG, options = {}) {
1838
1827
  function clone(o) {
1839
1828
  var c = CSG.fromPolygons(o.toPolygons());
1840
1829
  cloneProperties(o, c);
1841
- debug$1("clone", o, c, CSG);
1830
+ debug$2("clone", o, c, CSG);
1842
1831
  return c;
1843
1832
  }
1844
1833
  function addConnector(object, name) {
@@ -1848,15 +1837,15 @@ function initJscadutils(_CSG, options = {}) {
1848
1837
  object.properties[name] = new CSG.Connector(point, axis, normal);
1849
1838
  return object;
1850
1839
  }
1851
- var debug$2 = Debug("jscadUtils:parts");
1840
+ var debug$1 = Debug("jscadUtils:parts");
1852
1841
  var parts = {
1853
- BBox,
1842
+ BBox: BBox$1,
1854
1843
  Cube,
1855
1844
  RoundedCube,
1856
1845
  Cylinder,
1857
1846
  Cone
1858
1847
  };
1859
- function BBox() {
1848
+ function BBox$1() {
1860
1849
  function box(object) {
1861
1850
  return CSG.cube({
1862
1851
  center: object.centroid(),
@@ -1872,7 +1861,7 @@ function initJscadutils(_CSG, options = {}) {
1872
1861
  }, undefined);
1873
1862
  }
1874
1863
  function Cube(width) {
1875
- var r = div(fromxyz(width), 2);
1864
+ var r = div$1(fromxyz(width), 2);
1876
1865
  return CSG.cube({
1877
1866
  center: r,
1878
1867
  radius: r
@@ -1887,7 +1876,7 @@ function initJscadutils(_CSG, options = {}) {
1887
1876
  } else {
1888
1877
  var r = [ x / 2, y / 2 ];
1889
1878
  }
1890
- debug$2("RoundedCube", size$1, r, thickness, corner_radius);
1879
+ debug$1("RoundedCube", size$1, r, thickness, corner_radius);
1891
1880
  var roundedcube = CAG.roundedRectangle({
1892
1881
  center: [ r[0], r[1], 0 ],
1893
1882
  radius: r,
@@ -1900,7 +1889,7 @@ function initJscadutils(_CSG, options = {}) {
1900
1889
  }
1901
1890
  function Cylinder(diameter, height) {
1902
1891
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1903
- debug$2("parts.Cylinder", diameter, height, options);
1892
+ debug$1("parts.Cylinder", diameter, height, options);
1904
1893
  options = Object.assign({
1905
1894
  start: [ 0, 0, 0 ],
1906
1895
  end: [ 0, 0, height ],
@@ -1911,7 +1900,7 @@ function initJscadutils(_CSG, options = {}) {
1911
1900
  }
1912
1901
  function Cone(diameter1, diameter2, height) {
1913
1902
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1914
- debug$2("parts.Cone", diameter1, diameter2, height, options);
1903
+ debug$1("parts.Cone", diameter1, diameter2, height, options);
1915
1904
  return CSG.cylinder(Object.assign({
1916
1905
  start: [ 0, 0, 0 ],
1917
1906
  end: [ 0, 0, height ],
@@ -1921,7 +1910,7 @@ function initJscadutils(_CSG, options = {}) {
1921
1910
  }, options));
1922
1911
  }
1923
1912
  function Hexagon(diameter, height) {
1924
- debug$2("hexagon", diameter, height);
1913
+ debug$1("hexagon", diameter, height);
1925
1914
  var radius = diameter / 2;
1926
1915
  var sqrt3 = Math.sqrt(3) / 2;
1927
1916
  var hex = CAG.fromPoints([ [ radius, 0 ], [ radius / 2, radius * sqrt3 ], [ -radius / 2, radius * sqrt3 ], [ -radius, 0 ], [ -radius / 2, -radius * sqrt3 ], [ radius / 2, -radius * sqrt3 ] ]);
@@ -2019,7 +2008,7 @@ function initJscadutils(_CSG, options = {}) {
2019
2008
  var parts$1 = Object.freeze({
2020
2009
  __proto__: null,
2021
2010
  default: parts,
2022
- BBox,
2011
+ BBox: BBox$1,
2023
2012
  Cube,
2024
2013
  RoundedCube,
2025
2014
  Cylinder,
@@ -2031,13 +2020,13 @@ function initJscadutils(_CSG, options = {}) {
2031
2020
  Board,
2032
2021
  Hardware
2033
2022
  });
2034
- var debug$3 = Debug("jscadUtils:boxes");
2023
+ var debug = Debug("jscadUtils:boxes");
2035
2024
  function RabbetJoin(box, thickness, cutHeight) {
2036
2025
  depreciated("RabbetJoin", true, "Use 'Rabbet' instead");
2037
2026
  return rabbetJoin(box, thickness, cutHeight);
2038
2027
  }
2039
2028
  function topMiddleBottom(box, thickness) {
2040
- debug$3("TopMiddleBottom", box, thickness);
2029
+ debug("TopMiddleBottom", box, thickness);
2041
2030
  var bottom = box.bisect("z", thickness, {
2042
2031
  color: true
2043
2032
  });
@@ -2046,11 +2035,11 @@ function initJscadutils(_CSG, options = {}) {
2046
2035
  }
2047
2036
  function Rabett(box, thickness, gap, height, face) {
2048
2037
  var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
2049
- debug$3("Rabett", "thickness", thickness, "gap", gap, "height", height, "face", face);
2038
+ debug("Rabett", "thickness", thickness, "gap", gap, "height", height, "face", face);
2050
2039
  gap = gap || .25;
2051
2040
  var inside = thickness - gap;
2052
2041
  var outside = -thickness + gap;
2053
- debug$3("inside", inside, "outside", outside);
2042
+ debug("inside", inside, "outside", outside);
2054
2043
  var group = Group();
2055
2044
  var _box$bisect$parts = box.bisect("z", height, options).parts, top = _box$bisect$parts.positive, lower2_3rd = _box$bisect$parts.negative;
2056
2045
  var lowerBisectHeight = Math.sign(height) < 0 ? face * Math.sign(height) : height - face;
@@ -2072,7 +2061,7 @@ function initJscadutils(_CSG, options = {}) {
2072
2061
  topWidth: -thickness,
2073
2062
  bottomWidth: thickness
2074
2063
  }, options);
2075
- debug$3("RabettTopBottom", box, thickness, gap, options);
2064
+ debug("RabettTopBottom", box, thickness, gap, options);
2076
2065
  var group = Group("", {
2077
2066
  box
2078
2067
  });
@@ -2118,7 +2107,7 @@ function initJscadutils(_CSG, options = {}) {
2118
2107
  };
2119
2108
  var Rectangle = function Rectangle(size, thickness, cb) {
2120
2109
  thickness = thickness || 2;
2121
- var s = div(xyz2array(size), 2);
2110
+ var s = div$1(xyz2array(size), 2);
2122
2111
  var r = add(s, thickness);
2123
2112
  var box = CSG.cube({
2124
2113
  center: r,
@@ -2138,16 +2127,16 @@ function initJscadutils(_CSG, options = {}) {
2138
2127
  if (exteriorcb) box = exteriorcb(box);
2139
2128
  return box;
2140
2129
  };
2141
- var BBox$1 = function BBox(o) {
2130
+ var BBox = function BBox(o) {
2142
2131
  depreciated("BBox", true, "Use 'parts.BBox' instead");
2143
- var s = div(xyz2array(o.size()), 2);
2132
+ var s = div$1(xyz2array(o.size()), 2);
2144
2133
  return CSG.cube({
2145
2134
  center: s,
2146
2135
  radius: s
2147
2136
  }).align(o, "xyz");
2148
2137
  };
2149
2138
  function getRadius(o) {
2150
- return div(xyz2array(o.size()), 2);
2139
+ return div$1(xyz2array(o.size()), 2);
2151
2140
  }
2152
2141
  function rabbetJoin(box, thickness) {
2153
2142
  var gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .25;
@@ -2175,7 +2164,7 @@ function initJscadutils(_CSG, options = {}) {
2175
2164
  CutOut,
2176
2165
  Rectangle,
2177
2166
  Hollow,
2178
- BBox: BBox$1
2167
+ BBox
2179
2168
  });
2180
2169
  var compatV1 = _objectSpread2(_objectSpread2({}, util), {}, {
2181
2170
  group: Group,
@@ -2195,6 +2184,9 @@ function initJscadutils(_CSG, options = {}) {
2195
2184
  exports.parts = parts$1;
2196
2185
  exports.triUtils = triUtils;
2197
2186
  exports.util = util;
2187
+ Object.defineProperty(exports, "__esModule", {
2188
+ value: true
2189
+ });
2198
2190
  return exports;
2199
2191
  }({}, jsCadCSG, scadApi);
2200
2192
  const debug = jscadUtils.Debug("jscadUtils:initJscadutils");
@@ -2269,7 +2261,8 @@ function initJscadRPi() {
2269
2261
  jsCadCSG.CSG;
2270
2262
  scadApi.booleanOps.union;
2271
2263
  function RightSide(o, mb) {
2272
- return o.translate(jscadUtils.array.add(o.calcSnap(mb, "z", "outside-"), o.calcSnap(mb, "x", "inside+"), o.calcSnap(mb, "y", "inside-"), [ 2, 0, 0 ]));
2264
+ var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [ 2, 0, 0 ];
2265
+ return o.translate(jscadUtils.array.add(o.calcSnap(mb, "z", "outside-"), o.calcSnap(mb, "x", "inside+"), o.calcSnap(mb, "y", "inside-"), offset));
2273
2266
  }
2274
2267
  function LeftSide(o, mb) {
2275
2268
  return o.translate(calcLeftSide(o, mb));
@@ -2322,9 +2315,20 @@ function initJscadRPi() {
2322
2315
  var cyl = jscadUtils.parts.Cylinder(6, 2).rotateX(90).align(block, "xz").snap(block, "y", "outside+").color("black");
2323
2316
  return jscadUtils.Group("block,cylinder", [ block, cyl ]);
2324
2317
  }
2318
+ function PSW() {
2319
+ var block = jscadUtils.parts.Cube([ 2.8, 4.5, 3.7 ]).color("gray");
2320
+ var cyl = jscadUtils.parts.Cylinder(2, 1).rotateY(90).align(block, "yz").snap(block, "x", "outside+").color("black");
2321
+ return jscadUtils.Group("block,button", [ block, cyl ]);
2322
+ }
2325
2323
  function Ribbon() {
2326
2324
  return jscadUtils.parts.Cube([ 3, 22.4, 5.7 ]).color("gray");
2327
2325
  }
2326
+ function CamDisplay() {
2327
+ return jscadUtils.parts.Cube([ 3, 16, 5 ]).color("gray");
2328
+ }
2329
+ function PCIe() {
2330
+ return jscadUtils.parts.Cube([ 3, 12, 5 ]).color("gray");
2331
+ }
2328
2332
  function Gpio(mb) {
2329
2333
  var gpio = jscadUtils.parts.Cube([ 50.64, 5, 8.72 ]).color("gray");
2330
2334
  return mb ? gpio.snap(mb, "xy", "inside-").snap(mb, "z", "outside-").midlineTo("x", 32.5).midlineTo("y", 52.5) : gpio;
@@ -2332,13 +2336,13 @@ function initJscadRPi() {
2332
2336
  function BoardLed() {
2333
2337
  return jscadUtils.parts.Cube([ 1, 2, .7 ]);
2334
2338
  }
2335
- var debug$2 = jscadUtils.Debug("jscadRPi:BPlusMounting");
2339
+ var debug$4 = jscadUtils.Debug("jscadRPi:BPlusMounting");
2336
2340
  function holes(mb) {
2337
2341
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2338
2342
  options = Object.assign(options, {
2339
2343
  height: 8
2340
2344
  });
2341
- debug$2("holes", mb, options);
2345
+ debug$4("holes", mb, options);
2342
2346
  var hole = MountingHole(options.diameter || 3.25, options.height).snap(mb, "xy", "inside-").align(mb, "z");
2343
2347
  var holes = [ hole.midlineTo("x", 3.5).midlineTo("y", 3.5), hole.midlineTo("x", 61.5).midlineTo("y", 3.5), hole.midlineTo("x", 3.5).midlineTo("y", 52.5), hole.midlineTo("x", 61.5).midlineTo("y", 52.5) ];
2344
2348
  return jscadUtils.Group("hole1,hole2,hole3,hole4", holes);
@@ -2357,9 +2361,9 @@ function initJscadRPi() {
2357
2361
  holes,
2358
2362
  pads
2359
2363
  };
2360
- var debug$1 = jscadUtils.Debug("jscadRPi:BPlus");
2364
+ var debug$3 = jscadUtils.Debug("jscadRPi:BPlus");
2361
2365
  function pi4(group, clearance, mb) {
2362
- group.add(RightSide(jscadUtils.parts.Cube([ 21.5, 16.5, 13.5 ]).color("lightgray"), mb).translate([ 2, 0, 0 ]).midlineTo("y", 45.75), "ethernet");
2366
+ group.add(RightSide(jscadUtils.parts.Cube([ 21.5, 16.5, 13.5 ]).color("lightgray"), mb, [ 3, 0, 0 ]).midlineTo("y", 45.75), "ethernet");
2363
2367
  group.add(jscadUtils.parts.Cube([ clearance, 16.5, 13.5 ]).align(group.parts.ethernet, "yz").snap(group.parts.ethernet, "x", "outside-").color("red"), "clearance-ethernet", true, "clearance");
2364
2368
  var usb = jscadUtils.Group();
2365
2369
  usb.add(jscadUtils.parts.Cube([ 17, 13.1, 15 ]).snap(group.parts.ethernet, "x", "inside+", -1).snap(mb, "z", "outside-", 1.5).color("lightgray"), "body");
@@ -2383,30 +2387,31 @@ function initJscadRPi() {
2383
2387
  group.add(BoardLed().snap(mb, "z", "outside-").midlineTo("x", 1.1).midlineTo("y", 12).color("red"), "powerled");
2384
2388
  }
2385
2389
  function pi5(group, clearance, mb) {
2386
- group.add(jscadUtils.parts.Cube([ 12, 12, 3 ]).color("lightgray").translate([ 24, 15, 2 ]), "cpu");
2387
- group.add(jscadUtils.parts.Cube([ 12, 12, clearance ]).color("red").translate([ 24, 15, 2 ]), "clearance-cpu", true, "clearance");
2388
- group.add(RightSide(jscadUtils.parts.Cube([ 21.5, 16.5, 13.5 ]).color("lightgray"), mb).translate([ 2, 0, 0 ]).midlineTo("y", 10.2), "ethernet");
2390
+ group.add(jscadUtils.parts.Cube([ 17, 17, 3 ]).color("lightgray").translate([ 0, 15, 0 ]).midlineTo("x", 29 + 3.5).snap(group.parts.mb, "z", "outside-"), "cpu");
2391
+ group.add(jscadUtils.parts.Cube([ 17, 17, clearance ]).color("red").align(group.parts.cpu, "xy").snap(group.parts.cpu, "z", "outside-"), "clearance-cpu", true, "clearance");
2392
+ group.add(RightSide(jscadUtils.parts.Cube([ 21.5, 16.5, 13.5 ]).color("lightgray"), mb, [ 3, 0, 0 ]).midlineTo("y", 10.2), "ethernet");
2389
2393
  group.add(jscadUtils.parts.Cube([ clearance, 16.5, 13.5 ]).align(group.parts.ethernet, "yz").snap(group.parts.ethernet, "x", "outside-").color("red"), "clearance-ethernet", true, "clearance");
2390
2394
  var usb = jscadUtils.Group();
2391
- usb.add(jscadUtils.parts.Cube([ 17, 13.1, 15 ]).snap(group.parts.ethernet, "x", "inside+", -1).snap(mb, "z", "outside-", 1.5).color("lightgray"), "body");
2392
- usb.add(jscadUtils.parts.Cube([ 1, 15, 16 ]).snap(usb.parts.body, "x", "outside-").align(usb.parts.body, "yz").color("lightgray"), "flange");
2393
- group.add(usb.clone().translate(jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 29.7)), "usb1", false, "usb1");
2394
- group.add(jscadUtils.parts.Cube([ clearance, 15, 16 ]).align(group.parts.usb1, "yz").snap(group.parts.usb1, "x", "outside-").color("red"), "clearance-usb1", true);
2395
+ usb.add(jscadUtils.parts.Cube([ 17, 13.1, 15 ]).snap(group.parts.ethernet, "x", "inside+", -1).snap(mb, "z", "outside-", .5).color("lightgray"), "body");
2396
+ usb.add(jscadUtils.parts.Cube([ 1, 15, 16.5 ]).snap(usb.parts.body, "x", "outside-").align(usb.parts.body, "yz").color("lightgray"), "flange");
2397
+ group.add(usb.clone().translate(jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 29.1)), "usb1", false, "usb1");
2398
+ group.add(jscadUtils.parts.Cube([ clearance, 15, 16.5 ]).align(group.parts.usb1, "yz").snap(group.parts.usb1, "x", "outside-").color("red"), "clearance-usb1", true);
2395
2399
  group.add(usb.clone().translate(jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 47)), "usb2", false, "usb2");
2396
2400
  group.add(jscadUtils.parts.Cube([ clearance, 15, 16 ]).align(group.parts.usb2, "yz").snap(group.parts.usb2, "x", "outside-").color("red"), "clearance-usb2", true);
2397
- group.add(jscadUtils.parts.Cube([ 10, 7.5, 3.2 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 3.5 + 7.7).color("lightgray"), "usbc");
2401
+ group.add(jscadUtils.parts.Cube([ 10, 7.5, 3.2 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 11.2).color("lightgray"), "usbc");
2398
2402
  group.add(jscadUtils.parts.Cube([ 10, clearance, 3.2 ]).align(group.parts.usbc, "xz").snap(group.parts.usbc, "y", "outside+").color("red"), "clearance-usbc", true);
2399
- group.add(jscadUtils.parts.Cube([ 7, 7.5, 3 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 3.5 + 7.7 + 14.8).color("lightgray"), "hdmi1");
2403
+ group.add(jscadUtils.parts.Cube([ 7, 7.5, 3 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 25.8).color("lightgray"), "hdmi1");
2400
2404
  group.add(jscadUtils.parts.Cube([ 7, clearance, 3 ]).align(group.parts.hdmi1, "xz").snap(group.parts.hdmi1, "y", "outside+").color("red"), "clearance-hdmi1", true);
2401
- group.add(jscadUtils.parts.Cube([ 7, 7.5, 3 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 3.5 + 7.7 + 14.8 + 13.5).color("lightgray"), "hdmi2");
2405
+ group.add(jscadUtils.parts.Cube([ 7, 7.5, 3 ]).snap(usb.parts.body, "y", "inside-", -1).snap(mb, "z", "outside-").midlineTo("x", 39.2).color("lightgray"), "hdmi2");
2402
2406
  group.add(jscadUtils.parts.Cube([ 7, clearance, 3 ]).align(group.parts.hdmi2, "xz").snap(group.parts.hdmi2, "y", "outside+").color("red"), "clearance-hdmi2", true);
2403
- group.add(AvJack().snap("block", mb, "z", "outside-").midlineTo("block", "x", 3.5 + 7.7 + 14.8 + 13.5 + 7 + 7.5), "avjack", false, "avjack");
2404
- group.add(jscadUtils.parts.Cylinder(6, clearance).rotateX(90).align(group.parts.avjack, "xz").snap(group.parts.avjack, "y", "outside+").color("red"), "clearance-avjack", true);
2405
- group.add(Ribbon().snap(mb, "z", "outside-").midlineTo("x", 3.5 + 7.7 + 14.8 + 13.5 + 7), "camera");
2406
- group.add(Ribbon().snap(mb, "z", "outside-").midlineTo("x", 4).midlineTo("y", 24.5 + 3.5), "display");
2407
+ group.add(CamDisplay().snap(mb, "z", "outside-").midlineTo("x", 55), "camera0");
2408
+ group.add(CamDisplay().snap(mb, "z", "outside-").midlineTo("x", 50), "camera1");
2409
+ group.add(PCIe().snap(mb, "z", "outside-").midlineTo("x", 3.5).midlineTo("y", 30), "display");
2407
2410
  group.add(Gpio().snap(mb, "z", "outside-").midlineTo("x", 29 + 3.5).midlineTo("y", 56 - 3.5), "gpio");
2408
- group.add(BoardLed().snap(mb, "z", "outside-").midlineTo("x", 1.1).midlineTo("y", 8).color("lightgreen"), "activityled");
2409
- group.add(BoardLed().snap(mb, "z", "outside-").midlineTo("x", 1.1).midlineTo("y", 12).color("red"), "powerled");
2411
+ group.add(BoardLed().snap(mb, "z", "outside-").midlineTo("x", 1.1).midlineTo("y", 13.3).color("lightgreen"), "statusled");
2412
+ group.add(jscadUtils.parts.Cylinder(2, clearance).rotateY(90).align(group.parts.statusled, "yz").snap(mb, "x", "outside+").color("red"), "clearance-statusled", true);
2413
+ group.add(PSW().snap("block", mb, "z", "outside-").snap("block", mb, "x", "inside-").midlineTo("block", "y", 18.4), "powerswitch");
2414
+ group.add(jscadUtils.parts.Cylinder(3, clearance).rotateY(90).align(group.parts.powerswitch, "yz").snap(group.parts.powerswitch, "x", "outside+").color("red"), "clearance-powerswitch", true);
2410
2415
  }
2411
2416
  function BPlus() {
2412
2417
  var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2;
@@ -2415,15 +2420,15 @@ function initJscadRPi() {
2415
2420
  clearance: 5
2416
2421
  }, options), clearance = _Object$assign.clearance;
2417
2422
  model = !model ? 2 : model === true ? 3 : model;
2418
- debug$1("BPlus model:", model);
2423
+ debug$3("BPlus model:", model);
2419
2424
  var mb = BPlusMotherboard(model == 4 ? 3 : 2);
2420
2425
  var group = jscadUtils.Group("mb", mb);
2421
2426
  if (model < 4) {
2422
2427
  group.add(RightSide(EthernetJack(), mb).midlineTo("y", 10.25), "ethernet");
2423
- debug$1("mb", mb);
2428
+ debug$3("mb", mb);
2424
2429
  var usb = UsbJack();
2425
2430
  var usbTranslation = jscadUtils.array.add(usb.parts.flange.calcSnap(mb, "x", "inside+"), [ 2, 0, 0 ], usb.parts.body.calcSnap(mb, "y", "inside-"), usb.parts.body.calcSnap(mb, "z", "outside-"));
2426
- debug$1("usbTranslation", usbTranslation, jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 29));
2431
+ debug$3("usbTranslation", usbTranslation, jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 29));
2427
2432
  group.add(usb.clone().translate(usbTranslation).translate(jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 29)), "usb1", false, "usb1");
2428
2433
  group.add(usb.clone().translate(usbTranslation).translate(jscadUtils.util.calcmidlineTo(usb.parts.body, "y", 47)), "usb2", false, "usb2");
2429
2434
  group.add(MicroUsb().snap(mb, "z", "outside-").midlineTo("x", 10.6).translate([ 0, -2, 0 ]), "microusb");
@@ -2451,10 +2456,13 @@ function initJscadRPi() {
2451
2456
  group.add(group.holes[2], "hole3", true);
2452
2457
  group.add(group.holes[3], "hole4", true);
2453
2458
  if (model >= 5) {
2454
- group.holes.push(MountingHole(3.25, 8).snap(mb, "xy", "inside-").align(mb, "z").midlineTo("x", 3.5).midlineTo("y", 6 + 3.5));
2459
+ group.holes.push(MountingHole(3.25, 1.32).snap(mb, "xy", "inside-").align(mb, "z").midlineTo("x", 3.5).midlineTo("y", 6 + 3.5));
2455
2460
  group.add(group.holes[4], "fan1hole", true);
2456
- group.holes.push(MountingHole(3.25, 8).snap(mb, "xy", "inside-").align(mb, "z").midlineTo("x", 3.5 + 58).midlineTo("y", 52.5 - 6));
2461
+ group.holes.push(MountingHole(3.25, 1.32).snap(mb, "xy", "inside-").align(mb, "z").midlineTo("x", 3.5 + 58).midlineTo("y", 52.5 - 6));
2457
2462
  group.add(group.holes[5], "fan2hole", true);
2463
+ var fanClearance = jscadUtils.parts.Cylinder(4.5, 4).color("red").align(group.parts.fan1hole, "xy").snap(group.parts.mb, "z", "outside+");
2464
+ group.add(fanClearance, "clearance-fan1", true, "clearance");
2465
+ group.add(fanClearance.align(group.parts.fan2hole, "xy").snap(group.parts.mb, "z", "outside+"), "clearance-fan2", true, "clearance");
2458
2466
  }
2459
2467
  return group;
2460
2468
  }
@@ -2570,8 +2578,10 @@ function initJscadRPi() {
2570
2578
  return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
2571
2579
  }
2572
2580
  }
2581
+ var debug$2 = jscadUtils.Debug("jscadRPi:HQCameraModule");
2573
2582
  function HQCameraModule() {
2574
2583
  var _camera$holes;
2584
+ var flipTripodMount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2575
2585
  var t = 1.1;
2576
2586
  var camera = jscadUtils.Group();
2577
2587
  camera.add(jscadUtils.parts.RoundedCube(38, 38, t, 1.4).Center().color("green", .75), "board");
@@ -2587,12 +2597,37 @@ function initJscadRPi() {
2587
2597
  var mountInside = jscadUtils.parts.Cylinder(30.75, 10.2).snap(camera.parts.board, "z", "outside-").align(camera.parts.board, "xy").color("black");
2588
2598
  camera.add(mount.subtract(mountInside), "mount");
2589
2599
  camera.add(mount, "mount-clearance", true);
2590
- var tripodMount = jscadUtils.parts.Cube([ 13.97, 12, 11 ]).snap(mount, "z", "inside+").snap(camera.parts.board, "y", "outside+").align(mount, "x").color("gray");
2591
- camera.add(tripodMount.union(jscadUtils.parts.Cube([ 24.5, 10, 7.62 ]).snap(mount, "z", "inside+").snap(tripodMount, "y", "outside-").align(mount, "x").color("darkgray").subtract(mountInside)), "tripodMount");
2600
+ var tripodMountBase = jscadUtils.parts.Cube([ 24.5, 10, 7.62 ]).snap(mount, "z", "inside+").snap(camera.parts.board, "y", "inside-", -1).align(mount, "x").color("darkgray").subtract(mountInside);
2601
+ var tripodMount = jscadUtils.parts.Cube([ 14, 11.5, 11.5 ]).snap(tripodMountBase, "z", flipTripodMount ? "inside-" : "inside+").snap(tripodMountBase, "y", "outside+").align(mount, "x").color("gray");
2602
+ camera.add(tripodMountBase.union(tripodMount), "tripodMount");
2592
2603
  camera.add(jscadUtils.parts.Cube([ 20.8, 5.5, 3.55 - t ]).snap(camera.parts.board, "y", "inside-").snap(camera.parts.board, "z", "outside+").align(camera.parts.board, "x"), "ribbon");
2593
2604
  camera.add(camera.parts.ribbon.enlarge(2, 4, -1).snap(camera.parts.ribbon, "y", "outside+").color("red"), "ribbon-nogo");
2605
+ debug$2("camera parts", camera.parts);
2594
2606
  return camera;
2595
2607
  }
2608
+ scadApi.booleanOps.union;
2609
+ var debug$1 = jscadUtils.Debug("jscadRPi:HyperPixel4Rectangular");
2610
+ function HyperPixel4Rectangular(pi) {
2611
+ var group = jscadUtils.Group();
2612
+ var board = jscadUtils.parts.Cube([ 97.85, 58.14, 1.65 ]).Center();
2613
+ var notch = jscadUtils.parts.RoundedCube(10.1, 58.14 - 4.57 * 2, 1.65, 1.5).align(board, "y").snap(board, "x", "inside-").snap(board, "x", "inside+").translate([ 2, 0, 0 ]);
2614
+ group.add(board.subtract(notch).color("green", .75), "mb");
2615
+ var lcd = jscadUtils.parts.Cube([ 97.1, 58.44, 6.84 - 1.65 ]).color("black");
2616
+ group.add(lcd.align(board, "xy").translate(lcd.calcSnap(board, "z", "outside-")).translate([ 0, 0, .5 ]), "lcd");
2617
+ var pad = Mountingpad(5.5, 22.78 - 5.8).snap(board, "z", "outside+").snap(board, "xy", "inside+").translate([ -15.35 + (5.5 - 2), -4.57 + (5.5 - 2), 0 ]);
2618
+ var pads = [ pad, pad.translate([ -58, 0, 0 ]), pad.translate([ 0, -49, 0 ]), pad.translate([ -58, -49, 0 ]) ];
2619
+ group.add(pads[0], "pad1");
2620
+ group.add(pads[1], "pad2");
2621
+ group.add(pads[2], "pad3");
2622
+ group.add(pads[3], "pad4");
2623
+ group.rotate("mb", "z", 180);
2624
+ debug$1("pi.parts", pi ? pi.parts : null);
2625
+ debug$1("group.parts", group.parts);
2626
+ if (pi) {
2627
+ group.align("pad1", pi.parts.hole1, "xy").snap("pad1", pi.parts.mb, "z", "outside-");
2628
+ }
2629
+ return group;
2630
+ }
2596
2631
  function boardButton(name, board, midline) {
2597
2632
  var g = jscadUtils.Group(name);
2598
2633
  g.add(jscadUtils.parts.Cube([ 6.5, 6.5, 2 ]).color("silver").snap(board, "xy", "inside-").snap(board, "z", "outside-").midlineTo("y", midline), "base");
@@ -2618,7 +2653,7 @@ function initJscadRPi() {
2618
2653
  g.add(buttonCap("buttonCap2", g.parts.button2), "buttonCap2", true, "buttonCap2-");
2619
2654
  g.add(jscadUtils.parts.Cube([ 1, 5, .5 ]).color("blue").align(g.parts.buttonCap1, "x").snap(g.parts.buttonCap1, "y", "outside+", 1).snap(g.parts.buttonCap1, "z", "inside-"), "button-connector", true);
2620
2655
  g.add(g.parts["button-connector"].enlarge(.5, .5, .5).color("red"), "button-connector-clearance", true);
2621
- g.add(jscadUtils.parts.Tube(7, 3, 7.5).snap(board, "x", "inside-").snap(board, "y", "inside+").snap(board, "z", "outside+").color("yellow"), "standoff", true);
2656
+ g.add(jscadUtils.parts.Tube(7, 3, 8.5).snap(board, "x", "inside-").snap(board, "y", "inside+").snap(board, "z", "outside+").color("yellow"), "standoff", true);
2622
2657
  return g;
2623
2658
  }
2624
2659
  function PiTFT22() {
@@ -2738,6 +2773,7 @@ function initJscadRPi() {
2738
2773
  exports.HQCameraModule = HQCameraModule;
2739
2774
  exports.Hat = Hat;
2740
2775
  exports.HatStandoff = HatStandoff;
2776
+ exports.HyperPixel4Rectangular = HyperPixel4Rectangular;
2741
2777
  exports.MiniPiTFT = miniPiTFT;
2742
2778
  exports.PiTFT22 = PiTFT22;
2743
2779
  exports.PiTFT24 = PiTFT24;