@floless/app 0.97.1 → 0.99.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.
- package/dist/floless-server.cjs +1362 -1268
- package/dist/schemas/steel.takeoff.v1.schema.json +1 -0
- package/dist/web/steel-editor.html +97 -18
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -41030,15 +41030,15 @@ var require_escape_html = __commonJS({
|
|
|
41030
41030
|
var require_dist5 = __commonJS({
|
|
41031
41031
|
"node_modules/@lukeed/ms/dist/index.js"(exports2) {
|
|
41032
41032
|
var RGX = /^(-?(?:\d+)?\.?\d+) *(m(?:illiseconds?|s(?:ecs?)?))?(s(?:ec(?:onds?|s)?)?)?(m(?:in(?:utes?|s)?)?)?(h(?:ours?|rs?)?)?(d(?:ays?)?)?(w(?:eeks?|ks?)?)?(y(?:ears?|rs?)?)?$/;
|
|
41033
|
-
var
|
|
41034
|
-
var MIN =
|
|
41033
|
+
var SEC2 = 1e3;
|
|
41034
|
+
var MIN = SEC2 * 60;
|
|
41035
41035
|
var HOUR = MIN * 60;
|
|
41036
41036
|
var DAY = HOUR * 24;
|
|
41037
41037
|
var YEAR = DAY * 365.25;
|
|
41038
41038
|
function parse(val) {
|
|
41039
41039
|
var num4, arr = val.toLowerCase().match(RGX);
|
|
41040
41040
|
if (arr != null && (num4 = parseFloat(arr[1]))) {
|
|
41041
|
-
if (arr[3] != null) return num4 *
|
|
41041
|
+
if (arr[3] != null) return num4 * SEC2;
|
|
41042
41042
|
if (arr[4] != null) return num4 * MIN;
|
|
41043
41043
|
if (arr[5] != null) return num4 * HOUR;
|
|
41044
41044
|
if (arr[6] != null) return num4 * DAY;
|
|
@@ -41053,8 +41053,8 @@ var require_dist5 = __commonJS({
|
|
|
41053
41053
|
}
|
|
41054
41054
|
function format(num4, long) {
|
|
41055
41055
|
var pfx = num4 < 0 ? "-" : "", abs = num4 < 0 ? -num4 : num4;
|
|
41056
|
-
if (abs <
|
|
41057
|
-
if (abs < MIN) return fmt(abs /
|
|
41056
|
+
if (abs < SEC2) return num4 + (long ? " ms" : "ms");
|
|
41057
|
+
if (abs < MIN) return fmt(abs / SEC2, pfx, "second", long);
|
|
41058
41058
|
if (abs < HOUR) return fmt(abs / MIN, pfx, "minute", long);
|
|
41059
41059
|
if (abs < DAY) return fmt(abs / HOUR, pfx, "hour", long);
|
|
41060
41060
|
if (abs < YEAR) return fmt(abs / DAY, pfx, "day", long);
|
|
@@ -53106,7 +53106,7 @@ function appVersion() {
|
|
|
53106
53106
|
return resolveVersion({
|
|
53107
53107
|
isSea: isSea2(),
|
|
53108
53108
|
sqVersionXml: readSqVersionXml(),
|
|
53109
|
-
define: true ? "0.
|
|
53109
|
+
define: true ? "0.99.0" : void 0,
|
|
53110
53110
|
pkgVersion: readPkgVersion()
|
|
53111
53111
|
});
|
|
53112
53112
|
}
|
|
@@ -53116,7 +53116,7 @@ function resolveChannel(s) {
|
|
|
53116
53116
|
return "dev";
|
|
53117
53117
|
}
|
|
53118
53118
|
function appChannel() {
|
|
53119
|
-
return resolveChannel({ isSea: isSea2(), define: true ? "0.
|
|
53119
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.99.0" : void 0 });
|
|
53120
53120
|
}
|
|
53121
53121
|
|
|
53122
53122
|
// workflow-update.ts
|
|
@@ -53480,6 +53480,60 @@ function extractSavedPath(events) {
|
|
|
53480
53480
|
// aisc-shapes.json
|
|
53481
53481
|
var aisc_shapes_default = { "C10X15.3": 2.6, C10X20: 2.74, C10X25: 2.89, C10X30: 3.03, "C12X20.7": 2.94, C12X25: 3.05, C12X30: 3.17, "C15X33.9": 3.4, C15X40: 3.52, C15X50: 3.72, "C3X3.5": 1.37, "C3X4.1": 1.41, C3X5: 1.5, C3X6: 1.6, "C4X4.5": 1.52, "C4X5.4": 1.58, "C4X6.25": 1.65, "C4X7.25": 1.72, "C5X6.7": 1.75, C5X9: 1.89, "C6X10.5": 2.03, C6X13: 2.16, "C6X8.2": 1.92, "C7X12.25": 2.19, "C7X14.75": 2.3, "C7X9.8": 2.09, "C8X11.5": 2.26, "C8X13.75": 2.34, "C8X18.75": 2.53, "C9X13.4": 2.43, C9X15: 2.49, C9X20: 2.65, HP10X42: 10.1, HP10X57: 10.2, HP12X53: 12, HP12X63: 12.1, HP12X74: 12.2, HP12X84: 12.3, HP12X89: 12.3, HP14X102: 14.8, HP14X117: 14.9, HP14X73: 14.6, HP14X89: 14.7, HP16X101: 15.8, HP16X121: 15.9, HP16X141: 16, HP16X162: 16.1, HP16X183: 16.3, HP16X88: 15.7, HP18X135: 17.8, HP18X157: 17.9, HP18X181: 18, HP18X204: 18.1, HP8X36: 8.16, "M10X7.5": 2.69, M10X8: 2.69, M10X9: 2.69, "M12.5X11.6": 3.5, "M12.5X12.4": 3.75, M12X10: 3.25, "M12X10.8": 3.07, "M12X11.8": 3.07, "M3X2.9": 2.25, "M4X3.2": 2.25, "M4X3.45": 2.25, "M4X4.08": 2.25, M4X6: 3.8, "M5X18.9": 5, "M6X3.7": 2, "M6X4.4": 1.84, "M8X6.2": 2.28, "M8X6.5": 2.28, MC10X22: 3.32, MC10X25: 3.41, "MC10X28.5": 3.95, "MC10X33.6": 4.1, "MC10X41.1": 4.32, "MC10X6.5": 1.17, "MC10X8.4": 1.5, "MC12X10.6": 1.5, "MC12X14.3": 2.12, MC12X31: 3.67, MC12X35: 3.77, MC12X40: 3.89, MC12X45: 4.01, MC12X50: 4.14, "MC13X31.8": 4, MC13X35: 4.07, MC13X40: 4.19, MC13X50: 4.41, "MC18X42.7": 3.95, "MC18X45.8": 4, "MC18X51.9": 4.1, MC18X58: 4.2, "MC3X7.1": 1.94, "MC4X13.8": 2.5, MC6X12: 2.5, "MC6X15.1": 2.94, "MC6X15.3": 3.5, "MC6X16.3": 3, MC6X18: 3.5, "MC6X6.5": 1.85, MC6X7: 1.88, "MC7X19.1": 3.45, "MC7X22.7": 3.6, "MC8X18.7": 2.98, MC8X20: 3.03, "MC8X21.4": 3.45, "MC8X22.8": 3.5, "MC8X8.5": 1.87, "MC9X23.9": 3.45, "MC9X25.4": 3.5, "MT2.5X9.45": 5, MT2X3: 3.8, "MT3X1.85": 2, "MT3X2.2": 1.84, "MT4X3.1": 2.28, "MT4X3.25": 2.28, "MT5X3.75": 2.69, MT5X4: 2.69, "MT5X4.5": 2.69, "MT6.25X5.8": 3.5, "MT6.25X6.2": 3.75, MT6X5: 3.25, "MT6X5.4": 3.07, "MT6X5.9": 3.07, "S10X25.4": 4.66, S10X35: 4.94, "S12X31.8": 5, S12X35: 5.08, "S12X40.8": 5.25, S12X50: 5.48, "S15X42.9": 5.5, S15X50: 5.64, "S18X54.7": 6, S18X70: 6.25, S20X66: 6.26, S20X75: 6.39, S20X86: 7.06, S20X96: 7.2, S24X100: 7.25, S24X106: 7.87, S24X121: 8.05, S24X80: 7, S24X90: 7.13, "S3X5.7": 2.33, "S3X7.5": 2.51, "S4X7.7": 2.66, "S4X9.5": 2.8, S5X10: 3, "S6X12.5": 3.33, "S6X17.25": 3.57, "S8X18.4": 4, S8X23: 4.17, "ST1.5X2.85": 2.33, "ST1.5X3.75": 2.51, ST10X33: 6.26, "ST10X37.5": 6.39, ST10X43: 7.06, ST10X48: 7.2, ST12X40: 7, ST12X45: 7.13, ST12X50: 7.25, ST12X53: 7.87, "ST12X60.5": 8.05, "ST2.5X5": 3, "ST2X3.85": 2.66, "ST2X4.75": 2.8, "ST3X6.25": 3.33, "ST3X8.6": 3.57, "ST4X11.5": 4.17, "ST4X9.2": 4, "ST5X12.7": 4.66, "ST5X17.5": 4.94, "ST6X15.9": 5, "ST6X17.5": 5.08, "ST6X20.4": 5.25, ST6X25: 5.48, "ST7.5X21.45": 5.5, "ST7.5X25": 5.64, "ST9X27.35": 6, ST9X35: 6.25, W10X100: 10.3, W10X112: 10.4, W10X12: 3.96, W10X15: 4, W10X17: 4.01, W10X19: 4.02, W10X22: 5.75, W10X26: 5.77, W10X30: 5.81, W10X33: 7.96, W10X39: 7.99, W10X45: 8.02, W10X49: 10, W10X54: 10, W10X60: 10.1, W10X68: 10.1, W10X77: 10.2, W10X88: 10.3, W12X106: 12.2, W12X120: 12.3, W12X136: 12.4, W12X14: 3.97, W12X152: 12.5, W12X16: 3.99, W12X170: 12.6, W12X19: 4.01, W12X190: 12.7, W12X210: 12.8, W12X22: 4.03, W12X230: 12.9, W12X252: 13, W12X26: 6.49, W12X279: 13.1, W12X30: 6.52, W12X305: 13.2, W12X336: 13.4, W12X35: 6.56, W12X40: 8.01, W12X45: 8.05, W12X50: 8.08, W12X53: 10, W12X58: 10, W12X65: 12, W12X72: 12, W12X79: 12.1, W12X87: 12.1, W12X96: 12.2, W14X109: 14.6, W14X120: 14.7, W14X132: 14.7, W14X145: 15.5, W14X159: 15.6, W14X176: 15.7, W14X193: 15.7, W14X211: 15.8, W14X22: 5, W14X233: 15.9, W14X257: 16, W14X26: 5.03, W14X283: 16.1, W14X30: 6.73, W14X311: 16.2, W14X34: 6.75, W14X342: 16.4, W14X370: 16.5, W14X38: 6.77, W14X398: 16.6, W14X426: 16.7, W14X43: 8, W14X455: 16.8, W14X48: 8.03, W14X500: 17, W14X53: 8.06, W14X550: 17.2, W14X605: 17.4, W14X61: 10, W14X665: 17.7, W14X68: 10, W14X730: 17.9, W14X74: 10.1, W14X808: 18.6, W14X82: 10.1, W14X873: 18.8, W14X90: 14.5, W14X99: 14.6, W16X100: 10.4, W16X26: 5.5, W16X31: 5.53, W16X36: 6.99, W16X40: 7, W16X45: 7.04, W16X50: 7.07, W16X57: 7.12, W16X67: 10.2, W16X77: 10.3, W16X89: 10.4, W18X106: 11.2, W18X119: 11.3, W18X130: 11.2, W18X143: 11.2, W18X158: 11.3, W18X175: 11.4, W18X192: 11.5, W18X211: 11.6, W18X234: 11.7, W18X258: 11.8, W18X283: 11.9, W18X311: 12, W18X35: 6, W18X40: 6.02, W18X46: 6.06, W18X50: 7.5, W18X55: 7.53, W18X60: 7.56, W18X65: 7.59, W18X71: 7.64, W18X76: 11, W18X86: 11.1, W18X97: 11.1, W21X101: 12.3, W21X111: 12.3, W21X122: 12.4, W21X132: 12.4, W21X147: 12.5, W21X166: 12.4, W21X182: 12.5, W21X201: 12.6, W21X223: 12.7, W21X248: 12.8, W21X275: 12.9, W21X44: 6.5, W21X48: 8.14, W21X50: 6.53, W21X55: 8.22, W21X57: 6.56, W21X62: 8.24, W21X68: 8.27, W21X73: 8.3, W21X83: 8.36, W21X93: 8.42, W24X103: 9, W24X104: 12.8, W24X117: 12.8, W24X131: 12.9, W24X146: 12.9, W24X162: 13, W24X176: 12.9, W24X192: 13, W24X207: 13, W24X229: 13.1, W24X250: 13.2, W24X279: 13.3, W24X306: 13.4, W24X335: 13.5, W24X370: 13.7, W24X55: 7.01, W24X62: 7.04, W24X68: 8.97, W24X76: 8.99, W24X84: 9.02, W24X94: 9.07, W27X102: 10, W27X114: 10.1, W27X129: 10, W27X146: 14, W27X161: 14, W27X178: 14.1, W27X194: 14, W27X217: 14.1, W27X235: 14.2, W27X258: 14.3, W27X281: 14.4, W27X307: 14.4, W27X336: 14.6, W27X368: 14.7, W27X539: 15.3, W27X84: 10, W27X94: 10, W30X108: 10.5, W30X116: 10.5, W30X124: 10.5, W30X132: 10.5, W30X148: 10.5, W30X173: 15, W30X191: 15, W30X211: 15.1, W30X235: 15.1, W30X261: 15.2, W30X292: 15.3, W30X326: 15.4, W30X357: 15.5, W30X391: 15.6, W30X90: 10.4, W30X99: 10.5, W33X118: 11.5, W33X130: 11.5, W33X141: 11.5, W33X152: 11.6, W33X169: 11.5, W33X201: 15.7, W33X221: 15.8, W33X241: 15.9, W33X263: 15.8, W33X291: 15.9, W33X318: 16, W33X354: 16.1, W33X387: 16.2, W36X135: 12, W36X150: 12, W36X160: 12, W36X170: 12, W36X182: 12.1, W36X194: 12.1, W36X210: 12.2, W36X231: 16.5, W36X232: 12.1, W36X247: 16.5, W36X256: 12.2, W36X262: 16.6, W36X282: 16.6, W36X302: 16.7, W36X330: 16.6, W36X361: 16.7, W36X395: 16.8, W36X441: 17, W36X487: 17.1, W36X529: 17.2, W36X652: 17.6, W36X723: 17.8, W36X802: 18, W36X853: 18.2, W36X925: 18.6, W40X149: 11.8, W40X167: 11.8, W40X183: 11.8, W40X199: 15.8, W40X211: 11.8, W40X215: 15.8, W40X235: 11.9, W40X249: 15.8, W40X264: 11.9, W40X277: 15.8, W40X278: 12, W40X294: 12, W40X297: 15.8, W40X324: 15.9, W40X327: 12.1, W40X331: 12.2, W40X362: 16, W40X372: 16.1, W40X392: 12.4, W40X397: 16.1, W40X431: 16.2, W40X503: 16.4, W40X593: 16.7, W40X655: 16.9, W44X230: 15.8, W44X262: 15.8, W44X290: 15.8, W44X335: 15.9, W4X13: 4.06, W5X16: 5, W5X19: 5.03, W6X12: 4, W6X15: 5.99, W6X16: 4.03, W6X20: 6.02, W6X25: 6.08, "W6X8.5": 3.94, W6X9: 3.94, W8X10: 3.94, W8X13: 4, W8X15: 4.02, W8X18: 5.25, W8X21: 5.27, W8X24: 6.5, W8X28: 6.54, W8X31: 8, W8X35: 8.02, W8X40: 8.07, W8X48: 8.11, W8X58: 8.22, W8X67: 8.28, "WT10.5X100.5": 12.6, "WT10.5X111.5": 12.7, "WT10.5X124": 12.8, "WT10.5X137.5": 12.9, "WT10.5X22": 6.5, "WT10.5X24": 8.14, "WT10.5X25": 6.53, "WT10.5X27.5": 8.22, "WT10.5X28.5": 6.56, "WT10.5X31": 8.24, "WT10.5X34": 8.27, "WT10.5X36.5": 8.3, "WT10.5X41.5": 8.36, "WT10.5X46.5": 8.42, "WT10.5X50.5": 12.3, "WT10.5X55.5": 12.3, "WT10.5X61": 12.4, "WT10.5X66": 12.4, "WT10.5X73.5": 12.5, "WT10.5X83": 12.4, "WT10.5X91": 12.5, "WT12X103.5": 13, "WT12X114.5": 13.1, WT12X125: 13.2, "WT12X139.5": 13.3, WT12X153: 13.4, "WT12X167.5": 13.5, WT12X185: 13.7, "WT12X27.5": 7.01, WT12X31: 7.04, WT12X34: 8.97, WT12X38: 8.99, WT12X42: 9.02, WT12X47: 9.07, "WT12X51.5": 9, WT12X52: 12.8, "WT12X58.5": 12.8, "WT12X65.5": 12.9, WT12X73: 12.9, WT12X81: 13, WT12X88: 12.9, WT12X96: 13, "WT13.5X108.5": 14.1, "WT13.5X117.5": 14.2, "WT13.5X129": 14.3, "WT13.5X140.5": 14.4, "WT13.5X153.5": 14.4, "WT13.5X168": 14.6, "WT13.5X184": 14.7, "WT13.5X269.5": 15.3, "WT13.5X42": 10, "WT13.5X47": 10, "WT13.5X51": 10, "WT13.5X57": 10.1, "WT13.5X64.5": 10, "WT13.5X73": 14, "WT13.5X80.5": 14, "WT13.5X89": 14.1, "WT13.5X97": 14, "WT15X105.5": 15.1, "WT15X117.5": 15.1, "WT15X130.5": 15.2, WT15X146: 15.3, WT15X163: 15.4, "WT15X178.5": 15.5, "WT15X195.5": 15.6, WT15X45: 10.4, "WT15X49.5": 10.5, WT15X54: 10.5, WT15X58: 10.5, WT15X62: 10.5, WT15X66: 10.5, WT15X74: 10.5, "WT15X86.5": 15, "WT15X95.5": 15, "WT16.5X100.5": 15.7, "WT16.5X110.5": 15.8, "WT16.5X120.5": 15.9, "WT16.5X131.5": 15.8, "WT16.5X145.5": 15.9, "WT16.5X159": 16, "WT16.5X177": 16.1, "WT16.5X193.5": 16.2, "WT16.5X59": 11.5, "WT16.5X65": 11.5, "WT16.5X70.5": 11.5, "WT16.5X76": 11.6, "WT16.5X84.5": 11.5, WT18X105: 12.2, "WT18X115.5": 16.5, WT18X116: 12.1, "WT18X123.5": 16.5, WT18X128: 12.2, WT18X131: 16.6, WT18X141: 16.6, WT18X151: 16.7, WT18X165: 16.6, "WT18X180.5": 16.7, "WT18X197.5": 16.8, "WT18X220.5": 17, "WT18X243.5": 17.1, "WT18X264.5": 17.2, WT18X326: 17.6, "WT18X361.5": 17.8, WT18X401: 18, "WT18X426.5": 18.2, "WT18X462.5": 18.6, "WT18X67.5": 12, WT18X75: 12, WT18X80: 12, WT18X85: 12, WT18X91: 12.1, WT18X97: 12.1, "WT2.5X8": 5, "WT2.5X9.5": 5.03, "WT20X105.5": 11.8, "WT20X107.5": 15.8, "WT20X117.5": 11.9, "WT20X124.5": 15.8, WT20X132: 11.9, "WT20X138.5": 15.8, WT20X139: 12, WT20X147: 12, "WT20X148.5": 15.8, WT20X162: 15.9, "WT20X163.5": 12.1, "WT20X165.5": 12.2, WT20X181: 16, WT20X186: 16.1, WT20X196: 12.4, "WT20X198.5": 16.1, "WT20X215.5": 16.2, "WT20X251.5": 16.4, "WT20X296.5": 16.7, "WT20X327.5": 16.9, "WT20X74.5": 11.8, "WT20X83.5": 11.8, "WT20X91.5": 11.8, "WT20X99.5": 15.8, WT22X115: 15.8, WT22X131: 15.8, WT22X145: 15.8, "WT22X167.5": 15.9, "WT2X6.5": 4.06, WT3X10: 6.02, "WT3X12.5": 6.08, "WT3X4.25": 3.94, "WT3X4.5": 3.94, WT3X6: 4, "WT3X7.5": 5.99, WT3X8: 4.03, "WT4X10.5": 5.27, WT4X12: 6.5, WT4X14: 6.54, "WT4X15.5": 8, "WT4X17.5": 8.02, WT4X20: 8.07, WT4X24: 8.11, WT4X29: 8.22, "WT4X33.5": 8.28, WT4X5: 3.94, "WT4X6.5": 4, "WT4X7.5": 4.02, WT4X9: 5.25, WT5X11: 5.75, WT5X13: 5.77, WT5X15: 5.81, "WT5X16.5": 7.96, "WT5X19.5": 7.99, "WT5X22.5": 8.02, "WT5X24.5": 10, WT5X27: 10, WT5X30: 10.1, WT5X34: 10.1, "WT5X38.5": 10.2, WT5X44: 10.3, WT5X50: 10.3, WT5X56: 10.4, WT5X6: 3.96, "WT5X7.5": 4, "WT5X8.5": 4.01, "WT5X9.5": 4.02, WT6X105: 12.8, WT6X11: 4.03, WT6X115: 12.9, WT6X126: 13, WT6X13: 6.49, "WT6X139.5": 13.1, WT6X15: 6.52, "WT6X152.5": 13.2, WT6X168: 13.4, "WT6X17.5": 6.56, WT6X20: 8.01, "WT6X22.5": 8.05, WT6X25: 8.08, "WT6X26.5": 10, WT6X29: 10, "WT6X32.5": 12, WT6X36: 12, "WT6X39.5": 12.1, "WT6X43.5": 12.1, WT6X48: 12.2, WT6X53: 12.2, WT6X60: 12.3, WT6X68: 12.4, WT6X7: 3.97, WT6X76: 12.5, WT6X8: 3.99, WT6X85: 12.6, "WT6X9.5": 4.01, WT6X95: 12.7, "WT7X105.5": 15.8, WT7X11: 5, "WT7X116.5": 15.9, "WT7X128.5": 16, WT7X13: 5.03, "WT7X141.5": 16.1, WT7X15: 6.73, "WT7X155.5": 16.2, WT7X17: 6.75, WT7X171: 16.4, WT7X185: 16.5, WT7X19: 6.77, WT7X199: 16.6, "WT7X21.5": 8, WT7X213: 16.7, "WT7X227.5": 16.8, WT7X24: 8.03, WT7X250: 17, "WT7X26.5": 8.06, WT7X275: 17.2, "WT7X30.5": 10, "WT7X302.5": 17.4, "WT7X332.5": 17.7, WT7X34: 10, WT7X365: 17.9, WT7X37: 10.1, WT7X404: 18.6, WT7X41: 10.1, "WT7X436.5": 18.8, WT7X45: 14.5, "WT7X49.5": 14.6, "WT7X54.5": 14.6, WT7X60: 14.7, WT7X66: 14.7, "WT7X72.5": 15.5, "WT7X79.5": 15.6, WT7X88: 15.7, "WT7X96.5": 15.7, WT8X13: 5.5, "WT8X15.5": 5.53, WT8X18: 6.99, WT8X20: 7, "WT8X22.5": 7.04, WT8X25: 7.07, "WT8X28.5": 7.12, "WT8X33.5": 10.2, "WT8X38.5": 10.3, "WT8X44.5": 10.4, WT8X50: 10.4, "WT9X105.5": 11.6, WT9X117: 11.7, WT9X129: 11.8, "WT9X141.5": 11.9, "WT9X155.5": 12, "WT9X17.5": 6, WT9X20: 6.02, WT9X23: 6.06, WT9X25: 7.5, "WT9X27.5": 7.53, WT9X30: 7.56, "WT9X32.5": 7.59, "WT9X35.5": 7.64, WT9X38: 11, WT9X43: 11.1, "WT9X48.5": 11.1, WT9X53: 11.2, "WT9X59.5": 11.3, WT9X65: 11.2, "WT9X71.5": 11.2, WT9X79: 11.3, "WT9X87.5": 11.4, WT9X96: 11.5 };
|
|
53482
53482
|
|
|
53483
|
+
// aisc-sections.json
|
|
53484
|
+
var aisc_sections_default = { _comment: "AISC v15 section dims in INCHES for I/channel/tee shapes: [depth d, width bf, web tw, flange tf]. Generated from steel-detailer-us/rules/aisc-shapes-v15.json. Used for ACTUAL section depth (2D+3D+IFC) and the IFC parametric profile web/flange thickness.", "C10X15.3": [10, 2.6, 0.24, 0.436], C10X20: [10, 2.74, 0.379, 0.436], C10X25: [10, 2.89, 0.526, 0.436], C10X30: [10, 3.03, 0.673, 0.436], "C12X20.7": [12, 2.94, 0.282, 0.501], C12X25: [12, 3.05, 0.387, 0.501], C12X30: [12, 3.17, 0.51, 0.501], "C15X33.9": [15, 3.4, 0.4, 0.65], C15X40: [15, 3.52, 0.52, 0.65], C15X50: [15, 3.72, 0.716, 0.65], "C3X3.5": [3, 1.37, 0.132, 0.273], "C3X4.1": [3, 1.41, 0.17, 0.273], C3X5: [3, 1.5, 0.258, 0.273], C3X6: [3, 1.6, 0.356, 0.273], "C4X4.5": [4, 1.52, 0.125, 0.296], "C4X5.4": [4, 1.58, 0.184, 0.296], "C4X6.25": [4, 1.65, 0.247, 0.296], "C4X7.25": [4, 1.72, 0.321, 0.296], "C5X6.7": [5, 1.75, 0.19, 0.32], C5X9: [5, 1.89, 0.325, 0.32], "C6X10.5": [6, 2.03, 0.314, 0.343], C6X13: [6, 2.16, 0.437, 0.343], "C6X8.2": [6, 1.92, 0.2, 0.343], "C7X12.25": [7, 2.19, 0.314, 0.366], "C7X14.75": [7, 2.3, 0.419, 0.366], "C7X9.8": [7, 2.09, 0.21, 0.366], "C8X11.5": [8, 2.26, 0.22, 0.39], "C8X13.75": [8, 2.34, 0.303, 0.39], "C8X18.75": [8, 2.53, 0.487, 0.39], "C9X13.4": [9, 2.43, 0.233, 0.413], C9X15: [9, 2.49, 0.285, 0.413], C9X20: [9, 2.65, 0.448, 0.413], HP10X42: [9.7, 10.1, 0.415, 0.42], HP10X57: [9.99, 10.2, 0.565, 0.565], HP12X53: [11.8, 12, 0.435, 0.435], HP12X63: [11.9, 12.1, 0.515, 0.515], HP12X74: [12.1, 12.2, 0.605, 0.61], HP12X84: [12.3, 12.3, 0.685, 0.685], HP12X89: [12.4, 12.3, 0.72, 0.72], HP14X102: [14, 14.8, 0.705, 0.705], HP14X117: [14.2, 14.9, 0.805, 0.805], HP14X73: [13.6, 14.6, 0.505, 0.505], HP14X89: [13.8, 14.7, 0.615, 0.615], HP16X101: [15.5, 15.8, 0.625, 0.625], HP16X121: [15.8, 15.9, 0.75, 0.75], HP16X141: [16, 16, 0.875, 0.875], HP16X162: [16.3, 16.1, 1, 1], HP16X183: [16.5, 16.3, 1.13, 1.13], HP16X88: [15.3, 15.7, 0.54, 0.54], HP18X135: [17.5, 17.8, 0.75, 0.75], HP18X157: [17.7, 17.9, 0.87, 0.87], HP18X181: [18, 18, 1, 1], HP18X204: [18.3, 18.1, 1.13, 1.13], HP8X36: [8.02, 8.16, 0.445, 0.445], "M10X7.5": [9.99, 2.69, 0.13, 0.173], M10X8: [9.95, 2.69, 0.141, 0.182], M10X9: [10, 2.69, 0.157, 0.206], "M12.5X11.6": [12.5, 3.5, 0.155, 0.211], "M12.5X12.4": [12.5, 3.75, 0.155, 0.228], M12X10: [12, 3.25, 0.149, 0.18], "M12X10.8": [12, 3.07, 0.16, 0.21], "M12X11.8": [12, 3.07, 0.177, 0.225], "M3X2.9": [3, 2.25, 0.09, 0.13], "M4X3.2": [4, 2.25, 0.092, 0.13], "M4X3.45": [4, 2.25, 0.092, 0.13], "M4X4.08": [4, 2.25, 0.115, 0.17], M4X6: [3.8, 3.8, 0.13, 0.16], "M5X18.9": [5, 5, 0.316, 0.416], "M6X3.7": [5.92, 2, 0.098, 0.129], "M6X4.4": [6, 1.84, 0.114, 0.171], "M8X6.2": [8, 2.28, 0.129, 0.177], "M8X6.5": [8, 2.28, 0.135, 0.189], MC10X22: [10, 3.32, 0.29, 0.575], MC10X25: [10, 3.41, 0.38, 0.575], "MC10X28.5": [10, 3.95, 0.425, 0.575], "MC10X33.6": [10, 4.1, 0.575, 0.575], "MC10X41.1": [10, 4.32, 0.796, 0.575], "MC10X6.5": [10, 1.17, 0.152, 0.202], "MC10X8.4": [10, 1.5, 0.17, 0.28], "MC12X10.6": [12, 1.5, 0.19, 0.309], "MC12X14.3": [12, 2.12, 0.25, 0.313], MC12X31: [12, 3.67, 0.37, 0.7], MC12X35: [12, 3.77, 0.465, 0.7], MC12X40: [12, 3.89, 0.59, 0.7], MC12X45: [12, 4.01, 0.71, 0.7], MC12X50: [12, 4.14, 0.835, 0.7], "MC13X31.8": [13, 4, 0.375, 0.61], MC13X35: [13, 4.07, 0.447, 0.61], MC13X40: [13, 4.19, 0.56, 0.61], MC13X50: [13, 4.41, 0.787, 0.61], "MC18X42.7": [18, 3.95, 0.45, 0.625], "MC18X45.8": [18, 4, 0.5, 0.625], "MC18X51.9": [18, 4.1, 0.6, 0.625], MC18X58: [18, 4.2, 0.7, 0.625], "MC3X7.1": [3, 1.94, 0.312, 0.351], "MC4X13.8": [4, 2.5, 0.5, 0.5], MC6X12: [6, 2.5, 0.31, 0.375], "MC6X15.1": [6, 2.94, 0.316, 0.475], "MC6X15.3": [6, 3.5, 0.34, 0.385], "MC6X16.3": [6, 3, 0.375, 0.475], MC6X18: [6, 3.5, 0.379, 0.475], "MC6X6.5": [6, 1.85, 0.155, 0.291], MC6X7: [6, 1.88, 0.179, 0.291], "MC7X19.1": [7, 3.45, 0.352, 0.5], "MC7X22.7": [7, 3.6, 0.503, 0.5], "MC8X18.7": [8, 2.98, 0.353, 0.5], MC8X20: [8, 3.03, 0.4, 0.5], "MC8X21.4": [8, 3.45, 0.375, 0.525], "MC8X22.8": [8, 3.5, 0.427, 0.525], "MC8X8.5": [8, 1.87, 0.179, 0.311], "MC9X23.9": [9, 3.45, 0.4, 0.55], "MC9X25.4": [9, 3.5, 0.45, 0.55], "MT2.5X9.45": [2.5, 5, 0.316, 0.416], MT2X3: [1.9, 3.8, 0.13, 0.16], "MT3X1.85": [2.96, 2, 0.098, 0.129], "MT3X2.2": [3, 1.84, 0.114, 0.171], "MT4X3.1": [4, 2.28, 0.129, 0.177], "MT4X3.25": [4, 2.28, 0.135, 0.189], "MT5X3.75": [5, 2.69, 0.13, 0.173], MT5X4: [4.98, 2.69, 0.141, 0.182], "MT5X4.5": [5, 2.69, 0.157, 0.206], "MT6.25X5.8": [6.25, 3.5, 0.155, 0.211], "MT6.25X6.2": [6.27, 3.75, 0.155, 0.228], MT6X5: [5.99, 3.25, 0.149, 0.18], "MT6X5.4": [5.99, 3.07, 0.16, 0.21], "MT6X5.9": [6, 3.07, 0.177, 0.225], "S10X25.4": [10, 4.66, 0.311, 0.491], S10X35: [10, 4.94, 0.594, 0.491], "S12X31.8": [12, 5, 0.35, 0.544], S12X35: [12, 5.08, 0.428, 0.544], "S12X40.8": [12, 5.25, 0.462, 0.659], S12X50: [12, 5.48, 0.687, 0.659], "S15X42.9": [15, 5.5, 0.411, 0.622], S15X50: [15, 5.64, 0.55, 0.622], "S18X54.7": [18, 6, 0.461, 0.691], S18X70: [18, 6.25, 0.711, 0.691], S20X66: [20, 6.26, 0.505, 0.795], S20X75: [20, 6.39, 0.635, 0.795], S20X86: [20.3, 7.06, 0.66, 0.92], S20X96: [20.3, 7.2, 0.8, 0.92], S24X100: [24, 7.25, 0.745, 0.87], S24X106: [24.5, 7.87, 0.62, 1.09], S24X121: [24.5, 8.05, 0.8, 1.09], S24X80: [24, 7, 0.5, 0.87], S24X90: [24, 7.13, 0.625, 0.87], "S3X5.7": [3, 2.33, 0.17, 0.26], "S3X7.5": [3, 2.51, 0.349, 0.26], "S4X7.7": [4, 2.66, 0.193, 0.293], "S4X9.5": [4, 2.8, 0.326, 0.293], S5X10: [5, 3, 0.214, 0.326], "S6X12.5": [6, 3.33, 0.232, 0.359], "S6X17.25": [6, 3.57, 0.465, 0.359], "S8X18.4": [8, 4, 0.271, 0.425], S8X23: [8, 4.17, 0.441, 0.425], "ST1.5X2.85": [1.5, 2.33, 0.17, 0.26], "ST1.5X3.75": [1.5, 2.51, 0.349, 0.26], ST10X33: [10, 6.26, 0.505, 0.795], "ST10X37.5": [10, 6.39, 0.635, 0.795], ST10X43: [10.2, 7.06, 0.66, 0.92], ST10X48: [10.2, 7.2, 0.8, 0.92], ST12X40: [12, 7, 0.5, 0.87], ST12X45: [12, 7.13, 0.625, 0.87], ST12X50: [12, 7.25, 0.745, 0.87], ST12X53: [12.3, 7.87, 0.62, 1.09], "ST12X60.5": [12.3, 8.05, 0.8, 1.09], "ST2.5X5": [2.5, 3, 0.214, 0.326], "ST2X3.85": [2, 2.66, 0.193, 0.293], "ST2X4.75": [2, 2.8, 0.326, 0.293], "ST3X6.25": [3, 3.33, 0.232, 0.359], "ST3X8.6": [3, 3.57, 0.465, 0.359], "ST4X11.5": [4, 4.17, 0.441, 0.425], "ST4X9.2": [4, 4, 0.271, 0.425], "ST5X12.7": [5, 4.66, 0.311, 0.491], "ST5X17.5": [5, 4.94, 0.594, 0.491], "ST6X15.9": [6, 5, 0.35, 0.544], "ST6X17.5": [6, 5.08, 0.428, 0.544], "ST6X20.4": [6, 5.25, 0.462, 0.659], ST6X25: [6, 5.48, 0.687, 0.659], "ST7.5X21.45": [7.5, 5.5, 0.411, 0.622], "ST7.5X25": [7.5, 5.64, 0.55, 0.622], "ST9X27.35": [9, 6, 0.461, 0.691], ST9X35: [9, 6.25, 0.711, 0.691], W10X100: [11.1, 10.3, 0.68, 1.12], W10X112: [11.4, 10.4, 0.755, 1.25], W10X12: [9.87, 3.96, 0.19, 0.21], W10X15: [9.99, 4, 0.23, 0.27], W10X17: [10.1, 4.01, 0.24, 0.33], W10X19: [10.2, 4.02, 0.25, 0.395], W10X22: [10.2, 5.75, 0.24, 0.36], W10X26: [10.3, 5.77, 0.26, 0.44], W10X30: [10.5, 5.81, 0.3, 0.51], W10X33: [9.73, 7.96, 0.29, 0.435], W10X39: [9.92, 7.99, 0.315, 0.53], W10X45: [10.1, 8.02, 0.35, 0.62], W10X49: [10, 10, 0.34, 0.56], W10X54: [10.1, 10, 0.37, 0.615], W10X60: [10.2, 10.1, 0.42, 0.68], W10X68: [10.4, 10.1, 0.47, 0.77], W10X77: [10.6, 10.2, 0.53, 0.87], W10X88: [10.8, 10.3, 0.605, 0.99], W12X106: [12.9, 12.2, 0.61, 0.99], W12X120: [13.1, 12.3, 0.71, 1.11], W12X136: [13.4, 12.4, 0.79, 1.25], W12X14: [11.9, 3.97, 0.2, 0.225], W12X152: [13.7, 12.5, 0.87, 1.4], W12X16: [12, 3.99, 0.22, 0.265], W12X170: [14, 12.6, 0.96, 1.56], W12X19: [12.2, 4.01, 0.235, 0.35], W12X190: [14.4, 12.7, 1.06, 1.74], W12X210: [14.7, 12.8, 1.18, 1.9], W12X22: [12.3, 4.03, 0.26, 0.425], W12X230: [15.1, 12.9, 1.29, 2.07], W12X252: [15.4, 13, 1.4, 2.25], W12X26: [12.2, 6.49, 0.23, 0.38], W12X279: [15.9, 13.1, 1.53, 2.47], W12X30: [12.3, 6.52, 0.26, 0.44], W12X305: [16.3, 13.2, 1.63, 2.71], W12X336: [16.8, 13.4, 1.78, 2.96], W12X35: [12.5, 6.56, 0.3, 0.52], W12X40: [11.9, 8.01, 0.295, 0.515], W12X45: [12.1, 8.05, 0.335, 0.575], W12X50: [12.2, 8.08, 0.37, 0.64], W12X53: [12.1, 10, 0.345, 0.575], W12X58: [12.2, 10, 0.36, 0.64], W12X65: [12.1, 12, 0.39, 0.605], W12X72: [12.3, 12, 0.43, 0.67], W12X79: [12.4, 12.1, 0.47, 0.735], W12X87: [12.5, 12.1, 0.515, 0.81], W12X96: [12.7, 12.2, 0.55, 0.9], W14X109: [14.3, 14.6, 0.525, 0.86], W14X120: [14.5, 14.7, 0.59, 0.94], W14X132: [14.7, 14.7, 0.645, 1.03], W14X145: [14.8, 15.5, 0.68, 1.09], W14X159: [15, 15.6, 0.745, 1.19], W14X176: [15.2, 15.7, 0.83, 1.31], W14X193: [15.5, 15.7, 0.89, 1.44], W14X211: [15.7, 15.8, 0.98, 1.56], W14X22: [13.7, 5, 0.23, 0.335], W14X233: [16, 15.9, 1.07, 1.72], W14X257: [16.4, 16, 1.18, 1.89], W14X26: [13.9, 5.03, 0.255, 0.42], W14X283: [16.7, 16.1, 1.29, 2.07], W14X30: [13.8, 6.73, 0.27, 0.385], W14X311: [17.1, 16.2, 1.41, 2.26], W14X34: [14, 6.75, 0.285, 0.455], W14X342: [17.5, 16.4, 1.54, 2.47], W14X370: [17.9, 16.5, 1.66, 2.66], W14X38: [14.1, 6.77, 0.31, 0.515], W14X398: [18.3, 16.6, 1.77, 2.85], W14X426: [18.7, 16.7, 1.88, 3.04], W14X43: [13.7, 8, 0.305, 0.53], W14X455: [19, 16.8, 2.02, 3.21], W14X48: [13.8, 8.03, 0.34, 0.595], W14X500: [19.6, 17, 2.19, 3.5], W14X53: [13.9, 8.06, 0.37, 0.66], W14X550: [20.2, 17.2, 2.38, 3.82], W14X605: [20.9, 17.4, 2.6, 4.16], W14X61: [13.9, 10, 0.375, 0.645], W14X665: [21.6, 17.7, 2.83, 4.52], W14X68: [14, 10, 0.415, 0.72], W14X730: [22.4, 17.9, 3.07, 4.91], W14X74: [14.2, 10.1, 0.45, 0.785], W14X808: [22.8, 18.6, 3.74, 5.12], W14X82: [14.3, 10.1, 0.51, 0.855], W14X873: [23.6, 18.8, 3.94, 5.51], W14X90: [14, 14.5, 0.44, 0.71], W14X99: [14.2, 14.6, 0.485, 0.78], W16X100: [17, 10.4, 0.585, 0.985], W16X26: [15.7, 5.5, 0.25, 0.345], W16X31: [15.9, 5.53, 0.275, 0.44], W16X36: [15.9, 6.99, 0.295, 0.43], W16X40: [16, 7, 0.305, 0.505], W16X45: [16.1, 7.04, 0.345, 0.565], W16X50: [16.3, 7.07, 0.38, 0.63], W16X57: [16.4, 7.12, 0.43, 0.715], W16X67: [16.3, 10.2, 0.395, 0.665], W16X77: [16.5, 10.3, 0.455, 0.76], W16X89: [16.8, 10.4, 0.525, 0.875], W18X106: [18.7, 11.2, 0.59, 0.94], W18X119: [19, 11.3, 0.655, 1.06], W18X130: [19.3, 11.2, 0.67, 1.2], W18X143: [19.5, 11.2, 0.73, 1.32], W18X158: [19.7, 11.3, 0.81, 1.44], W18X175: [20, 11.4, 0.89, 1.59], W18X192: [20.4, 11.5, 0.96, 1.75], W18X211: [20.7, 11.6, 1.06, 1.91], W18X234: [21.1, 11.7, 1.16, 2.11], W18X258: [21.5, 11.8, 1.28, 2.3], W18X283: [21.9, 11.9, 1.4, 2.5], W18X311: [22.3, 12, 1.52, 2.74], W18X35: [17.7, 6, 0.3, 0.425], W18X40: [17.9, 6.02, 0.315, 0.525], W18X46: [18.1, 6.06, 0.36, 0.605], W18X50: [18, 7.5, 0.355, 0.57], W18X55: [18.1, 7.53, 0.39, 0.63], W18X60: [18.2, 7.56, 0.415, 0.695], W18X65: [18.4, 7.59, 0.45, 0.75], W18X71: [18.5, 7.64, 0.495, 0.81], W18X76: [18.2, 11, 0.425, 0.68], W18X86: [18.4, 11.1, 0.48, 0.77], W18X97: [18.6, 11.1, 0.535, 0.87], W21X101: [21.4, 12.3, 0.5, 0.8], W21X111: [21.5, 12.3, 0.55, 0.875], W21X122: [21.7, 12.4, 0.6, 0.96], W21X132: [21.8, 12.4, 0.65, 1.04], W21X147: [22.1, 12.5, 0.72, 1.15], W21X166: [22.5, 12.4, 0.75, 1.36], W21X182: [22.7, 12.5, 0.83, 1.48], W21X201: [23, 12.6, 0.91, 1.63], W21X223: [23.4, 12.7, 1, 1.79], W21X248: [23.7, 12.8, 1.1, 1.99], W21X275: [24.1, 12.9, 1.22, 2.19], W21X44: [20.7, 6.5, 0.35, 0.45], W21X48: [20.6, 8.14, 0.35, 0.43], W21X50: [20.8, 6.53, 0.38, 0.535], W21X55: [20.8, 8.22, 0.375, 0.522], W21X57: [21.1, 6.56, 0.405, 0.65], W21X62: [21, 8.24, 0.4, 0.615], W21X68: [21.1, 8.27, 0.43, 0.685], W21X73: [21.2, 8.3, 0.455, 0.74], W21X83: [21.4, 8.36, 0.515, 0.835], W21X93: [21.6, 8.42, 0.58, 0.93], W24X103: [24.5, 9, 0.55, 0.98], W24X104: [24.1, 12.8, 0.5, 0.75], W24X117: [24.3, 12.8, 0.55, 0.85], W24X131: [24.5, 12.9, 0.605, 0.96], W24X146: [24.7, 12.9, 0.65, 1.09], W24X162: [25, 13, 0.705, 1.22], W24X176: [25.2, 12.9, 0.75, 1.34], W24X192: [25.5, 13, 0.81, 1.46], W24X207: [25.7, 13, 0.87, 1.57], W24X229: [26, 13.1, 0.96, 1.73], W24X250: [26.3, 13.2, 1.04, 1.89], W24X279: [26.7, 13.3, 1.16, 2.09], W24X306: [27.1, 13.4, 1.26, 2.28], W24X335: [27.5, 13.5, 1.38, 2.48], W24X370: [28, 13.7, 1.52, 2.72], W24X55: [23.6, 7.01, 0.395, 0.505], W24X62: [23.7, 7.04, 0.43, 0.59], W24X68: [23.7, 8.97, 0.415, 0.585], W24X76: [23.9, 8.99, 0.44, 0.68], W24X84: [24.1, 9.02, 0.47, 0.77], W24X94: [24.3, 9.07, 0.515, 0.875], W27X102: [27.1, 10, 0.515, 0.83], W27X114: [27.3, 10.1, 0.57, 0.93], W27X129: [27.6, 10, 0.61, 1.1], W27X146: [27.4, 14, 0.605, 0.975], W27X161: [27.6, 14, 0.66, 1.08], W27X178: [27.8, 14.1, 0.725, 1.19], W27X194: [28.1, 14, 0.75, 1.34], W27X217: [28.4, 14.1, 0.83, 1.5], W27X235: [28.7, 14.2, 0.91, 1.61], W27X258: [29, 14.3, 0.98, 1.77], W27X281: [29.3, 14.4, 1.06, 1.93], W27X307: [29.6, 14.4, 1.16, 2.09], W27X336: [30, 14.6, 1.26, 2.28], W27X368: [30.4, 14.7, 1.38, 2.48], W27X539: [32.5, 15.3, 1.97, 3.54], W27X84: [26.7, 10, 0.46, 0.64], W27X94: [26.9, 10, 0.49, 0.745], W30X108: [29.8, 10.5, 0.545, 0.76], W30X116: [30, 10.5, 0.565, 0.85], W30X124: [30.2, 10.5, 0.585, 0.93], W30X132: [30.3, 10.5, 0.615, 1], W30X148: [30.7, 10.5, 0.65, 1.18], W30X173: [30.4, 15, 0.655, 1.07], W30X191: [30.7, 15, 0.71, 1.19], W30X211: [30.9, 15.1, 0.775, 1.32], W30X235: [31.3, 15.1, 0.83, 1.5], W30X261: [31.6, 15.2, 0.93, 1.65], W30X292: [32, 15.3, 1.02, 1.85], W30X326: [32.4, 15.4, 1.14, 2.05], W30X357: [32.8, 15.5, 1.24, 2.24], W30X391: [33.2, 15.6, 1.36, 2.44], W30X90: [29.5, 10.4, 0.47, 0.61], W30X99: [29.7, 10.5, 0.52, 0.67], W33X118: [32.9, 11.5, 0.55, 0.74], W33X130: [33.1, 11.5, 0.58, 0.855], W33X141: [33.3, 11.5, 0.605, 0.96], W33X152: [33.5, 11.6, 0.635, 1.06], W33X169: [33.8, 11.5, 0.67, 1.22], W33X201: [33.7, 15.7, 0.715, 1.15], W33X221: [33.9, 15.8, 0.775, 1.28], W33X241: [34.2, 15.9, 0.83, 1.4], W33X263: [34.5, 15.8, 0.87, 1.57], W33X291: [34.8, 15.9, 0.96, 1.73], W33X318: [35.2, 16, 1.04, 1.89], W33X354: [35.6, 16.1, 1.16, 2.09], W33X387: [36, 16.2, 1.26, 2.28], W36X135: [35.6, 12, 0.6, 0.79], W36X150: [35.9, 12, 0.625, 0.94], W36X160: [36, 12, 0.65, 1.02], W36X170: [36.2, 12, 0.68, 1.1], W36X182: [36.3, 12.1, 0.725, 1.18], W36X194: [36.5, 12.1, 0.765, 1.26], W36X210: [36.7, 12.2, 0.83, 1.36], W36X231: [36.5, 16.5, 0.76, 1.26], W36X232: [37.1, 12.1, 0.87, 1.57], W36X247: [36.7, 16.5, 0.8, 1.35], W36X256: [37.4, 12.2, 0.96, 1.73], W36X262: [36.9, 16.6, 0.84, 1.44], W36X282: [37.1, 16.6, 0.885, 1.57], W36X302: [37.3, 16.7, 0.945, 1.68], W36X330: [37.7, 16.6, 1.02, 1.85], W36X361: [38, 16.7, 1.12, 2.01], W36X395: [38.4, 16.8, 1.22, 2.2], W36X441: [38.9, 17, 1.36, 2.44], W36X487: [39.3, 17.1, 1.5, 2.68], W36X529: [39.8, 17.2, 1.61, 2.91], W36X652: [41.1, 17.6, 1.97, 3.54], W36X723: [41.8, 17.8, 2.17, 3.9], W36X802: [42.6, 18, 2.38, 4.29], W36X853: [43.1, 18.2, 2.52, 4.53], W36X925: [43.1, 18.6, 3.02, 4.53], W40X149: [38.2, 11.8, 0.63, 0.83], W40X167: [38.6, 11.8, 0.65, 1.03], W40X183: [39, 11.8, 0.65, 1.2], W40X199: [38.7, 15.8, 0.65, 1.07], W40X211: [39.4, 11.8, 0.75, 1.42], W40X215: [39, 15.8, 0.65, 1.22], W40X235: [39.7, 11.9, 0.83, 1.58], W40X249: [39.4, 15.8, 0.75, 1.42], W40X264: [40, 11.9, 0.96, 1.73], W40X277: [39.7, 15.8, 0.83, 1.58], W40X278: [40.2, 12, 1.03, 1.81], W40X294: [40.4, 12, 1.06, 1.93], W40X297: [39.8, 15.8, 0.93, 1.65], W40X324: [40.2, 15.9, 1, 1.81], W40X327: [40.8, 12.1, 1.18, 2.13], W40X331: [40.8, 12.2, 1.22, 2.13], W40X362: [40.6, 16, 1.12, 2.01], W40X372: [40.6, 16.1, 1.16, 2.05], W40X392: [41.6, 12.4, 1.42, 2.52], W40X397: [41, 16.1, 1.22, 2.2], W40X431: [41.3, 16.2, 1.34, 2.36], W40X503: [42.1, 16.4, 1.54, 2.76], W40X593: [43, 16.7, 1.79, 3.23], W40X655: [43.6, 16.9, 1.97, 3.54], W44X230: [42.9, 15.8, 0.71, 1.22], W44X262: [43.3, 15.8, 0.785, 1.42], W44X290: [43.6, 15.8, 0.865, 1.58], W44X335: [44, 15.9, 1.03, 1.77], W4X13: [4.16, 4.06, 0.28, 0.345], W5X16: [5.01, 5, 0.24, 0.36], W5X19: [5.15, 5.03, 0.27, 0.43], W6X12: [6.03, 4, 0.23, 0.28], W6X15: [5.99, 5.99, 0.23, 0.26], W6X16: [6.28, 4.03, 0.26, 0.405], W6X20: [6.2, 6.02, 0.26, 0.365], W6X25: [6.38, 6.08, 0.32, 0.455], "W6X8.5": [5.83, 3.94, 0.17, 0.195], W6X9: [5.9, 3.94, 0.17, 0.215], W8X10: [7.89, 3.94, 0.17, 0.205], W8X13: [7.99, 4, 0.23, 0.255], W8X15: [8.11, 4.02, 0.245, 0.315], W8X18: [8.14, 5.25, 0.23, 0.33], W8X21: [8.28, 5.27, 0.25, 0.4], W8X24: [7.93, 6.5, 0.245, 0.4], W8X28: [8.06, 6.54, 0.285, 0.465], W8X31: [8, 8, 0.285, 0.435], W8X35: [8.12, 8.02, 0.31, 0.495], W8X40: [8.25, 8.07, 0.36, 0.56], W8X48: [8.5, 8.11, 0.4, 0.685], W8X58: [8.75, 8.22, 0.51, 0.81], W8X67: [9, 8.28, 0.57, 0.935], "WT10.5X100.5": [11.5, 12.6, 0.91, 1.63], "WT10.5X111.5": [11.7, 12.7, 1, 1.79], "WT10.5X124": [11.9, 12.8, 1.1, 1.99], "WT10.5X137.5": [12.1, 12.9, 1.22, 2.19], "WT10.5X22": [10.3, 6.5, 0.35, 0.45], "WT10.5X24": [10.3, 8.14, 0.35, 0.43], "WT10.5X25": [10.4, 6.53, 0.38, 0.535], "WT10.5X27.5": [10.4, 8.22, 0.375, 0.522], "WT10.5X28.5": [10.5, 6.56, 0.405, 0.65], "WT10.5X31": [10.5, 8.24, 0.4, 0.615], "WT10.5X34": [10.6, 8.27, 0.43, 0.685], "WT10.5X36.5": [10.6, 8.3, 0.455, 0.74], "WT10.5X41.5": [10.7, 8.36, 0.515, 0.835], "WT10.5X46.5": [10.8, 8.42, 0.58, 0.93], "WT10.5X50.5": [10.7, 12.3, 0.5, 0.8], "WT10.5X55.5": [10.8, 12.3, 0.55, 0.875], "WT10.5X61": [10.8, 12.4, 0.6, 0.96], "WT10.5X66": [10.9, 12.4, 0.65, 1.04], "WT10.5X73.5": [11, 12.5, 0.72, 1.15], "WT10.5X83": [11.2, 12.4, 0.75, 1.36], "WT10.5X91": [11.4, 12.5, 0.83, 1.48], "WT12X103.5": [12.9, 13, 0.87, 1.57], "WT12X114.5": [13, 13.1, 0.96, 1.73], WT12X125: [13.2, 13.2, 1.04, 1.89], "WT12X139.5": [13.4, 13.3, 1.16, 2.09], WT12X153: [13.6, 13.4, 1.26, 2.28], "WT12X167.5": [13.8, 13.5, 1.38, 2.48], WT12X185: [14, 13.7, 1.52, 2.72], "WT12X27.5": [11.8, 7.01, 0.395, 0.505], WT12X31: [11.9, 7.04, 0.43, 0.59], WT12X34: [11.9, 8.97, 0.415, 0.585], WT12X38: [12, 8.99, 0.44, 0.68], WT12X42: [12.1, 9.02, 0.47, 0.77], WT12X47: [12.2, 9.07, 0.515, 0.875], "WT12X51.5": [12.3, 9, 0.55, 0.98], WT12X52: [12, 12.8, 0.5, 0.75], "WT12X58.5": [12.1, 12.8, 0.55, 0.85], "WT12X65.5": [12.2, 12.9, 0.605, 0.96], WT12X73: [12.4, 12.9, 0.65, 1.09], WT12X81: [12.5, 13, 0.705, 1.22], WT12X88: [12.6, 12.9, 0.75, 1.34], WT12X96: [12.7, 13, 0.81, 1.46], "WT13.5X108.5": [14.2, 14.1, 0.83, 1.5], "WT13.5X117.5": [14.3, 14.2, 0.91, 1.61], "WT13.5X129": [14.5, 14.3, 0.98, 1.77], "WT13.5X140.5": [14.6, 14.4, 1.06, 1.93], "WT13.5X153.5": [14.8, 14.4, 1.16, 2.09], "WT13.5X168": [15, 14.6, 1.26, 2.28], "WT13.5X184": [15.2, 14.7, 1.38, 2.48], "WT13.5X269.5": [16.3, 15.3, 1.97, 3.54], "WT13.5X42": [13.4, 10, 0.46, 0.64], "WT13.5X47": [13.5, 10, 0.49, 0.745], "WT13.5X51": [13.5, 10, 0.515, 0.83], "WT13.5X57": [13.6, 10.1, 0.57, 0.93], "WT13.5X64.5": [13.8, 10, 0.61, 1.1], "WT13.5X73": [13.7, 14, 0.605, 0.975], "WT13.5X80.5": [13.8, 14, 0.66, 1.08], "WT13.5X89": [13.9, 14.1, 0.725, 1.19], "WT13.5X97": [14.1, 14, 0.75, 1.34], "WT15X105.5": [15.5, 15.1, 0.775, 1.32], "WT15X117.5": [15.7, 15.1, 0.83, 1.5], "WT15X130.5": [15.8, 15.2, 0.93, 1.65], WT15X146: [16, 15.3, 1.02, 1.85], WT15X163: [16.2, 15.4, 1.14, 2.05], "WT15X178.5": [16.4, 15.5, 1.24, 2.24], "WT15X195.5": [16.6, 15.6, 1.36, 2.44], WT15X45: [14.8, 10.4, 0.47, 0.61], "WT15X49.5": [14.8, 10.5, 0.52, 0.67], WT15X54: [14.9, 10.5, 0.545, 0.76], WT15X58: [15, 10.5, 0.565, 0.85], WT15X62: [15.1, 10.5, 0.585, 0.93], WT15X66: [15.2, 10.5, 0.615, 1], WT15X74: [15.3, 10.5, 0.65, 1.18], "WT15X86.5": [15.2, 15, 0.655, 1.07], "WT15X95.5": [15.3, 15, 0.71, 1.19], "WT16.5X100.5": [16.8, 15.7, 0.715, 1.15], "WT16.5X110.5": [17, 15.8, 0.775, 1.28], "WT16.5X120.5": [17.1, 15.9, 0.83, 1.4], "WT16.5X131.5": [17.3, 15.8, 0.87, 1.57], "WT16.5X145.5": [17.4, 15.9, 0.96, 1.73], "WT16.5X159": [17.6, 16, 1.04, 1.89], "WT16.5X177": [17.8, 16.1, 1.16, 2.09], "WT16.5X193.5": [18, 16.2, 1.26, 2.28], "WT16.5X59": [16.4, 11.5, 0.55, 0.74], "WT16.5X65": [16.5, 11.5, 0.58, 0.855], "WT16.5X70.5": [16.7, 11.5, 0.605, 0.96], "WT16.5X76": [16.7, 11.6, 0.635, 1.06], "WT16.5X84.5": [16.9, 11.5, 0.67, 1.22], WT18X105: [18.3, 12.2, 0.83, 1.36], "WT18X115.5": [18.2, 16.5, 0.76, 1.26], WT18X116: [18.6, 12.1, 0.87, 1.57], "WT18X123.5": [18.3, 16.5, 0.8, 1.35], WT18X128: [18.7, 12.2, 0.96, 1.73], WT18X131: [18.4, 16.6, 0.84, 1.44], WT18X141: [18.6, 16.6, 0.885, 1.57], WT18X151: [18.7, 16.7, 0.945, 1.68], WT18X165: [18.8, 16.6, 1.02, 1.85], "WT18X180.5": [19, 16.7, 1.12, 2.01], "WT18X197.5": [19.2, 16.8, 1.22, 2.2], "WT18X220.5": [19.4, 17, 1.36, 2.44], "WT18X243.5": [19.7, 17.1, 1.5, 2.68], "WT18X264.5": [19.9, 17.2, 1.61, 2.91], WT18X326: [20.5, 17.6, 1.97, 3.54], "WT18X361.5": [20.9, 17.8, 2.17, 3.9], WT18X401: [21.3, 18, 2.38, 4.29], "WT18X426.5": [21.6, 18.2, 2.52, 4.53], "WT18X462.5": [21.6, 18.6, 3.02, 4.53], "WT18X67.5": [17.8, 12, 0.6, 0.79], WT18X75: [17.9, 12, 0.625, 0.94], WT18X80: [18, 12, 0.65, 1.02], WT18X85: [18.1, 12, 0.68, 1.1], WT18X91: [18.2, 12.1, 0.725, 1.18], WT18X97: [18.2, 12.1, 0.765, 1.26], "WT2.5X8": [2.51, 5, 0.24, 0.36], "WT2.5X9.5": [2.58, 5.03, 0.27, 0.43], "WT20X105.5": [19.7, 11.8, 0.75, 1.42], "WT20X107.5": [19.5, 15.8, 0.65, 1.22], "WT20X117.5": [19.8, 11.9, 0.83, 1.58], "WT20X124.5": [19.7, 15.8, 0.75, 1.42], WT20X132: [20, 11.9, 0.96, 1.73], "WT20X138.5": [19.8, 15.8, 0.83, 1.58], WT20X139: [20.1, 12, 1.03, 1.81], WT20X147: [20.2, 12, 1.06, 1.93], "WT20X148.5": [19.9, 15.8, 0.93, 1.65], WT20X162: [20.1, 15.9, 1, 1.81], "WT20X163.5": [20.4, 12.1, 1.18, 2.13], "WT20X165.5": [20.4, 12.2, 1.22, 2.13], WT20X181: [20.3, 16, 1.12, 2.01], WT20X186: [20.3, 16.1, 1.16, 2.05], WT20X196: [20.8, 12.4, 1.42, 2.52], "WT20X198.5": [20.5, 16.1, 1.22, 2.2], "WT20X215.5": [20.6, 16.2, 1.34, 2.36], "WT20X251.5": [21, 16.4, 1.54, 2.76], "WT20X296.5": [21.5, 16.7, 1.79, 3.23], "WT20X327.5": [21.8, 16.9, 1.97, 3.54], "WT20X74.5": [19.1, 11.8, 0.63, 0.83], "WT20X83.5": [19.3, 11.8, 0.65, 1.03], "WT20X91.5": [19.5, 11.8, 0.65, 1.2], "WT20X99.5": [19.3, 15.8, 0.65, 1.07], WT22X115: [21.5, 15.8, 0.71, 1.22], WT22X131: [21.7, 15.8, 0.785, 1.42], WT22X145: [21.8, 15.8, 0.865, 1.58], "WT22X167.5": [22, 15.9, 1.03, 1.77], "WT2X6.5": [2.08, 4.06, 0.28, 0.345], WT3X10: [3.1, 6.02, 0.26, 0.365], "WT3X12.5": [3.19, 6.08, 0.32, 0.455], "WT3X4.25": [2.92, 3.94, 0.17, 0.195], "WT3X4.5": [2.95, 3.94, 0.17, 0.215], WT3X6: [3.02, 4, 0.23, 0.28], "WT3X7.5": [3, 5.99, 0.23, 0.26], WT3X8: [3.14, 4.03, 0.26, 0.405], "WT4X10.5": [4.14, 5.27, 0.25, 0.4], WT4X12: [3.97, 6.5, 0.245, 0.4], WT4X14: [4.03, 6.54, 0.285, 0.465], "WT4X15.5": [4, 8, 0.285, 0.435], "WT4X17.5": [4.06, 8.02, 0.31, 0.495], WT4X20: [4.13, 8.07, 0.36, 0.56], WT4X24: [4.25, 8.11, 0.4, 0.685], WT4X29: [4.38, 8.22, 0.51, 0.81], "WT4X33.5": [4.5, 8.28, 0.57, 0.935], WT4X5: [3.95, 3.94, 0.17, 0.205], "WT4X6.5": [4, 4, 0.23, 0.255], "WT4X7.5": [4.06, 4.02, 0.245, 0.315], WT4X9: [4.07, 5.25, 0.23, 0.33], WT5X11: [5.09, 5.75, 0.24, 0.36], WT5X13: [5.17, 5.77, 0.26, 0.44], WT5X15: [5.24, 5.81, 0.3, 0.51], "WT5X16.5": [4.87, 7.96, 0.29, 0.435], "WT5X19.5": [4.96, 7.99, 0.315, 0.53], "WT5X22.5": [5.05, 8.02, 0.35, 0.62], "WT5X24.5": [4.99, 10, 0.34, 0.56], WT5X27: [5.05, 10, 0.37, 0.615], WT5X30: [5.11, 10.1, 0.42, 0.68], WT5X34: [5.2, 10.1, 0.47, 0.77], "WT5X38.5": [5.3, 10.2, 0.53, 0.87], WT5X44: [5.42, 10.3, 0.605, 0.99], WT5X50: [5.55, 10.3, 0.68, 1.12], WT5X56: [5.68, 10.4, 0.755, 1.25], WT5X6: [4.94, 3.96, 0.19, 0.21], "WT5X7.5": [5, 4, 0.23, 0.27], "WT5X8.5": [5.06, 4.01, 0.24, 0.33], "WT5X9.5": [5.12, 4.02, 0.25, 0.395], WT6X105: [7.36, 12.8, 1.18, 1.9], WT6X11: [6.16, 4.03, 0.26, 0.425], WT6X115: [7.53, 12.9, 1.29, 2.07], WT6X126: [7.71, 13, 1.4, 2.25], WT6X13: [6.11, 6.49, 0.23, 0.38], "WT6X139.5": [7.93, 13.1, 1.53, 2.47], WT6X15: [6.17, 6.52, 0.26, 0.44], "WT6X152.5": [8.16, 13.2, 1.63, 2.71], WT6X168: [8.41, 13.4, 1.78, 2.96], "WT6X17.5": [6.25, 6.56, 0.3, 0.52], WT6X20: [5.97, 8.01, 0.295, 0.515], "WT6X22.5": [6.03, 8.05, 0.335, 0.575], WT6X25: [6.1, 8.08, 0.37, 0.64], "WT6X26.5": [6.03, 10, 0.345, 0.575], WT6X29: [6.1, 10, 0.36, 0.64], "WT6X32.5": [6.06, 12, 0.39, 0.605], WT6X36: [6.13, 12, 0.43, 0.67], "WT6X39.5": [6.19, 12.1, 0.47, 0.735], "WT6X43.5": [6.27, 12.1, 0.515, 0.81], WT6X48: [6.36, 12.2, 0.55, 0.9], WT6X53: [6.45, 12.2, 0.61, 0.99], WT6X60: [6.56, 12.3, 0.71, 1.11], WT6X68: [6.71, 12.4, 0.79, 1.25], WT6X7: [5.96, 3.97, 0.2, 0.225], WT6X76: [6.86, 12.5, 0.87, 1.4], WT6X8: [6, 3.99, 0.22, 0.265], WT6X85: [7.02, 12.6, 0.96, 1.56], "WT6X9.5": [6.08, 4.01, 0.235, 0.35], WT6X95: [7.19, 12.7, 1.06, 1.74], "WT7X105.5": [7.86, 15.8, 0.98, 1.56], WT7X11: [6.87, 5, 0.23, 0.335], "WT7X116.5": [8.02, 15.9, 1.07, 1.72], "WT7X128.5": [8.19, 16, 1.18, 1.89], WT7X13: [6.96, 5.03, 0.255, 0.42], "WT7X141.5": [8.37, 16.1, 1.29, 2.07], WT7X15: [6.92, 6.73, 0.27, 0.385], "WT7X155.5": [8.56, 16.2, 1.41, 2.26], WT7X17: [6.99, 6.75, 0.285, 0.455], WT7X171: [8.77, 16.4, 1.54, 2.47], WT7X185: [8.96, 16.5, 1.66, 2.66], WT7X19: [7.05, 6.77, 0.31, 0.515], WT7X199: [9.15, 16.6, 1.77, 2.85], "WT7X21.5": [6.83, 8, 0.305, 0.53], WT7X213: [9.34, 16.7, 1.88, 3.04], "WT7X227.5": [9.51, 16.8, 2.02, 3.21], WT7X24: [6.9, 8.03, 0.34, 0.595], WT7X250: [9.8, 17, 2.19, 3.5], "WT7X26.5": [6.96, 8.06, 0.37, 0.66], WT7X275: [10.1, 17.2, 2.38, 3.82], "WT7X30.5": [6.95, 10, 0.375, 0.645], "WT7X302.5": [10.5, 17.4, 2.6, 4.16], "WT7X332.5": [10.8, 17.7, 2.83, 4.52], WT7X34: [7.02, 10, 0.415, 0.72], WT7X365: [11.2, 17.9, 3.07, 4.91], WT7X37: [7.09, 10.1, 0.45, 0.785], WT7X404: [11.4, 18.6, 3.74, 5.12], WT7X41: [7.16, 10.1, 0.51, 0.855], "WT7X436.5": [11.8, 18.8, 3.94, 5.51], WT7X45: [7.01, 14.5, 0.44, 0.71], "WT7X49.5": [7.08, 14.6, 0.485, 0.78], "WT7X54.5": [7.16, 14.6, 0.525, 0.86], WT7X60: [7.24, 14.7, 0.59, 0.94], WT7X66: [7.33, 14.7, 0.645, 1.03], "WT7X72.5": [7.39, 15.5, 0.68, 1.09], "WT7X79.5": [7.49, 15.6, 0.745, 1.19], WT7X88: [7.61, 15.7, 0.83, 1.31], "WT7X96.5": [7.74, 15.7, 0.89, 1.44], WT8X13: [7.85, 5.5, 0.25, 0.345], "WT8X15.5": [7.94, 5.53, 0.275, 0.44], WT8X18: [7.93, 6.99, 0.295, 0.43], WT8X20: [8.01, 7, 0.305, 0.505], "WT8X22.5": [8.07, 7.04, 0.345, 0.565], WT8X25: [8.13, 7.07, 0.38, 0.63], "WT8X28.5": [8.22, 7.12, 0.43, 0.715], "WT8X33.5": [8.17, 10.2, 0.395, 0.665], "WT8X38.5": [8.26, 10.3, 0.455, 0.76], "WT8X44.5": [8.38, 10.4, 0.525, 0.875], WT8X50: [8.49, 10.4, 0.585, 0.985], "WT9X105.5": [10.3, 11.6, 1.06, 1.91], WT9X117: [10.5, 11.7, 1.16, 2.11], WT9X129: [10.7, 11.8, 1.28, 2.3], "WT9X141.5": [10.9, 11.9, 1.4, 2.5], "WT9X155.5": [11.2, 12, 1.52, 2.74], "WT9X17.5": [8.85, 6, 0.3, 0.425], WT9X20: [8.95, 6.02, 0.315, 0.525], WT9X23: [9.03, 6.06, 0.36, 0.605], WT9X25: [9, 7.5, 0.355, 0.57], "WT9X27.5": [9.06, 7.53, 0.39, 0.63], WT9X30: [9.12, 7.56, 0.415, 0.695], "WT9X32.5": [9.18, 7.59, 0.45, 0.75], "WT9X35.5": [9.24, 7.64, 0.495, 0.81], WT9X38: [9.11, 11, 0.425, 0.68], WT9X43: [9.2, 11.1, 0.48, 0.77], "WT9X48.5": [9.3, 11.1, 0.535, 0.87], WT9X53: [9.37, 11.2, 0.59, 0.94], "WT9X59.5": [9.49, 11.3, 0.655, 1.06], WT9X65: [9.63, 11.2, 0.67, 1.2], "WT9X71.5": [9.75, 11.2, 0.73, 1.32], WT9X79: [9.86, 11.3, 0.81, 1.44], "WT9X87.5": [10, 11.4, 0.89, 1.59], WT9X96: [10.2, 11.5, 0.96, 1.75] };
|
|
53485
|
+
|
|
53486
|
+
// aisc-sections.ts
|
|
53487
|
+
var IN_TO_MM = 25.4;
|
|
53488
|
+
var SEC = Object.fromEntries(
|
|
53489
|
+
Object.entries(aisc_sections_default).filter(
|
|
53490
|
+
([k, v]) => !k.startsWith("_") && Array.isArray(v)
|
|
53491
|
+
)
|
|
53492
|
+
);
|
|
53493
|
+
function sectionDimsIn(designation) {
|
|
53494
|
+
const row = SEC[designation.trim().toUpperCase().replace(/\s+/g, "")];
|
|
53495
|
+
return row ? { d: row[0], bf: row[1] } : void 0;
|
|
53496
|
+
}
|
|
53497
|
+
var SECTION_DIMS_IN = Object.fromEntries(
|
|
53498
|
+
Object.entries(SEC).map(([k, v]) => [k, [v[0], v[1]]])
|
|
53499
|
+
);
|
|
53500
|
+
function parseDim(tok) {
|
|
53501
|
+
const s = tok.trim();
|
|
53502
|
+
let m = s.match(/^(\d+)\s+(\d+)\/(\d+)$/);
|
|
53503
|
+
if (m) return Number(m[1]) + Number(m[2]) / Number(m[3]);
|
|
53504
|
+
m = s.match(/^(\d+)\/(\d+)$/);
|
|
53505
|
+
if (m) return Number(m[1]) / Number(m[2]);
|
|
53506
|
+
const d = Number.parseFloat(s);
|
|
53507
|
+
return Number.isFinite(d) ? d : null;
|
|
53508
|
+
}
|
|
53509
|
+
function xsectionFor(profile, dims) {
|
|
53510
|
+
const rect = { shape: "rect", w: dims.w, d: dims.d };
|
|
53511
|
+
const raw = (profile ?? "").trim().toUpperCase().replace(/×/g, "X");
|
|
53512
|
+
if (!raw) return rect;
|
|
53513
|
+
const key = raw.replace(/\s+/g, "");
|
|
53514
|
+
const m = raw.match(/^([A-Z]+)\s*(.+)$/);
|
|
53515
|
+
if (!m) return rect;
|
|
53516
|
+
const prefix = m[1];
|
|
53517
|
+
const toks = m[2].split("X").map(parseDim);
|
|
53518
|
+
const twtf = SEC[key];
|
|
53519
|
+
if (/^(W|S|M|HP)$/.test(prefix)) {
|
|
53520
|
+
return twtf ? { shape: "i", d: dims.d, bf: dims.w, tw: twtf[2] * IN_TO_MM, tf: twtf[3] * IN_TO_MM } : rect;
|
|
53521
|
+
}
|
|
53522
|
+
if (/^(C|MC)$/.test(prefix)) {
|
|
53523
|
+
return twtf ? { shape: "channel", d: dims.d, bf: dims.w, tw: twtf[2] * IN_TO_MM, tf: twtf[3] * IN_TO_MM } : rect;
|
|
53524
|
+
}
|
|
53525
|
+
if (prefix === "L" && toks.length >= 3 && toks[2] != null && toks[2] > 0) {
|
|
53526
|
+
return { shape: "angle", d: dims.d, b: dims.w, t: toks[2] * IN_TO_MM };
|
|
53527
|
+
}
|
|
53528
|
+
if ((prefix === "HSS" || prefix === "TUBE") && toks.length >= 3 && toks[2] != null && toks[2] > 0) {
|
|
53529
|
+
return { shape: "rhs", d: dims.d, b: dims.w, t: toks[2] * IN_TO_MM };
|
|
53530
|
+
}
|
|
53531
|
+
if (prefix === "HSS" && toks.length === 2 && toks[1] != null && toks[1] > 0) {
|
|
53532
|
+
return { shape: "chs", od: dims.d, t: toks[1] * IN_TO_MM };
|
|
53533
|
+
}
|
|
53534
|
+
return rect;
|
|
53535
|
+
}
|
|
53536
|
+
|
|
53483
53537
|
// index.ts
|
|
53484
53538
|
var import_node_crypto12 = require("node:crypto");
|
|
53485
53539
|
|
|
@@ -56084,1371 +56138,1410 @@ function columnLengthFt(col, planDefaultTos) {
|
|
|
56084
56138
|
return Number.isFinite(ft) ? ft : null;
|
|
56085
56139
|
}
|
|
56086
56140
|
|
|
56087
|
-
//
|
|
56088
|
-
var
|
|
56089
|
-
|
|
56090
|
-
|
|
56091
|
-
|
|
56092
|
-
|
|
56093
|
-
|
|
56094
|
-
|
|
56095
|
-
|
|
56096
|
-
|
|
56097
|
-
|
|
56098
|
-
|
|
56099
|
-
|
|
56100
|
-
|
|
56101
|
-
|
|
56102
|
-
|
|
56103
|
-
|
|
56104
|
-
|
|
56105
|
-
|
|
56106
|
-
|
|
56107
|
-
|
|
56108
|
-
|
|
56109
|
-
|
|
56110
|
-
|
|
56111
|
-
|
|
56112
|
-
|
|
56113
|
-
|
|
56114
|
-
|
|
56115
|
-
|
|
56116
|
-
|
|
56117
|
-
|
|
56118
|
-
const rows = [...agg.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([profile, g]) => ({
|
|
56119
|
-
Profile: profile,
|
|
56120
|
-
Qty: g.qty,
|
|
56121
|
-
"Length (ft)": round1(g.lenFt),
|
|
56122
|
-
"lb/ft": g.plf,
|
|
56123
|
-
"Weight (lb)": Math.round(g.lenFt * g.plf)
|
|
56124
|
-
}));
|
|
56125
|
-
const totalLb = rows.reduce((t, r) => t + r["Weight (lb)"], 0);
|
|
56126
|
-
const totalQty = rows.reduce((t, r) => t + r.Qty, 0);
|
|
56127
|
-
const totalLenFt = round1(rows.reduce((t, r) => t + r["Length (ft)"], 0));
|
|
56128
|
-
const totalTons = round1(totalLb / 2e3);
|
|
56129
|
-
rows.push({
|
|
56130
|
-
Profile: "TOTAL",
|
|
56131
|
-
Qty: totalQty,
|
|
56132
|
-
"Length (ft)": totalLenFt,
|
|
56133
|
-
"lb/ft": "",
|
|
56134
|
-
"Weight (lb)": totalLb
|
|
56135
|
-
});
|
|
56136
|
-
return {
|
|
56137
|
-
title: `Bill of Materials \u2014 ${totalTons} tons (${totalLb.toLocaleString("en-US")} lb)`,
|
|
56138
|
-
columns: ["Profile", "Qty", "Length (ft)", "lb/ft", "Weight (lb)"],
|
|
56139
|
-
rows,
|
|
56140
|
-
totalLb,
|
|
56141
|
-
totalTons
|
|
56142
|
-
};
|
|
56141
|
+
// steel-joints.ts
|
|
56142
|
+
var GROUPS = {
|
|
56143
|
+
"base-plate": { key: "base-plate", label: "Base plates", color: "#6b7a8d" },
|
|
56144
|
+
// darkest plate grey
|
|
56145
|
+
"washer-plate": { key: "washer-plate", label: "Washer plates", color: "#9aafc3" },
|
|
56146
|
+
"anchor-plate": { key: "anchor-plate", label: "Anchor plates", color: "#8293a6" },
|
|
56147
|
+
// embedded bearing plate at the rod's anchored end — mid steel-grey, between base + washer plate
|
|
56148
|
+
anchor: { key: "anchor", label: "Anchor rods", color: "#b0c4d8" },
|
|
56149
|
+
// cool zinc-grey
|
|
56150
|
+
nut: { key: "nut", label: "Nuts", color: "#7a8a9e" },
|
|
56151
|
+
washer: { key: "washer", label: "Washers", color: "#dde4ed" },
|
|
56152
|
+
// lightest zinc
|
|
56153
|
+
weld: { key: "weld", label: "Welds", color: "#f97316" },
|
|
56154
|
+
// weld orange (heat) — off the UI error-red
|
|
56155
|
+
// Shear-plate kit — same muted steel band; the fin plate a touch lighter than the base plate so the
|
|
56156
|
+
// two connection types are tellable apart in a mixed model, bolts on the zinc fastener grey.
|
|
56157
|
+
"shear-plate": { key: "shear-plate", label: "Shear plates", color: "#7d8ba0" },
|
|
56158
|
+
bolt: { key: "bolt", label: "Bolts", color: "#b0c4d8" },
|
|
56159
|
+
// cool zinc-grey (matches the anchor fasteners)
|
|
56160
|
+
stiffener: { key: "stiffener", label: "Stiffeners", color: "#9aafc3" },
|
|
56161
|
+
cope: { key: "cope", label: "Copes", color: "#c2703a" },
|
|
56162
|
+
// a muted cut/burn amber — the removed corner (subtractive; rendered as the notch, not a swatch mesh)
|
|
56163
|
+
// Imported (custom) connection — one neutral steel band for the whole opaque assembly, so it reads
|
|
56164
|
+
// as a single imported unit (not scattered across the recipe-part legend rows). Roles (plate/bolt/
|
|
56165
|
+
// weld) are kept on each part's meta for labels, but share this one legend group + colour.
|
|
56166
|
+
custom: { key: "custom", label: "Imported connections", color: "#8a97a8" }
|
|
56167
|
+
};
|
|
56168
|
+
var EMBED = 1;
|
|
56169
|
+
function num(params, key, def) {
|
|
56170
|
+
const v = params?.[key];
|
|
56171
|
+
return typeof v === "number" && isFinite(v) ? v : def;
|
|
56143
56172
|
}
|
|
56144
|
-
|
|
56145
|
-
|
|
56146
|
-
|
|
56147
|
-
var asArray = (v) => Array.isArray(v) ? v : [];
|
|
56148
|
-
var str = (v) => typeof v === "string" ? v : "";
|
|
56149
|
-
var normProfile = (v) => str(v).trim().toUpperCase().replace(/\s+/g, "");
|
|
56150
|
-
var num = (v) => typeof v === "number" && isFinite(v) ? v : null;
|
|
56151
|
-
var MOVE_TOL_FT = 0.5;
|
|
56152
|
-
function collect(contract) {
|
|
56153
|
-
const byKey = /* @__PURE__ */ new Map();
|
|
56154
|
-
const dup = /* @__PURE__ */ new Set();
|
|
56155
|
-
const idSheets = /* @__PURE__ */ new Map();
|
|
56156
|
-
const c = contract ?? {};
|
|
56157
|
-
for (const plan of asArray(c.plans)) {
|
|
56158
|
-
const sheet = str(plan?.sheet);
|
|
56159
|
-
const rawPpf = plan?.pt_per_ft;
|
|
56160
|
-
const hasScale = typeof rawPpf === "number" && rawPpf > 0;
|
|
56161
|
-
const ptPerFt = hasScale ? rawPpf : 12;
|
|
56162
|
-
for (const m of asArray(plan?.members)) {
|
|
56163
|
-
const id = str(m?.id);
|
|
56164
|
-
if (!id) continue;
|
|
56165
|
-
const key = sheet + NUL + id;
|
|
56166
|
-
(idSheets.get(id) ?? idSheets.set(id, /* @__PURE__ */ new Set()).get(id)).add(sheet);
|
|
56167
|
-
if (byKey.has(key)) {
|
|
56168
|
-
dup.add(key);
|
|
56169
|
-
continue;
|
|
56170
|
-
}
|
|
56171
|
-
byKey.set(key, {
|
|
56172
|
-
key,
|
|
56173
|
-
id,
|
|
56174
|
-
sheet,
|
|
56175
|
-
mark: str(m?.mark) || void 0,
|
|
56176
|
-
profile: str(m?.profile),
|
|
56177
|
-
role: str(m?.role) || "beam",
|
|
56178
|
-
ptPerFt,
|
|
56179
|
-
hasScale,
|
|
56180
|
-
wp: asArray(m?.wp).map((p) => asArray(p).map((x) => fin(x))),
|
|
56181
|
-
// finite-guarded (no NaN) — consistent with num() elsewhere
|
|
56182
|
-
ends: asArray(m?.ends),
|
|
56183
|
-
col: m?.col ?? {},
|
|
56184
|
-
material: str(m?.material)
|
|
56185
|
-
});
|
|
56186
|
-
}
|
|
56187
|
-
}
|
|
56188
|
-
return { byKey, dupKeys: [...dup], idSheets };
|
|
56173
|
+
function pos(params, key, def) {
|
|
56174
|
+
const v = num(params, key, def);
|
|
56175
|
+
return v > 0 ? v : def;
|
|
56189
56176
|
}
|
|
56190
|
-
|
|
56191
|
-
|
|
56192
|
-
const n = Number(v);
|
|
56193
|
-
return isFinite(n) ? n : 0;
|
|
56194
|
-
};
|
|
56195
|
-
var dist = (p, q) => Math.hypot((p[0] ?? 0) - (q[0] ?? 0), (p[1] ?? 0) - (q[1] ?? 0));
|
|
56196
|
-
var ftPt = (p, ppf) => [fin(p?.[0]) / ppf, fin(p?.[1]) / ppf];
|
|
56197
|
-
function beamMoveFeet(a, b) {
|
|
56198
|
-
const af0 = ftPt(a.wp[0], a.ptPerFt), af1 = ftPt(a.wp[1] ?? a.wp[0], a.ptPerFt);
|
|
56199
|
-
const bf0 = ftPt(b.wp[0], b.ptPerFt), bf1 = ftPt(b.wp[1] ?? b.wp[0], b.ptPerFt);
|
|
56200
|
-
const aligned = Math.max(dist(af0, bf0), dist(af1, bf1));
|
|
56201
|
-
const flipped = Math.max(dist(af0, bf1), dist(af1, bf0));
|
|
56202
|
-
return flipped < aligned ? { feet: flipped, flipped: true } : { feet: aligned, flipped: false };
|
|
56177
|
+
function intMin1(params, key, def) {
|
|
56178
|
+
return Math.max(1, Math.round(num(params, key, def)));
|
|
56203
56179
|
}
|
|
56204
|
-
function
|
|
56205
|
-
|
|
56206
|
-
const at = num(a.col?.tos), bt = num(b.col?.tos);
|
|
56207
|
-
if (at != null && bt != null) ft = Math.max(ft, Math.abs(at - bt) / 12);
|
|
56208
|
-
const ab = num(a.col?.bos), bb = num(b.col?.bos);
|
|
56209
|
-
if (ab != null && bb != null) ft = Math.max(ft, Math.abs(ab - bb) / 12);
|
|
56210
|
-
for (let i = 0; i < 2; i++) {
|
|
56211
|
-
const ea = num(a.ends?.[i]?.tos), eb = num(b.ends?.[i]?.tos);
|
|
56212
|
-
if (ea != null && eb != null) ft = Math.max(ft, Math.abs(ea - eb) / 12);
|
|
56213
|
-
}
|
|
56214
|
-
return ft;
|
|
56180
|
+
function finite3(a) {
|
|
56181
|
+
return Array.isArray(a) && a.length >= 3 && a.every((n) => typeof n === "number" && isFinite(n));
|
|
56215
56182
|
}
|
|
56216
|
-
|
|
56217
|
-
if (
|
|
56218
|
-
|
|
56219
|
-
return JSON.stringify(o) ?? "null";
|
|
56220
|
-
};
|
|
56221
|
-
function connIdentity(ref, lib) {
|
|
56222
|
-
const conn = str(ref?.conn).trim();
|
|
56223
|
-
if (conn && lib.has(conn)) {
|
|
56224
|
-
const r = lib.get(conn);
|
|
56225
|
-
return `${str(r?.type)}/${str(r?.detail)}`;
|
|
56226
|
-
}
|
|
56227
|
-
return str(ref?.detail).trim() || str(ref?.note).trim() || "";
|
|
56183
|
+
function spread(n, half) {
|
|
56184
|
+
if (n <= 1) return [0];
|
|
56185
|
+
return Array.from({ length: n }, (_, i) => -half + 2 * half * i / (n - 1));
|
|
56228
56186
|
}
|
|
56229
|
-
function
|
|
56230
|
-
const
|
|
56231
|
-
|
|
56232
|
-
|
|
56233
|
-
|
|
56234
|
-
|
|
56235
|
-
|
|
56236
|
-
if (gone.length && got.length && gk === tk) return `${tk || "connection"} params changed`;
|
|
56237
|
-
if (got.length) return `${tk || "connection"} added`;
|
|
56238
|
-
if (gone.length) return `${gk || "connection"} removed`;
|
|
56239
|
-
return "connection changed";
|
|
56187
|
+
function profileKind(profile) {
|
|
56188
|
+
const p = (profile || "").toUpperCase().trim();
|
|
56189
|
+
if (/^(W|M|S|HP|UC|UB|UKC|UKB|IPE|HE)/.test(p)) return "I";
|
|
56190
|
+
if (/^(C|MC|PFC)/.test(p)) return "C";
|
|
56191
|
+
if (/^L/.test(p)) return "L";
|
|
56192
|
+
if (/^(HSS|PIPE|TS|SHS|RHS|CHS|TUBE|HSQ)/.test(p)) return "TUBE";
|
|
56193
|
+
return "BOX";
|
|
56240
56194
|
}
|
|
56241
|
-
function
|
|
56242
|
-
const
|
|
56243
|
-
|
|
56244
|
-
|
|
56245
|
-
|
|
56246
|
-
|
|
56247
|
-
|
|
56248
|
-
|
|
56195
|
+
function profileOutline(profile, w, d) {
|
|
56196
|
+
const hw = w / 2, hd = d / 2;
|
|
56197
|
+
switch (profileKind(profile)) {
|
|
56198
|
+
case "I": {
|
|
56199
|
+
const tf = Math.min(d * 0.5, Math.max(d * 0.1, 6)), tw = Math.min(w * 0.5, Math.max(w * 0.1, 5));
|
|
56200
|
+
return [
|
|
56201
|
+
[-hw, -hd],
|
|
56202
|
+
[hw, -hd],
|
|
56203
|
+
[hw, -hd + tf],
|
|
56204
|
+
[tw / 2, -hd + tf],
|
|
56205
|
+
[tw / 2, hd - tf],
|
|
56206
|
+
[hw, hd - tf],
|
|
56207
|
+
[hw, hd],
|
|
56208
|
+
[-hw, hd],
|
|
56209
|
+
[-hw, hd - tf],
|
|
56210
|
+
[-tw / 2, hd - tf],
|
|
56211
|
+
[-tw / 2, -hd + tf],
|
|
56212
|
+
[-hw, -hd + tf]
|
|
56213
|
+
];
|
|
56214
|
+
}
|
|
56215
|
+
case "C": {
|
|
56216
|
+
const tf = Math.max(d * 0.1, 5), tw = Math.max(w * 0.12, 5);
|
|
56217
|
+
return [[-hw, -hd], [hw, -hd], [hw, -hd + tf], [-hw + tw, -hd + tf], [-hw + tw, hd - tf], [hw, hd - tf], [hw, hd], [-hw, hd]];
|
|
56218
|
+
}
|
|
56219
|
+
case "L": {
|
|
56220
|
+
const t = Math.max(Math.min(w, d) * 0.18, 5);
|
|
56221
|
+
return [[-hw, -hd], [hw, -hd], [hw, -hd + t], [-hw + t, -hd + t], [-hw + t, hd], [-hw, hd]];
|
|
56249
56222
|
}
|
|
56223
|
+
default:
|
|
56224
|
+
return [[-hw, -hd], [hw, -hd], [hw, hd], [-hw, hd]];
|
|
56250
56225
|
}
|
|
56251
|
-
for (const sigs of idx.values()) sigs.sort();
|
|
56252
|
-
return idx;
|
|
56253
56226
|
}
|
|
56254
|
-
function
|
|
56255
|
-
const
|
|
56256
|
-
const
|
|
56257
|
-
const
|
|
56258
|
-
const
|
|
56259
|
-
const
|
|
56260
|
-
const
|
|
56261
|
-
const
|
|
56262
|
-
const
|
|
56263
|
-
const
|
|
56264
|
-
const
|
|
56265
|
-
|
|
56266
|
-
|
|
56267
|
-
|
|
56268
|
-
|
|
56269
|
-
|
|
56270
|
-
|
|
56271
|
-
|
|
56272
|
-
const
|
|
56273
|
-
const
|
|
56274
|
-
|
|
56275
|
-
|
|
56276
|
-
const
|
|
56277
|
-
const
|
|
56278
|
-
const
|
|
56279
|
-
const
|
|
56280
|
-
|
|
56281
|
-
|
|
56282
|
-
|
|
56283
|
-
|
|
56284
|
-
|
|
56285
|
-
|
|
56286
|
-
|
|
56287
|
-
|
|
56288
|
-
|
|
56289
|
-
|
|
56290
|
-
|
|
56291
|
-
|
|
56292
|
-
|
|
56293
|
-
|
|
56294
|
-
|
|
56295
|
-
|
|
56296
|
-
|
|
56297
|
-
|
|
56298
|
-
|
|
56299
|
-
|
|
56300
|
-
|
|
56301
|
-
|
|
56302
|
-
|
|
56303
|
-
|
|
56304
|
-
|
|
56305
|
-
|
|
56306
|
-
|
|
56307
|
-
|
|
56308
|
-
|
|
56309
|
-
|
|
56310
|
-
|
|
56311
|
-
|
|
56312
|
-
const jB = jointsB.get(b.id) ?? [];
|
|
56313
|
-
if (stable(jA) !== stable(jB)) parts.push(jointsSummary(jA, jB));
|
|
56314
|
-
}
|
|
56315
|
-
if (parts.length) {
|
|
56316
|
-
connections.push({ ref: refOf(b), summary: parts.join("; ") });
|
|
56317
|
-
changed = true;
|
|
56227
|
+
function expandBasePlate(joint, col) {
|
|
56228
|
+
const p = joint.params;
|
|
56229
|
+
const base = col.from[2] <= col.to[2] ? col.from : col.to;
|
|
56230
|
+
const [bx, by, bz] = base;
|
|
56231
|
+
const { w, d } = col.dims;
|
|
56232
|
+
const thickness = pos(p, "thickness", 25);
|
|
56233
|
+
const margin = Math.max(0, num(p, "margin", 75));
|
|
56234
|
+
const width = pos(p, "plateWidth", Math.max(w, d) + 2 * margin);
|
|
56235
|
+
const depth = pos(p, "plateDepth", Math.max(w, d) + 2 * margin);
|
|
56236
|
+
const boltDia = pos(p, "boltDia", 24);
|
|
56237
|
+
const clearance = num(p, "holeClearance", 6);
|
|
56238
|
+
const edge = num(p, "edgeDist", Math.max(1.5 * boltDia, 40));
|
|
56239
|
+
const cols = intMin1(p, "boltCols", 2);
|
|
56240
|
+
const rows = intMin1(p, "boltRows", 2);
|
|
56241
|
+
const weldLeg = num(p, "weldLeg", 8);
|
|
56242
|
+
const projBelow = num(p, "projBelow", Math.max(220, 9 * boltDia));
|
|
56243
|
+
const embedment = Math.max(0, num(p, "embedment", 0));
|
|
56244
|
+
const grout = Math.max(0, num(p, "grout", 0));
|
|
56245
|
+
const nutH = pos(p, "nutHeight", 0.8 * boltDia);
|
|
56246
|
+
const nutAF = pos(p, "nutAcrossFlats", 1.6 * boltDia);
|
|
56247
|
+
const wpSide = pos(p, "washerPlateSide", 2.5 * boltDia);
|
|
56248
|
+
const wpThick = pos(p, "washerPlateThickness", Math.max(0.35 * boltDia, 8));
|
|
56249
|
+
const washerOD = pos(p, "washerOuter", 2 * boltDia);
|
|
56250
|
+
const washerID = boltDia + 3;
|
|
56251
|
+
const washerH = pos(p, "washerThickness", Math.max(0.25 * boltDia, 4));
|
|
56252
|
+
const levelingNut = p?.["levelingNut"] !== false;
|
|
56253
|
+
const anchorPlate = p?.["anchorPlate"] !== false;
|
|
56254
|
+
const apSide = pos(p, "anchorPlateSide", 3.3 * boltDia);
|
|
56255
|
+
const apThick = pos(p, "anchorPlateThickness", Math.max(0.6 * boltDia, 20));
|
|
56256
|
+
const bottomNut = p?.["bottomNut"] !== false;
|
|
56257
|
+
const rodProj = pos(p, "anchorRodProjection", 25.4 / 4);
|
|
56258
|
+
const SEAT = 0.5;
|
|
56259
|
+
const rodBelow = Math.max(embedment > 0 ? grout + embedment : projBelow, rodProj + nutH + apThick + SEAT);
|
|
56260
|
+
const plateTop = bz + EMBED, plateBottom = plateTop - thickness;
|
|
56261
|
+
const us = spread(cols, Math.max(0, width / 2 - edge));
|
|
56262
|
+
const vs = spread(rows, Math.max(0, depth / 2 - edge));
|
|
56263
|
+
const holes = [];
|
|
56264
|
+
const kit = [];
|
|
56265
|
+
const wpBot = plateTop + SEAT, wpTop = wpBot + wpThick, washerTop = wpTop + washerH, fnTop = washerTop + nutH;
|
|
56266
|
+
const rodTopZ = fnTop + 0.4 * boltDia, rodBotZ = plateBottom - rodBelow;
|
|
56267
|
+
const concreteTopZ = plateBottom - (embedment > 0 ? grout : 0);
|
|
56268
|
+
let k = 0;
|
|
56269
|
+
for (const v of vs) {
|
|
56270
|
+
for (const u of us) {
|
|
56271
|
+
const ax = bx + u, ay = by + v, jid = joint.id;
|
|
56272
|
+
holes.push({ u, v, d: boltDia + clearance });
|
|
56273
|
+
kit.push(
|
|
56274
|
+
{ id: `${jid}:rod${k}`, group: "anchor", kind: "rod", from: [ax, ay, rodBotZ], to: [ax, ay, rodTopZ], d: boltDia, meta: { label: `Anchor rod \u2300${boltDia}` } },
|
|
56275
|
+
{ id: `${jid}:wp${k}`, group: "washer-plate", kind: "plate", center: [ax, ay, wpBot + wpThick / 2], uDir: [1, 0, 0], vDir: [0, 1, 0], width: wpSide, depth: wpSide, thickness: wpThick, holes: [{ u: 0, v: 0, d: boltDia + 2 }], meta: { label: `Washer plate ${Math.round(wpSide)}\xD7${Math.round(wpSide)}\xD7${Math.round(wpThick)}` } },
|
|
56276
|
+
{ id: `${jid}:wsh${k}`, group: "washer", kind: "washer", from: [ax, ay, wpTop], to: [ax, ay, washerTop], dOuter: washerOD, dInner: washerID, meta: { label: `Washer \u2300${Math.round(washerOD)}` } },
|
|
56277
|
+
{ id: `${jid}:fn${k}`, group: "nut", kind: "nut", from: [ax, ay, washerTop], to: [ax, ay, fnTop], acrossFlats: nutAF, meta: { label: `Nut M${boltDia}` } }
|
|
56278
|
+
);
|
|
56279
|
+
if (levelingNut) kit.push({ id: `${jid}:ln${k}`, group: "nut", kind: "nut", from: [ax, ay, plateBottom - SEAT - nutH], to: [ax, ay, plateBottom - SEAT], acrossFlats: nutAF, meta: { label: `Leveling nut M${boltDia}` } });
|
|
56280
|
+
const nutBotZ = rodBotZ + rodProj;
|
|
56281
|
+
if (bottomNut) kit.push({ id: `${jid}:fnb${k}`, group: "nut", kind: "nut", from: [ax, ay, nutBotZ], to: [ax, ay, nutBotZ + nutH], acrossFlats: nutAF, meta: { label: `Anchor nut M${boltDia}` } });
|
|
56282
|
+
const apBotZ = nutBotZ + (bottomNut ? nutH : 0);
|
|
56283
|
+
if (anchorPlate) kit.push({ id: `${jid}:ap${k}`, group: "anchor-plate", kind: "plate", center: [ax, ay, apBotZ + apThick / 2], uDir: [1, 0, 0], vDir: [0, 1, 0], width: apSide, depth: apSide, thickness: apThick, holes: [{ u: 0, v: 0, d: boltDia + 2 }], meta: { label: `Anchor plate ${Math.round(apSide)}\xD7${Math.round(apSide)}\xD7${Math.round(apThick)}` } });
|
|
56284
|
+
k++;
|
|
56318
56285
|
}
|
|
56319
|
-
if (!changed) unchanged++;
|
|
56320
56286
|
}
|
|
56321
|
-
const
|
|
56322
|
-
|
|
56323
|
-
|
|
56324
|
-
|
|
56325
|
-
|
|
56326
|
-
|
|
56327
|
-
|
|
56328
|
-
|
|
56329
|
-
|
|
56330
|
-
|
|
56331
|
-
|
|
56287
|
+
const plate = {
|
|
56288
|
+
id: `${joint.id}:plate`,
|
|
56289
|
+
group: "base-plate",
|
|
56290
|
+
kind: "plate",
|
|
56291
|
+
center: [bx, by, plateBottom + thickness / 2],
|
|
56292
|
+
// plate top seats the column (= bz + EMBED); body hangs below
|
|
56293
|
+
uDir: [1, 0, 0],
|
|
56294
|
+
vDir: [0, 1, 0],
|
|
56295
|
+
width,
|
|
56296
|
+
depth,
|
|
56297
|
+
thickness,
|
|
56298
|
+
holes,
|
|
56299
|
+
meta: {
|
|
56300
|
+
label: `Base plate ${Math.round(width)}\xD7${Math.round(depth)}\xD7${Math.round(thickness)}`,
|
|
56301
|
+
// anchor depth for the view's PROJ/GROUT/EMBED overlay + the rod inspector. projection is above B.O.
|
|
56302
|
+
// plate; the grout pad sits B.O. plate → T.O. concrete; embedment is INTO the concrete (T.O. concrete → rod bottom).
|
|
56303
|
+
anchor: { rodTopZ, rodBotZ, plateBotZ: plateBottom, concreteTopZ, projMm: rodTopZ - plateBottom, groutMm: plateBottom - concreteTopZ, embedMm: concreteTopZ - rodBotZ, embedSet: embedment > 0 }
|
|
56332
56304
|
}
|
|
56333
56305
|
};
|
|
56334
|
-
const
|
|
56335
|
-
const
|
|
56336
|
-
const
|
|
56337
|
-
const
|
|
56338
|
-
|
|
56339
|
-
|
|
56340
|
-
|
|
56341
|
-
|
|
56342
|
-
|
|
56343
|
-
|
|
56344
|
-
from: 0,
|
|
56345
|
-
to: 0,
|
|
56346
|
-
tonnage: {
|
|
56347
|
-
fromLb: fromBom.totalLb,
|
|
56348
|
-
toLb: toBom.totalLb,
|
|
56349
|
-
netLb,
|
|
56350
|
-
fromTons: fromBom.totalTons,
|
|
56351
|
-
toTons: toBom.totalTons,
|
|
56352
|
-
netTons: Math.round(netLb / 2e3 * 10) / 10
|
|
56353
|
-
},
|
|
56354
|
-
added,
|
|
56355
|
-
removed,
|
|
56356
|
-
resized,
|
|
56357
|
-
moved,
|
|
56358
|
-
material,
|
|
56359
|
-
connections,
|
|
56360
|
-
unchanged,
|
|
56361
|
-
warnings
|
|
56306
|
+
const axisSign = col.to[2] < col.from[2] ? -1 : 1;
|
|
56307
|
+
const rollRad = (col.rot || 0) * Math.PI * axisSign / 180;
|
|
56308
|
+
const cosR = Math.cos(rollRad), sinR = Math.sin(rollRad);
|
|
56309
|
+
const weld = {
|
|
56310
|
+
id: `${joint.id}:weld`,
|
|
56311
|
+
group: "weld",
|
|
56312
|
+
kind: "weld",
|
|
56313
|
+
path: profileOutline(col.profile, w, d).map(([u, vv]) => [bx + (u * cosR - vv * sinR), by + (u * sinR + vv * cosR), bz]),
|
|
56314
|
+
leg: weldLeg,
|
|
56315
|
+
meta: { label: `Fillet ${weldLeg}` }
|
|
56362
56316
|
};
|
|
56317
|
+
return [plate, ...kit, weld];
|
|
56363
56318
|
}
|
|
56364
|
-
|
|
56365
|
-
|
|
56366
|
-
function appSupportsDiff(app) {
|
|
56367
|
-
return app === "steel-model";
|
|
56319
|
+
function webHalfThk(profile, w) {
|
|
56320
|
+
return profileKind(profile) === "I" ? Math.min(w * 0.5, Math.max(w * 0.1, 5)) / 2 : 0;
|
|
56368
56321
|
}
|
|
56369
|
-
function
|
|
56370
|
-
|
|
56371
|
-
const
|
|
56372
|
-
|
|
56373
|
-
const
|
|
56374
|
-
|
|
56375
|
-
|
|
56376
|
-
|
|
56377
|
-
|
|
56378
|
-
|
|
56379
|
-
|
|
56380
|
-
|
|
56322
|
+
function distPointSeg(p, a, b) {
|
|
56323
|
+
const abx = b[0] - a[0], aby = b[1] - a[1], abz = b[2] - a[2];
|
|
56324
|
+
const apx = p[0] - a[0], apy = p[1] - a[1], apz = p[2] - a[2];
|
|
56325
|
+
const len2 = abx * abx + aby * aby + abz * abz;
|
|
56326
|
+
const t = len2 > 1e-9 ? Math.max(0, Math.min(1, (apx * abx + apy * aby + apz * abz) / len2)) : 0;
|
|
56327
|
+
return Math.hypot(apx - t * abx, apy - t * aby, apz - t * abz);
|
|
56328
|
+
}
|
|
56329
|
+
function unitDir(a, b) {
|
|
56330
|
+
const dx = b[0] - a[0], dy = b[1] - a[1], dz = b[2] - a[2];
|
|
56331
|
+
const L = Math.hypot(dx, dy, dz);
|
|
56332
|
+
return L > 1e-9 ? [dx / L, dy / L, dz / L] : null;
|
|
56333
|
+
}
|
|
56334
|
+
function inferSupport(beam, end, memberGeo) {
|
|
56335
|
+
const bd = unitDir(beam.from, beam.to);
|
|
56336
|
+
let best, bestD = Infinity;
|
|
56337
|
+
for (const m of memberGeo.values()) {
|
|
56338
|
+
if (m.id === beam.id || m.isBrace || !finite3(m.from) || !finite3(m.to)) continue;
|
|
56339
|
+
const md = unitDir(m.from, m.to);
|
|
56340
|
+
if (bd && md && Math.abs(bd[0] * md[0] + bd[1] * md[1] + bd[2] * md[2]) > 0.966) continue;
|
|
56341
|
+
const d = distPointSeg(end, m.from, m.to);
|
|
56342
|
+
if (d < bestD) {
|
|
56343
|
+
bestD = d;
|
|
56344
|
+
best = m;
|
|
56345
|
+
}
|
|
56381
56346
|
}
|
|
56382
|
-
|
|
56383
|
-
if (!Number.isInteger(b) || b < 1 || b >= n) return { code: 400, body: { ok: false, error: `base must be an integer in 1..${n - 1}` } };
|
|
56384
|
-
const from = readVersionSkeleton(id, b);
|
|
56385
|
-
if (from == null) return { code: 404, body: { ok: false, error: `base version v${b} not found` } };
|
|
56386
|
-
const diff = diffContracts(from, to);
|
|
56387
|
-
diff.from = b;
|
|
56388
|
-
diff.to = n;
|
|
56389
|
-
return { code: 200, body: { ok: true, diff } };
|
|
56347
|
+
return best && bestD <= Math.max(best.dims.w, best.dims.d) ? best : void 0;
|
|
56390
56348
|
}
|
|
56391
|
-
|
|
56392
|
-
|
|
56393
|
-
var import_node_crypto10 = require("node:crypto");
|
|
56394
|
-
var import_node_fs27 = require("node:fs");
|
|
56395
|
-
var import_node_path24 = require("node:path");
|
|
56396
|
-
var sourcesDir = (id) => (0, import_node_path24.join)(projectDir(id), "sources");
|
|
56397
|
-
var safeExt = (ext) => typeof ext === "string" && /^[a-z0-9]{1,8}$/i.test(ext) ? ext.toLowerCase() : "bin";
|
|
56398
|
-
function writeAtomic2(path, buf) {
|
|
56399
|
-
const tmp = `${path}.${process.pid}.tmp`;
|
|
56400
|
-
(0, import_node_fs27.writeFileSync)(tmp, buf);
|
|
56401
|
-
(0, import_node_fs27.renameSync)(tmp, path);
|
|
56349
|
+
function flangeThk(profile, d) {
|
|
56350
|
+
return profileKind(profile) === "I" ? Math.min(d * 0.5, Math.max(d * 0.1, 6)) : d / 2;
|
|
56402
56351
|
}
|
|
56403
|
-
|
|
56404
|
-
|
|
56405
|
-
const
|
|
56406
|
-
const
|
|
56407
|
-
const
|
|
56408
|
-
if (!(
|
|
56409
|
-
|
|
56352
|
+
var clamp = (x, lo, hi) => Math.max(lo, Math.min(hi, x));
|
|
56353
|
+
function supportWorkZAt(support, pt) {
|
|
56354
|
+
const a = support.from, b = support.to;
|
|
56355
|
+
const dx = b[0] - a[0], dy = b[1] - a[1];
|
|
56356
|
+
const len2 = dx * dx + dy * dy;
|
|
56357
|
+
if (!(len2 > 1e-9)) return a[2];
|
|
56358
|
+
const t = clamp(((pt[0] - a[0]) * dx + (pt[1] - a[1]) * dy) / len2, 0, 1);
|
|
56359
|
+
return a[2] + (b[2] - a[2]) * t;
|
|
56410
56360
|
}
|
|
56411
|
-
|
|
56412
|
-
|
|
56413
|
-
|
|
56414
|
-
|
|
56415
|
-
|
|
56416
|
-
const
|
|
56417
|
-
|
|
56418
|
-
|
|
56419
|
-
|
|
56420
|
-
const
|
|
56421
|
-
const
|
|
56422
|
-
const
|
|
56423
|
-
|
|
56424
|
-
|
|
56425
|
-
|
|
56426
|
-
|
|
56427
|
-
const
|
|
56428
|
-
|
|
56429
|
-
|
|
56430
|
-
|
|
56431
|
-
|
|
56432
|
-
|
|
56433
|
-
|
|
56434
|
-
|
|
56435
|
-
|
|
56436
|
-
|
|
56437
|
-
|
|
56438
|
-
|
|
56439
|
-
|
|
56440
|
-
|
|
56441
|
-
const
|
|
56442
|
-
|
|
56443
|
-
|
|
56444
|
-
|
|
56445
|
-
|
|
56446
|
-
|
|
56447
|
-
|
|
56448
|
-
|
|
56449
|
-
|
|
56450
|
-
|
|
56451
|
-
|
|
56452
|
-
|
|
56453
|
-
|
|
56454
|
-
|
|
56455
|
-
|
|
56361
|
+
function beamCopes(beam, support, at, params) {
|
|
56362
|
+
if (!support || !finite3(support.from) || !finite3(support.to) || !support.dims || !(support.dims.d > 0) || !(support.dims.w > 0)) return {};
|
|
56363
|
+
if (!finite3(beam.from) || !finite3(beam.to) || !beam.dims || !(beam.dims.d > 0) || !(beam.dims.w > 0)) return {};
|
|
56364
|
+
if (profileKind(support.profile) !== "I") return {};
|
|
56365
|
+
const endPt = at === "end1" ? beam.to : beam.from;
|
|
56366
|
+
const gap = Math.max(0, num(params, "clearance", 12.7));
|
|
56367
|
+
const beamMidZ = endPt[2] + (typeof beam.posOffset === "number" && isFinite(beam.posOffset) ? beam.posOffset : 0);
|
|
56368
|
+
const beamTopZ = beamMidZ + beam.dims.d / 2, beamBotZ = beamMidZ - beam.dims.d / 2;
|
|
56369
|
+
const supMidZ = supportWorkZAt(support, endPt) + (typeof support.posOffset === "number" && isFinite(support.posOffset) ? support.posOffset : 0);
|
|
56370
|
+
const supTopZ = supMidZ + support.dims.d / 2, supBotZ = supMidZ - support.dims.d / 2;
|
|
56371
|
+
const tfS = flangeThk(support.profile, support.dims.d);
|
|
56372
|
+
const kClear = Math.max(0, num(params, "copeKClear", 12.7));
|
|
56373
|
+
const minLen = Math.max(0, num(params, "copeMinLength", 31.75));
|
|
56374
|
+
const kBand = tfS + kClear;
|
|
56375
|
+
const webLo = supBotZ + kBand, webHi = supTopZ - kBand;
|
|
56376
|
+
if (!(webLo < webHi && beamTopZ > webLo && beamBotZ < webHi)) return {};
|
|
56377
|
+
const length = Math.max(support.dims.w / 2 + gap, minLen);
|
|
56378
|
+
const out = {};
|
|
56379
|
+
if (beamTopZ > webHi) out.top = { depth: clamp(beamTopZ - (webHi - gap), 0, beam.dims.d), length };
|
|
56380
|
+
if (beamBotZ < webLo) out.bottom = { depth: clamp(webLo + gap - beamBotZ, 0, beam.dims.d), length };
|
|
56381
|
+
return out;
|
|
56382
|
+
}
|
|
56383
|
+
var IN = 25.4;
|
|
56384
|
+
function aiscBoltLength(gripMm, diaMm) {
|
|
56385
|
+
const Q = IN / 4;
|
|
56386
|
+
const raw = gripMm + diaMm + Q;
|
|
56387
|
+
const step = raw > 5 * IN ? 2 * Q : Q;
|
|
56388
|
+
return Math.ceil((raw - 1e-6) / step) * step;
|
|
56389
|
+
}
|
|
56390
|
+
function expandShearPlate(joint, beam, support) {
|
|
56391
|
+
const p = joint.params;
|
|
56392
|
+
const atEnd1 = joint.at === "end1";
|
|
56393
|
+
const endPt = atEnd1 ? beam.to : beam.from;
|
|
56394
|
+
const farPt = atEnd1 ? beam.from : beam.to;
|
|
56395
|
+
let ux = farPt[0] - endPt[0], uy = farPt[1] - endPt[1];
|
|
56396
|
+
const hLen = Math.hypot(ux, uy);
|
|
56397
|
+
if (!(hLen > 1e-6)) return [];
|
|
56398
|
+
ux /= hLen;
|
|
56399
|
+
uy /= hLen;
|
|
56400
|
+
const uDir = [ux, uy, 0];
|
|
56401
|
+
const vDir = [0, 0, 1];
|
|
56402
|
+
const nDir = [uy, -ux, 0];
|
|
56403
|
+
const posOff = typeof beam.posOffset === "number" && isFinite(beam.posOffset) ? beam.posOffset : 0;
|
|
56404
|
+
const webZ = endPt[2] + posOff;
|
|
56405
|
+
const P = (u, v, n) => [
|
|
56406
|
+
endPt[0] + uDir[0] * u + nDir[0] * n,
|
|
56407
|
+
endPt[1] + uDir[1] * u + nDir[1] * n,
|
|
56408
|
+
webZ + v
|
|
56409
|
+
];
|
|
56410
|
+
const thickness = pos(p, "plateThickness", 10);
|
|
56411
|
+
const width = pos(p, "plateWidth", 120);
|
|
56412
|
+
const boltDia = pos(p, "boltDia", 20);
|
|
56413
|
+
const cols = intMin1(p, "boltCols", 1);
|
|
56414
|
+
const rows = intMin1(p, "boltRows", 3);
|
|
56415
|
+
const pitch = pos(p, "boltPitch", 70);
|
|
56416
|
+
const colPitch = pos(p, "boltColPitch", pitch);
|
|
56417
|
+
const holeClr = num(p, "holeClearance", 2);
|
|
56418
|
+
const edge = Math.max(0, num(p, "edgeDist", Math.max(1.5 * boltDia, 30)));
|
|
56419
|
+
const weldLeg = num(p, "weldLeg", 6);
|
|
56420
|
+
const clearance = Math.max(0, num(p, "clearance", 12.7));
|
|
56421
|
+
const stiffener = p?.["stiffener"] === true;
|
|
56422
|
+
const height = pos(p, "plateHeight", (rows - 1) * pitch + 2 * edge);
|
|
56423
|
+
const twHalf = webHalfThk(beam.profile, beam.dims.w);
|
|
56424
|
+
const webSide = num(p, "webSide", 1) >= 0 ? 1 : -1;
|
|
56425
|
+
const pOff = webSide * (twHalf + thickness / 2);
|
|
56426
|
+
const u0 = support ? webHalfThk(support.profile, support.dims.w) : 0;
|
|
56427
|
+
const edgeV = Math.min(edge, height * 0.4);
|
|
56428
|
+
const pV = rows > 1 ? Math.min(pitch, Math.max(0, height - 2 * edgeV) / (rows - 1)) : 0;
|
|
56429
|
+
const vOffs = Array.from({ length: rows }, (_, i) => (i - (rows - 1) / 2) * pV);
|
|
56430
|
+
const edgeU = Math.min(edge, width * 0.4);
|
|
56431
|
+
const regHi = Math.max(edgeU, width - edgeU);
|
|
56432
|
+
const regLo = Math.min(clearance + edgeU, regHi);
|
|
56433
|
+
const cU = (regLo + regHi) / 2;
|
|
56434
|
+
const pU = cols > 1 ? Math.min(colPitch, (regHi - regLo) / (cols - 1)) : 0;
|
|
56435
|
+
const uOffs = Array.from({ length: cols }, (_, j) => cU + (j - (cols - 1) / 2) * pU);
|
|
56436
|
+
const nutH = 0.8 * boltDia, nutAF = 1.6 * boltDia;
|
|
56437
|
+
const plateOuterN = webSide * (twHalf + thickness);
|
|
56438
|
+
const webFarN = -webSide * twHalf;
|
|
56439
|
+
const headTipN = plateOuterN + webSide * nutH;
|
|
56440
|
+
const nutTipN = webFarN - webSide * nutH;
|
|
56441
|
+
const grade = p?.["boltGrade"] === "A490" ? "A490" : "A325";
|
|
56442
|
+
const grip = thickness + 2 * twHalf;
|
|
56443
|
+
const boltLen = aiscBoltLength(grip, boltDia);
|
|
56444
|
+
const callout = `\u2300${Math.round(boltDia)} ${grade} \xD7 ${Math.round(boltLen)}`;
|
|
56445
|
+
const holes = [];
|
|
56446
|
+
const bolts = [];
|
|
56447
|
+
let k = 0;
|
|
56448
|
+
for (const v of vOffs) {
|
|
56449
|
+
for (const u of uOffs) {
|
|
56450
|
+
const jid = joint.id;
|
|
56451
|
+
holes.push({ u: u - width / 2, v, d: boltDia + holeClr });
|
|
56452
|
+
bolts.push(
|
|
56453
|
+
// the shank = the AISC bolt LENGTH, from under the head (plate outer face) into the connection
|
|
56454
|
+
{ id: `${jid}:bolt${k}`, group: "bolt", kind: "rod", from: P(u0 + u, v, plateOuterN), to: P(u0 + u, v, plateOuterN - webSide * boltLen), d: boltDia, meta: { label: `Bolt ${callout}` } },
|
|
56455
|
+
{ id: `${jid}:head${k}`, group: "nut", kind: "nut", from: P(u0 + u, v, plateOuterN), to: P(u0 + u, v, headTipN), acrossFlats: nutAF, meta: { label: `Bolt head ${callout}` } },
|
|
56456
|
+
{ id: `${jid}:nut${k}`, group: "nut", kind: "nut", from: P(u0 + u, v, webFarN), to: P(u0 + u, v, nutTipN), acrossFlats: nutAF, meta: { label: `Bolt nut ${callout}` } }
|
|
56456
56457
|
);
|
|
56458
|
+
k++;
|
|
56457
56459
|
}
|
|
56458
|
-
baked.filter = next;
|
|
56459
|
-
}
|
|
56460
|
-
if (Array.isArray(baked.sheets)) {
|
|
56461
|
-
baked.sheets = baked.sheets.map(
|
|
56462
|
-
(s) => s && typeof s === "object" ? { ...s, page: stripPageRaster(s.page) } : s
|
|
56463
|
-
);
|
|
56464
56460
|
}
|
|
56465
|
-
|
|
56466
|
-
|
|
56467
|
-
|
|
56468
|
-
|
|
56469
|
-
|
|
56470
|
-
|
|
56471
|
-
|
|
56472
|
-
|
|
56473
|
-
|
|
56474
|
-
|
|
56475
|
-
|
|
56476
|
-
|
|
56477
|
-
|
|
56478
|
-
});
|
|
56479
|
-
let counter = 0;
|
|
56480
|
-
const nextId = () => {
|
|
56481
|
-
let id;
|
|
56482
|
-
do {
|
|
56483
|
-
counter += 1;
|
|
56484
|
-
id = `${prefix}${counter}`;
|
|
56485
|
-
} while (used.has(id));
|
|
56486
|
-
used.add(id);
|
|
56487
|
-
return id;
|
|
56461
|
+
const plate = {
|
|
56462
|
+
id: `${joint.id}:plate`,
|
|
56463
|
+
group: "shear-plate",
|
|
56464
|
+
kind: "plate",
|
|
56465
|
+
center: P(u0 + width / 2, 0, pOff),
|
|
56466
|
+
uDir,
|
|
56467
|
+
vDir,
|
|
56468
|
+
// welded edge at the support web FACE (u0); lapped on the webSide face; cantilevered +uDir toward the beam
|
|
56469
|
+
width,
|
|
56470
|
+
depth: height,
|
|
56471
|
+
thickness,
|
|
56472
|
+
holes,
|
|
56473
|
+
meta: { label: `Shear plate ${Math.round(width)}\xD7${Math.round(height)}\xD7${Math.round(thickness)}` }
|
|
56488
56474
|
};
|
|
56489
|
-
|
|
56490
|
-
|
|
56491
|
-
|
|
56492
|
-
const
|
|
56493
|
-
|
|
56494
|
-
|
|
56495
|
-
|
|
56475
|
+
const weldSide = p?.["weldSide"] === "near" || p?.["weldSide"] === "far" ? p["weldSide"] : "both";
|
|
56476
|
+
const nOuter = pOff + webSide * thickness / 2;
|
|
56477
|
+
const nInner = pOff - webSide * thickness / 2;
|
|
56478
|
+
const faceWeld = (suffix, n) => ({
|
|
56479
|
+
id: `${joint.id}:${suffix}`,
|
|
56480
|
+
group: "weld",
|
|
56481
|
+
kind: "weld",
|
|
56482
|
+
closed: false,
|
|
56483
|
+
path: [P(u0, -height / 2, n), P(u0, height / 2, n)],
|
|
56484
|
+
leg: weldLeg,
|
|
56485
|
+
// at the support web FACE
|
|
56486
|
+
meta: { label: `Fillet ${weldLeg} (${weldSide === "both" ? "both sides" : weldSide + " side"})` }
|
|
56487
|
+
});
|
|
56488
|
+
const welds = [];
|
|
56489
|
+
if (weldSide !== "far") welds.push(faceWeld("weld", nOuter));
|
|
56490
|
+
if (weldSide !== "near") welds.push(faceWeld("weld2", nInner));
|
|
56491
|
+
const parts = [plate, ...bolts, ...welds];
|
|
56492
|
+
if (stiffener) {
|
|
56493
|
+
if (support && support.role === "beam" && !support.isBrace && finite3(support.from) && finite3(support.to) && support.dims && support.dims.d > 0 && support.dims.w > 0) {
|
|
56494
|
+
const supPosOff = typeof support.posOffset === "number" && isFinite(support.posOffset) ? support.posOffset : 0;
|
|
56495
|
+
const twGirder = webHalfThk(support.profile, support.dims.w) * 2;
|
|
56496
|
+
const stiffH = support.dims.d * 0.9;
|
|
56497
|
+
const stiffW = Math.max(support.dims.w / 2 - twGirder / 2, thickness * 2);
|
|
56498
|
+
const girderCentZ = endPt[2] + supPosOff;
|
|
56499
|
+
const cu = -(twGirder / 2 + stiffW / 2);
|
|
56500
|
+
const center = [endPt[0] + uDir[0] * cu, endPt[1] + uDir[1] * cu, girderCentZ];
|
|
56501
|
+
parts.push({ id: `${joint.id}:stiff`, group: "stiffener", kind: "plate", center, uDir, vDir, width: stiffW, depth: stiffH, thickness, holes: [], meta: { label: `Stiffener ${Math.round(stiffW)}\xD7${Math.round(stiffH)}\xD7${Math.round(thickness)}` } });
|
|
56502
|
+
const wfx = endPt[0] - uDir[0] * (twGirder / 2), wfy = endPt[1] - uDir[1] * (twGirder / 2);
|
|
56503
|
+
parts.push({ id: `${joint.id}:stiffweld`, group: "weld", kind: "weld", closed: false, path: [[wfx, wfy, girderCentZ - stiffH / 2], [wfx, wfy, girderCentZ + stiffH / 2]], leg: weldLeg, meta: { label: `Fillet ${weldLeg}` } });
|
|
56504
|
+
} else {
|
|
56505
|
+
const oppOff = -webSide * (twHalf + thickness / 2);
|
|
56506
|
+
parts.push({ id: `${joint.id}:stiff`, group: "stiffener", kind: "plate", center: P(u0 + width / 2, 0, oppOff), uDir, vDir, width, depth: height, thickness, holes: [], meta: { label: `Stiffener ${Math.round(width)}\xD7${Math.round(height)}\xD7${Math.round(thickness)}` } });
|
|
56507
|
+
parts.push({ id: `${joint.id}:stiffweld`, group: "weld", kind: "weld", closed: false, path: [P(u0, -height / 2, oppOff), P(u0, height / 2, oppOff)], leg: weldLeg, meta: { label: `Fillet ${weldLeg}` } });
|
|
56508
|
+
}
|
|
56496
56509
|
}
|
|
56497
|
-
|
|
56498
|
-
|
|
56499
|
-
|
|
56510
|
+
const cope = beamCopes(beam, support, joint.at ?? "end0", p);
|
|
56511
|
+
const copeRadius = pos(p, "copeRadius", 12.7);
|
|
56512
|
+
const MIN_COPE = 1;
|
|
56513
|
+
const pushCope = (side, dec) => {
|
|
56514
|
+
if (!(dec.depth > MIN_COPE)) return;
|
|
56515
|
+
const lenU = dec.length + clearance;
|
|
56516
|
+
const vC = side === "top" ? beam.dims.d / 2 - dec.depth / 2 : -beam.dims.d / 2 + dec.depth / 2;
|
|
56517
|
+
parts.push({
|
|
56518
|
+
id: `${joint.id}:cope-${side}`,
|
|
56519
|
+
group: "cope",
|
|
56520
|
+
kind: "cut",
|
|
56521
|
+
member: beam.id,
|
|
56522
|
+
center: P(lenU / 2, vC, 0),
|
|
56523
|
+
uDir,
|
|
56524
|
+
vDir,
|
|
56525
|
+
width: lenU,
|
|
56526
|
+
depth: dec.depth,
|
|
56527
|
+
thickness: beam.dims.w + 2,
|
|
56528
|
+
radius: copeRadius,
|
|
56529
|
+
reentrantV: side === "top" ? -1 : 1,
|
|
56530
|
+
// web side = toward the beam centroid (top cope below, bottom above)
|
|
56531
|
+
meta: { label: `${side === "top" ? "Top" : "Bottom"} cope ${Math.round(dec.length)}\xD7${Math.round(dec.depth)}` }
|
|
56532
|
+
});
|
|
56533
|
+
};
|
|
56534
|
+
if (cope.top) pushCope("top", cope.top);
|
|
56535
|
+
if (cope.bottom) pushCope("bottom", cope.bottom);
|
|
56536
|
+
return parts;
|
|
56500
56537
|
}
|
|
56501
|
-
function
|
|
56502
|
-
const
|
|
56538
|
+
function expandCustom(joint) {
|
|
56539
|
+
const place = finite3(joint.place) ? joint.place : [0, 0, 0];
|
|
56540
|
+
const [dx, dy, dz] = place;
|
|
56503
56541
|
const out = [];
|
|
56504
|
-
|
|
56505
|
-
|
|
56506
|
-
if (
|
|
56507
|
-
|
|
56508
|
-
|
|
56542
|
+
(joint.geometry ?? []).forEach((g, i) => {
|
|
56543
|
+
if (!g || !Array.isArray(g.positions) || !Array.isArray(g.indices)) return;
|
|
56544
|
+
if (g.positions.length < 9 || g.indices.length < 3 || g.positions.length % 3 !== 0) return;
|
|
56545
|
+
const positions = new Array(g.positions.length);
|
|
56546
|
+
for (let k = 0; k < g.positions.length; k += 3) {
|
|
56547
|
+
positions[k] = g.positions[k] + dx;
|
|
56548
|
+
positions[k + 1] = g.positions[k + 1] + dy;
|
|
56549
|
+
positions[k + 2] = g.positions[k + 2] + dz;
|
|
56550
|
+
}
|
|
56551
|
+
const role = typeof g.role === "string" ? g.role : void 0;
|
|
56552
|
+
const label = role ? role.charAt(0).toUpperCase() + role.slice(1) : "Imported part";
|
|
56553
|
+
out.push({ id: `${joint.id}:${g.id || `m${i}`}`, group: "custom", kind: "mesh", positions, indices: g.indices.slice(), meta: { label, role } });
|
|
56509
56554
|
});
|
|
56510
56555
|
return out;
|
|
56511
56556
|
}
|
|
56512
|
-
function
|
|
56513
|
-
const
|
|
56514
|
-
const
|
|
56515
|
-
const
|
|
56516
|
-
|
|
56517
|
-
|
|
56518
|
-
|
|
56519
|
-
|
|
56557
|
+
function expandJoints(joints, memberGeo) {
|
|
56558
|
+
const elements = [];
|
|
56559
|
+
const skipped = [];
|
|
56560
|
+
const usedGroups = /* @__PURE__ */ new Set();
|
|
56561
|
+
(joints ?? []).forEach((j, i) => {
|
|
56562
|
+
if (!j || !j.id) {
|
|
56563
|
+
skipped.push(`joint#${i}`);
|
|
56564
|
+
return;
|
|
56565
|
+
}
|
|
56566
|
+
if (j.kind === "custom") {
|
|
56567
|
+
const parts = expandCustom(j);
|
|
56568
|
+
if (!parts.length) {
|
|
56569
|
+
skipped.push(j.id);
|
|
56570
|
+
return;
|
|
56571
|
+
}
|
|
56572
|
+
for (const part of parts) {
|
|
56573
|
+
part.conn = j.id;
|
|
56574
|
+
part.connKind = j.kind;
|
|
56575
|
+
elements.push(part);
|
|
56576
|
+
usedGroups.add(part.group);
|
|
56577
|
+
}
|
|
56578
|
+
} else if (j.kind === "base-plate") {
|
|
56579
|
+
const col = j.main ? memberGeo.get(j.main) : void 0;
|
|
56580
|
+
if (!col || col.role !== "column") {
|
|
56581
|
+
skipped.push(j.id);
|
|
56582
|
+
return;
|
|
56583
|
+
}
|
|
56584
|
+
if (!finite3(col.from) || !finite3(col.to) || !col.dims || !(col.dims.w > 0) || !(col.dims.d > 0)) {
|
|
56585
|
+
skipped.push(j.id);
|
|
56586
|
+
return;
|
|
56587
|
+
}
|
|
56588
|
+
for (const part of expandBasePlate(j, col)) {
|
|
56589
|
+
part.conn = j.id;
|
|
56590
|
+
part.connKind = j.kind;
|
|
56591
|
+
elements.push(part);
|
|
56592
|
+
usedGroups.add(part.group);
|
|
56593
|
+
}
|
|
56594
|
+
} else if (j.kind === "shear-plate") {
|
|
56595
|
+
const beam = j.main ? memberGeo.get(j.main) : void 0;
|
|
56596
|
+
if (!beam || beam.role !== "beam" || beam.isBrace) {
|
|
56597
|
+
skipped.push(j.id);
|
|
56598
|
+
return;
|
|
56599
|
+
}
|
|
56600
|
+
if (!finite3(beam.from) || !finite3(beam.to) || !beam.dims || !(beam.dims.w > 0) || !(beam.dims.d > 0)) {
|
|
56601
|
+
skipped.push(j.id);
|
|
56602
|
+
return;
|
|
56603
|
+
}
|
|
56604
|
+
let support = j.secondaries && j.secondaries[0] ? memberGeo.get(j.secondaries[0]) : void 0;
|
|
56605
|
+
if (support && support.isBrace) support = void 0;
|
|
56606
|
+
if (!support) support = inferSupport(beam, j.at === "end1" ? beam.to : beam.from, memberGeo);
|
|
56607
|
+
const parts = expandShearPlate(j, beam, support);
|
|
56608
|
+
if (!parts.length) {
|
|
56609
|
+
skipped.push(j.id);
|
|
56610
|
+
return;
|
|
56611
|
+
}
|
|
56612
|
+
for (const part of parts) {
|
|
56613
|
+
part.conn = j.id;
|
|
56614
|
+
part.connKind = j.kind;
|
|
56615
|
+
elements.push(part);
|
|
56616
|
+
if (part.kind !== "cut") usedGroups.add(part.group);
|
|
56617
|
+
}
|
|
56618
|
+
} else {
|
|
56619
|
+
skipped.push(j.id);
|
|
56520
56620
|
}
|
|
56521
|
-
const rep = [p[0], p[1]];
|
|
56522
|
-
reps.push(rep);
|
|
56523
|
-
return rep;
|
|
56524
|
-
};
|
|
56525
|
-
return elements.map((el) => {
|
|
56526
|
-
if (!el.pts || el.pts.length === 0) return el;
|
|
56527
|
-
const pts = el.pts.map((p) => {
|
|
56528
|
-
const s = snap(p);
|
|
56529
|
-
return [s[0], s[1]];
|
|
56530
|
-
});
|
|
56531
|
-
return { ...el, pts };
|
|
56532
56621
|
});
|
|
56622
|
+
const groups = [...usedGroups].map((k) => GROUPS[k]);
|
|
56623
|
+
return { elements, groups, skipped };
|
|
56533
56624
|
}
|
|
56534
|
-
|
|
56535
|
-
|
|
56536
|
-
|
|
56537
|
-
|
|
56538
|
-
|
|
56539
|
-
|
|
56540
|
-
|
|
56541
|
-
|
|
56542
|
-
|
|
56625
|
+
|
|
56626
|
+
// contract-to-scene.ts
|
|
56627
|
+
var BF_IN = aisc_shapes_default;
|
|
56628
|
+
var canonProfile = (s) => (s ?? "").trim().toUpperCase().replace(/×/g, "X").replace(/\s*X\s*/g, "X").replace(/^([A-Z]+)\s+/, "$1");
|
|
56629
|
+
var FT_TO_MM = 304.8;
|
|
56630
|
+
var IN_TO_MM2 = 25.4;
|
|
56631
|
+
var memberIsBrace = (m) => typeof m.memberType === "string" && m.memberType.trim().toLowerCase() === "brace";
|
|
56632
|
+
function depthPosition(explicit, dzMm, horizMm, isVerticalBrace = false) {
|
|
56633
|
+
if (explicit === "top" || explicit === "middle" || explicit === "bottom") return explicit;
|
|
56634
|
+
if (isVerticalBrace) return "middle";
|
|
56635
|
+
return dzMm > horizMm * 0.5774 ? "middle" : "top";
|
|
56543
56636
|
}
|
|
56544
|
-
function
|
|
56545
|
-
|
|
56546
|
-
|
|
56547
|
-
|
|
56548
|
-
|
|
56637
|
+
function profileDimsIn(profile) {
|
|
56638
|
+
if (!profile) return null;
|
|
56639
|
+
const p = profile.trim().toUpperCase().replace(/×/g, "X");
|
|
56640
|
+
if (p === "" || /(^|[^A-Z])MF($|[^A-Z])/.test(p)) return null;
|
|
56641
|
+
const m = p.match(/^([A-Z]+)\s*(.+)$/);
|
|
56642
|
+
if (!m) return null;
|
|
56643
|
+
const prefix = m[1];
|
|
56644
|
+
const nums = m[2].split("X").map(parseDim).filter((n) => n != null);
|
|
56645
|
+
if (nums.length === 0) return null;
|
|
56646
|
+
if ((prefix === "HSS" || prefix === "TUBE" || prefix === "L") && nums.length >= 3) {
|
|
56647
|
+
return { d: nums[0], w: nums[1], approx: false };
|
|
56648
|
+
}
|
|
56649
|
+
if (prefix === "HSS" || prefix === "PIPE") {
|
|
56650
|
+
const dia = nums[0];
|
|
56651
|
+
return { d: dia, w: dia, approx: false };
|
|
56652
|
+
}
|
|
56653
|
+
if (/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)) {
|
|
56654
|
+
const actual = sectionDimsIn(p);
|
|
56655
|
+
if (actual) return { d: actual.d, w: actual.bf, approx: false };
|
|
56656
|
+
const d = nums[0];
|
|
56657
|
+
const bf = BF_IN[p.replace(/\s+/g, "")];
|
|
56658
|
+
if (bf !== void 0) return { d, w: bf, approx: false };
|
|
56659
|
+
const ratio = prefix === "C" || prefix === "MC" ? 0.28 : 0.42;
|
|
56660
|
+
return { d, w: d * ratio, approx: true };
|
|
56661
|
+
}
|
|
56662
|
+
return null;
|
|
56549
56663
|
}
|
|
56550
|
-
function
|
|
56551
|
-
|
|
56664
|
+
function profileDims(profile) {
|
|
56665
|
+
const din = profileDimsIn(profile);
|
|
56666
|
+
return din ? { w: din.w * IN_TO_MM2, d: din.d * IN_TO_MM2, approx: din.approx } : null;
|
|
56552
56667
|
}
|
|
56553
|
-
|
|
56554
|
-
|
|
56668
|
+
var SCENE_DEFAULT_PAL = ["#60a5fa", "#94a3b8", "#f59e0b", "#34d399", "#f472b6", "#a78bfa", "#fb7185", "#22d3ee", "#facc15", "#4ade80"];
|
|
56669
|
+
function pickColor(profile, idx, contract) {
|
|
56670
|
+
const pc = contract.profile_colors ?? {};
|
|
56671
|
+
const override = pc[profile] ?? Object.entries(pc).find(([k]) => canonProfile(k) === profile)?.[1];
|
|
56672
|
+
if (override) return override;
|
|
56673
|
+
const pal = contract.palette && contract.palette.length ? contract.palette : SCENE_DEFAULT_PAL;
|
|
56674
|
+
return pal[(idx % pal.length + pal.length) % pal.length];
|
|
56555
56675
|
}
|
|
56556
|
-
function
|
|
56557
|
-
const
|
|
56558
|
-
return
|
|
56676
|
+
function dispToMm(pt, ptPerFt) {
|
|
56677
|
+
const k = FT_TO_MM / ptPerFt;
|
|
56678
|
+
return [pt[0] * k, -pt[1] * k];
|
|
56559
56679
|
}
|
|
56560
|
-
function
|
|
56561
|
-
|
|
56562
|
-
|
|
56680
|
+
function inferMaterial(profile) {
|
|
56681
|
+
const P = profile.toUpperCase().replace(/×/g, "X").replace(/\s+/g, "");
|
|
56682
|
+
if (P.startsWith("HSS")) return "A500-GR.B";
|
|
56683
|
+
if (/^W\d/.test(P)) return "A992";
|
|
56684
|
+
return "A36";
|
|
56685
|
+
}
|
|
56686
|
+
function teklaClassFor(profile, role) {
|
|
56687
|
+
const P = profile.toUpperCase().replace(/×/g, "X").replace(/\s+/g, "");
|
|
56688
|
+
if (/^L\d/.test(P)) return "7";
|
|
56689
|
+
if (/^M?C\d/.test(P)) return "8";
|
|
56690
|
+
const isHSS = P.startsWith("HSS");
|
|
56691
|
+
const isW = /^W\d/.test(P);
|
|
56692
|
+
if (isW || isHSS) return role === "brace" ? "4" : role === "column" ? "2" : "3";
|
|
56693
|
+
return "1";
|
|
56563
56694
|
}
|
|
56564
|
-
function
|
|
56565
|
-
const
|
|
56566
|
-
|
|
56567
|
-
const
|
|
56568
|
-
const
|
|
56569
|
-
const
|
|
56570
|
-
|
|
56571
|
-
|
|
56572
|
-
|
|
56573
|
-
|
|
56574
|
-
|
|
56575
|
-
|
|
56576
|
-
|
|
56577
|
-
|
|
56578
|
-
|
|
56579
|
-
|
|
56580
|
-
|
|
56581
|
-
|
|
56582
|
-
|
|
56583
|
-
|
|
56695
|
+
function contractToScene(contractInput) {
|
|
56696
|
+
const contract = contractInput ?? {};
|
|
56697
|
+
const elements = [];
|
|
56698
|
+
const memberGeo = /* @__PURE__ */ new Map();
|
|
56699
|
+
const skipped = [];
|
|
56700
|
+
const profileOrder = [];
|
|
56701
|
+
const seenProfile = /* @__PURE__ */ new Set();
|
|
56702
|
+
const beamClear = /* @__PURE__ */ new Map();
|
|
56703
|
+
for (const j of contract.joints ?? []) {
|
|
56704
|
+
if (!j || j.kind !== "shear-plate" || !j.main || j.at !== "end0" && j.at !== "end1") continue;
|
|
56705
|
+
const pc = j.params?.["clearance"];
|
|
56706
|
+
const cl = typeof pc === "number" && isFinite(pc) ? Math.max(0, pc) : 12.7;
|
|
56707
|
+
const cur = beamClear.get(j.main) ?? { e0: 0, e1: 0 };
|
|
56708
|
+
if (j.at === "end0") cur.e0 = Math.max(cur.e0, cl);
|
|
56709
|
+
else cur.e1 = Math.max(cur.e1, cl);
|
|
56710
|
+
beamClear.set(j.main, cur);
|
|
56711
|
+
}
|
|
56712
|
+
for (const plan of contract.plans ?? []) {
|
|
56713
|
+
const ptPerFt = plan.pt_per_ft && plan.pt_per_ft > 0 ? plan.pt_per_ft : 1;
|
|
56714
|
+
const defaultTosMm = (plan.default_tos ?? 0) * IN_TO_MM2;
|
|
56715
|
+
for (const m of plan.members ?? []) {
|
|
56716
|
+
const explicit = m.section && typeof m.section.w === "number" && m.section.w > 0 && typeof m.section.d === "number" && m.section.d > 0 ? { w: m.section.w, d: m.section.d, approx: false } : null;
|
|
56717
|
+
const dims = profileDims(m.profile) ?? explicit;
|
|
56718
|
+
if (!dims || !Array.isArray(m.wp) || m.wp.length < 2) {
|
|
56719
|
+
skipped.push(m.id);
|
|
56720
|
+
continue;
|
|
56721
|
+
}
|
|
56722
|
+
const mIsBrace = memberIsBrace(m);
|
|
56723
|
+
const profile = canonProfile(m.profile) || (explicit ? "CUSTOM" : "");
|
|
56724
|
+
if (!seenProfile.has(profile)) {
|
|
56725
|
+
seenProfile.add(profile);
|
|
56726
|
+
profileOrder.push(profile);
|
|
56727
|
+
}
|
|
56728
|
+
const [ax, ay] = dispToMm(m.wp[0], ptPerFt);
|
|
56729
|
+
const [bx, by] = dispToMm(m.wp[1], ptPerFt);
|
|
56730
|
+
let from;
|
|
56731
|
+
let to;
|
|
56732
|
+
let workFrom;
|
|
56733
|
+
let workTo;
|
|
56734
|
+
let posOffset = 0;
|
|
56735
|
+
if (m.role === "column") {
|
|
56736
|
+
const bos = m.col?.bos != null ? m.col.bos * IN_TO_MM2 : 0;
|
|
56737
|
+
const tos = m.col?.tos != null ? m.col.tos * IN_TO_MM2 : defaultTosMm;
|
|
56738
|
+
from = [ax, ay, bos];
|
|
56739
|
+
to = [ax, ay, tos];
|
|
56740
|
+
workFrom = from;
|
|
56741
|
+
workTo = to;
|
|
56742
|
+
} else {
|
|
56743
|
+
const z0 = m.ends?.[0]?.tos != null ? m.ends[0].tos * IN_TO_MM2 : defaultTosMm;
|
|
56744
|
+
const z1 = m.ends?.[1]?.tos != null ? m.ends[1].tos * IN_TO_MM2 : defaultTosMm;
|
|
56745
|
+
workFrom = [ax, ay, z0];
|
|
56746
|
+
workTo = [bx, by, z1];
|
|
56747
|
+
const pos2 = depthPosition(m.position, Math.abs(z1 - z0), Math.hypot(bx - ax, by - ay), mIsBrace && m.brace?.type === "vertical");
|
|
56748
|
+
const zoff = pos2 === "top" ? -dims.d / 2 : pos2 === "bottom" ? dims.d / 2 : 0;
|
|
56749
|
+
posOffset = zoff;
|
|
56750
|
+
from = [ax, ay, z0 + zoff];
|
|
56751
|
+
to = [bx, by, z1 + zoff];
|
|
56752
|
+
}
|
|
56753
|
+
if (m.role === "column" && Math.abs(to[2] - from[2]) < 1) {
|
|
56754
|
+
skipped.push(m.id);
|
|
56755
|
+
continue;
|
|
56756
|
+
}
|
|
56757
|
+
if (mIsBrace && Math.hypot(workTo[0] - workFrom[0], workTo[1] - workFrom[1], workTo[2] - workFrom[2]) < 1) {
|
|
56758
|
+
skipped.push(m.id);
|
|
56759
|
+
continue;
|
|
56760
|
+
}
|
|
56761
|
+
memberGeo.set(m.id, { id: m.id, role: m.role === "column" ? "column" : "beam", from: workFrom, to: workTo, dims: { w: dims.w, d: dims.d }, profile, posOffset, isBrace: mIsBrace, ...typeof m.rot === "number" ? { rot: -m.rot } : {} });
|
|
56762
|
+
const clr = beamClear.get(m.id);
|
|
56763
|
+
if (clr && m.role !== "column" && !mIsBrace) {
|
|
56764
|
+
const dx = to[0] - from[0], dy = to[1] - from[1], dz = to[2] - from[2];
|
|
56765
|
+
const L = Math.hypot(dx, dy, dz) || 1;
|
|
56766
|
+
const ex = dx / L, ey = dy / L, ez = dz / L;
|
|
56767
|
+
const e0 = Math.min(Math.max(0, clr.e0), L * 0.4), e1 = Math.min(Math.max(0, clr.e1), L * 0.4);
|
|
56768
|
+
if (e0 > 0) from = [from[0] + ex * e0, from[1] + ey * e0, from[2] + ez * e0];
|
|
56769
|
+
if (e1 > 0) to = [to[0] - ex * e1, to[1] - ey * e1, to[2] - ez * e1];
|
|
56770
|
+
}
|
|
56771
|
+
const role = mIsBrace ? "brace" : m.role === "column" ? "column" : "beam";
|
|
56772
|
+
const material = m.material && m.material.trim() || inferMaterial(profile);
|
|
56773
|
+
elements.push({
|
|
56774
|
+
id: m.id,
|
|
56775
|
+
group: profile,
|
|
56776
|
+
kind: "box",
|
|
56777
|
+
from,
|
|
56778
|
+
to,
|
|
56779
|
+
section: { w: dims.w, d: dims.d },
|
|
56780
|
+
meta: { profile },
|
|
56781
|
+
role,
|
|
56782
|
+
material,
|
|
56783
|
+
teklaClass: teklaClassFor(profile, role),
|
|
56784
|
+
xsection: xsectionFor(profile, { w: dims.w, d: dims.d }),
|
|
56785
|
+
...typeof m.rot === "number" ? { rot: -m.rot } : {}
|
|
56786
|
+
});
|
|
56584
56787
|
}
|
|
56585
|
-
const d = el.d || ptsToPath(el.pts);
|
|
56586
|
-
if (!d) continue;
|
|
56587
|
-
const sw = num2(el.w, 1);
|
|
56588
|
-
const dash = el.dashed ? ` stroke-dasharray="${sw * 3} ${sw * 2}"` : "";
|
|
56589
|
-
parts.push(
|
|
56590
|
-
`<path d="${escAttr(d)}" fill="none" stroke="${escAttr(el.color ?? "#e2e8f0")}" stroke-width="${sw}"${dash}/>`
|
|
56591
|
-
);
|
|
56592
56788
|
}
|
|
56593
|
-
|
|
56789
|
+
const allProfiles = (contract.plans ?? []).flatMap((pl2) => (pl2.members ?? []).map((m) => canonProfile(m.profile))).filter(Boolean);
|
|
56790
|
+
const paletteRank = [.../* @__PURE__ */ new Set([...allProfiles, ...Object.keys(contract.weights ?? {}).map((k) => canonProfile(k))])].sort();
|
|
56791
|
+
const groups = profileOrder.map((profile) => ({
|
|
56792
|
+
key: profile,
|
|
56793
|
+
label: profile,
|
|
56794
|
+
color: pickColor(profile, paletteRank.indexOf(profile), contract)
|
|
56795
|
+
}));
|
|
56796
|
+
const joints = expandJoints(contract.joints, memberGeo);
|
|
56797
|
+
for (const part of joints.elements) elements.push(part);
|
|
56798
|
+
for (const g of joints.groups) groups.push(g);
|
|
56799
|
+
for (const id of joints.skipped) skipped.push(`joint:${id}`);
|
|
56800
|
+
return {
|
|
56801
|
+
scene: { meta: { name: contract.title || "Steel Model", units: "mm", up: "z" }, groups, elements },
|
|
56802
|
+
skipped
|
|
56803
|
+
};
|
|
56594
56804
|
}
|
|
56595
|
-
|
|
56596
|
-
|
|
56597
|
-
|
|
56598
|
-
|
|
56599
|
-
|
|
56600
|
-
|
|
56601
|
-
|
|
56602
|
-
|
|
56603
|
-
|
|
56604
|
-
|
|
56605
|
-
|
|
56805
|
+
|
|
56806
|
+
// bom-format.ts
|
|
56807
|
+
var round1 = (n) => Math.round(n * 10) / 10;
|
|
56808
|
+
function foldedWeight(weights, profile) {
|
|
56809
|
+
const target = canonProfile(profile);
|
|
56810
|
+
const hit = Object.entries(weights).find(([k]) => canonProfile(k) === target);
|
|
56811
|
+
return hit ? hit[1] ?? null : null;
|
|
56812
|
+
}
|
|
56813
|
+
function contractToBom(contractInput) {
|
|
56814
|
+
const c = contractInput ?? {};
|
|
56815
|
+
const weights = c.weights ?? {};
|
|
56816
|
+
const agg = /* @__PURE__ */ new Map();
|
|
56817
|
+
for (const plan of c.plans ?? []) {
|
|
56818
|
+
const ptPerFt = typeof plan.pt_per_ft === "number" && plan.pt_per_ft > 0 ? plan.pt_per_ft : 12;
|
|
56819
|
+
const defaultTos = plan.default_tos ?? 0;
|
|
56820
|
+
for (const m of plan.members ?? []) {
|
|
56821
|
+
const profile = m.profile;
|
|
56822
|
+
if (!profile) continue;
|
|
56823
|
+
const plf = weights[profile] ?? foldedWeight(weights, profile);
|
|
56824
|
+
if (plf == null) continue;
|
|
56825
|
+
let lenFt;
|
|
56826
|
+
if (m.role === "column") {
|
|
56827
|
+
const l = columnLengthFt(m.col, defaultTos);
|
|
56828
|
+
if (l == null) continue;
|
|
56829
|
+
lenFt = l;
|
|
56830
|
+
if (!(lenFt > 0)) continue;
|
|
56831
|
+
} else {
|
|
56832
|
+
const l = memberLengthFt(m.wp, m.ends, ptPerFt, defaultTos);
|
|
56833
|
+
if (l == null) continue;
|
|
56834
|
+
lenFt = l;
|
|
56835
|
+
}
|
|
56836
|
+
const g = agg.get(profile) ?? { qty: 0, lenFt: 0, plf };
|
|
56837
|
+
g.qty += 1;
|
|
56838
|
+
g.lenFt += lenFt;
|
|
56839
|
+
agg.set(profile, g);
|
|
56840
|
+
}
|
|
56841
|
+
}
|
|
56842
|
+
const rows = [...agg.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([profile, g]) => ({
|
|
56843
|
+
Profile: profile,
|
|
56844
|
+
Qty: g.qty,
|
|
56845
|
+
"Length (ft)": round1(g.lenFt),
|
|
56846
|
+
"lb/ft": g.plf,
|
|
56847
|
+
"Weight (lb)": Math.round(g.lenFt * g.plf)
|
|
56848
|
+
}));
|
|
56849
|
+
const totalLb = rows.reduce((t, r) => t + r["Weight (lb)"], 0);
|
|
56850
|
+
const totalQty = rows.reduce((t, r) => t + r.Qty, 0);
|
|
56851
|
+
const totalLenFt = round1(rows.reduce((t, r) => t + r["Length (ft)"], 0));
|
|
56852
|
+
const totalTons = round1(totalLb / 2e3);
|
|
56853
|
+
rows.push({
|
|
56854
|
+
Profile: "TOTAL",
|
|
56855
|
+
Qty: totalQty,
|
|
56856
|
+
"Length (ft)": totalLenFt,
|
|
56857
|
+
"lb/ft": "",
|
|
56858
|
+
"Weight (lb)": totalLb
|
|
56606
56859
|
});
|
|
56607
|
-
const datums = contract.datums ? assignIds(contract.datums, "dt") : void 0;
|
|
56608
|
-
const links = contract.links ? assignIds(contract.links, "lk") : void 0;
|
|
56609
56860
|
return {
|
|
56610
|
-
|
|
56611
|
-
|
|
56612
|
-
|
|
56613
|
-
|
|
56614
|
-
|
|
56861
|
+
title: `Bill of Materials \u2014 ${totalTons} tons (${totalLb.toLocaleString("en-US")} lb)`,
|
|
56862
|
+
columns: ["Profile", "Qty", "Length (ft)", "lb/ft", "Weight (lb)"],
|
|
56863
|
+
rows,
|
|
56864
|
+
totalLb,
|
|
56865
|
+
totalTons
|
|
56615
56866
|
};
|
|
56616
56867
|
}
|
|
56617
56868
|
|
|
56618
|
-
//
|
|
56619
|
-
|
|
56620
|
-
|
|
56621
|
-
|
|
56622
|
-
|
|
56623
|
-
|
|
56624
|
-
|
|
56625
|
-
|
|
56626
|
-
const
|
|
56627
|
-
|
|
56628
|
-
|
|
56629
|
-
|
|
56630
|
-
|
|
56631
|
-
const
|
|
56632
|
-
|
|
56633
|
-
|
|
56634
|
-
|
|
56635
|
-
|
|
56636
|
-
|
|
56637
|
-
|
|
56638
|
-
|
|
56639
|
-
|
|
56640
|
-
|
|
56641
|
-
|
|
56642
|
-
|
|
56643
|
-
|
|
56644
|
-
|
|
56645
|
-
|
|
56646
|
-
|
|
56647
|
-
|
|
56648
|
-
|
|
56649
|
-
|
|
56650
|
-
|
|
56651
|
-
|
|
56652
|
-
|
|
56653
|
-
|
|
56869
|
+
// steel-diff.ts
|
|
56870
|
+
var NUL = String.fromCharCode(0);
|
|
56871
|
+
var asArray = (v) => Array.isArray(v) ? v : [];
|
|
56872
|
+
var str = (v) => typeof v === "string" ? v : "";
|
|
56873
|
+
var normProfile = (v) => str(v).trim().toUpperCase().replace(/\s+/g, "");
|
|
56874
|
+
var num2 = (v) => typeof v === "number" && isFinite(v) ? v : null;
|
|
56875
|
+
var MOVE_TOL_FT = 0.5;
|
|
56876
|
+
function collect(contract) {
|
|
56877
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
56878
|
+
const dup = /* @__PURE__ */ new Set();
|
|
56879
|
+
const idSheets = /* @__PURE__ */ new Map();
|
|
56880
|
+
const c = contract ?? {};
|
|
56881
|
+
for (const plan of asArray(c.plans)) {
|
|
56882
|
+
const sheet = str(plan?.sheet);
|
|
56883
|
+
const rawPpf = plan?.pt_per_ft;
|
|
56884
|
+
const hasScale = typeof rawPpf === "number" && rawPpf > 0;
|
|
56885
|
+
const ptPerFt = hasScale ? rawPpf : 12;
|
|
56886
|
+
for (const m of asArray(plan?.members)) {
|
|
56887
|
+
const id = str(m?.id);
|
|
56888
|
+
if (!id) continue;
|
|
56889
|
+
const key = sheet + NUL + id;
|
|
56890
|
+
(idSheets.get(id) ?? idSheets.set(id, /* @__PURE__ */ new Set()).get(id)).add(sheet);
|
|
56891
|
+
if (byKey.has(key)) {
|
|
56892
|
+
dup.add(key);
|
|
56893
|
+
continue;
|
|
56894
|
+
}
|
|
56895
|
+
byKey.set(key, {
|
|
56896
|
+
key,
|
|
56897
|
+
id,
|
|
56898
|
+
sheet,
|
|
56899
|
+
mark: str(m?.mark) || void 0,
|
|
56900
|
+
profile: str(m?.profile),
|
|
56901
|
+
role: str(m?.role) || "beam",
|
|
56902
|
+
ptPerFt,
|
|
56903
|
+
hasScale,
|
|
56904
|
+
wp: asArray(m?.wp).map((p) => asArray(p).map((x) => fin(x))),
|
|
56905
|
+
// finite-guarded (no NaN) — consistent with num() elsewhere
|
|
56906
|
+
ends: asArray(m?.ends),
|
|
56907
|
+
col: m?.col ?? {},
|
|
56908
|
+
material: str(m?.material)
|
|
56909
|
+
});
|
|
56910
|
+
}
|
|
56654
56911
|
}
|
|
56655
|
-
return
|
|
56912
|
+
return { byKey, dupKeys: [...dup], idSheets };
|
|
56656
56913
|
}
|
|
56657
|
-
|
|
56658
|
-
|
|
56659
|
-
|
|
56660
|
-
|
|
56661
|
-
|
|
56662
|
-
|
|
56663
|
-
|
|
56664
|
-
|
|
56665
|
-
|
|
56666
|
-
|
|
56667
|
-
|
|
56668
|
-
|
|
56669
|
-
return
|
|
56914
|
+
var refOf = (m) => ({ key: m.key, id: m.id, sheet: m.sheet, ...m.mark ? { mark: m.mark } : {}, profile: m.profile, role: m.role });
|
|
56915
|
+
var fin = (v) => {
|
|
56916
|
+
const n = Number(v);
|
|
56917
|
+
return isFinite(n) ? n : 0;
|
|
56918
|
+
};
|
|
56919
|
+
var dist = (p, q) => Math.hypot((p[0] ?? 0) - (q[0] ?? 0), (p[1] ?? 0) - (q[1] ?? 0));
|
|
56920
|
+
var ftPt = (p, ppf) => [fin(p?.[0]) / ppf, fin(p?.[1]) / ppf];
|
|
56921
|
+
function beamMoveFeet(a, b) {
|
|
56922
|
+
const af0 = ftPt(a.wp[0], a.ptPerFt), af1 = ftPt(a.wp[1] ?? a.wp[0], a.ptPerFt);
|
|
56923
|
+
const bf0 = ftPt(b.wp[0], b.ptPerFt), bf1 = ftPt(b.wp[1] ?? b.wp[0], b.ptPerFt);
|
|
56924
|
+
const aligned = Math.max(dist(af0, bf0), dist(af1, bf1));
|
|
56925
|
+
const flipped = Math.max(dist(af0, bf1), dist(af1, bf0));
|
|
56926
|
+
return flipped < aligned ? { feet: flipped, flipped: true } : { feet: aligned, flipped: false };
|
|
56670
56927
|
}
|
|
56671
|
-
function
|
|
56672
|
-
|
|
56673
|
-
|
|
56674
|
-
|
|
56675
|
-
const
|
|
56676
|
-
|
|
56677
|
-
|
|
56678
|
-
|
|
56679
|
-
|
|
56680
|
-
pts.push([el.bbox[0], el.bbox[1]], [el.bbox[2], el.bbox[3]]);
|
|
56681
|
-
}
|
|
56928
|
+
function elevMoveFeet(a, b) {
|
|
56929
|
+
let ft = 0;
|
|
56930
|
+
const at = num2(a.col?.tos), bt = num2(b.col?.tos);
|
|
56931
|
+
if (at != null && bt != null) ft = Math.max(ft, Math.abs(at - bt) / 12);
|
|
56932
|
+
const ab = num2(a.col?.bos), bb = num2(b.col?.bos);
|
|
56933
|
+
if (ab != null && bb != null) ft = Math.max(ft, Math.abs(ab - bb) / 12);
|
|
56934
|
+
for (let i = 0; i < 2; i++) {
|
|
56935
|
+
const ea = num2(a.ends?.[i]?.tos), eb = num2(b.ends?.[i]?.tos);
|
|
56936
|
+
if (ea != null && eb != null) ft = Math.max(ft, Math.abs(ea - eb) / 12);
|
|
56682
56937
|
}
|
|
56683
|
-
return
|
|
56938
|
+
return ft;
|
|
56684
56939
|
}
|
|
56685
|
-
|
|
56686
|
-
if (
|
|
56687
|
-
if (typeof
|
|
56688
|
-
|
|
56689
|
-
|
|
56940
|
+
var stable = (o) => {
|
|
56941
|
+
if (Array.isArray(o)) return "[" + o.map(stable).join(",") + "]";
|
|
56942
|
+
if (o && typeof o === "object") return "{" + Object.keys(o).sort().map((k) => k + ":" + stable(o[k])).join(",") + "}";
|
|
56943
|
+
return JSON.stringify(o) ?? "null";
|
|
56944
|
+
};
|
|
56945
|
+
function connIdentity(ref, lib) {
|
|
56946
|
+
const conn = str(ref?.conn).trim();
|
|
56947
|
+
if (conn && lib.has(conn)) {
|
|
56948
|
+
const r = lib.get(conn);
|
|
56949
|
+
return `${str(r?.type)}/${str(r?.detail)}`;
|
|
56690
56950
|
}
|
|
56691
|
-
return
|
|
56951
|
+
return str(ref?.detail).trim() || str(ref?.note).trim() || "";
|
|
56692
56952
|
}
|
|
56693
|
-
|
|
56694
|
-
|
|
56695
|
-
const
|
|
56696
|
-
const
|
|
56697
|
-
|
|
56698
|
-
const
|
|
56699
|
-
|
|
56953
|
+
function jointsSummary(a, b) {
|
|
56954
|
+
const kind = (sig) => sig.split("@")[0] ?? "";
|
|
56955
|
+
const setA = new Set(a), setB = new Set(b);
|
|
56956
|
+
const gone = a.filter((x) => !setB.has(x));
|
|
56957
|
+
const got = b.filter((x) => !setA.has(x));
|
|
56958
|
+
const gk = gone.length ? kind(gone[0] ?? "") : "";
|
|
56959
|
+
const tk = got.length ? kind(got[0] ?? "") : "";
|
|
56960
|
+
if (gone.length && got.length && gk === tk) return `${tk || "connection"} params changed`;
|
|
56961
|
+
if (got.length) return `${tk || "connection"} added`;
|
|
56962
|
+
if (gone.length) return `${gk || "connection"} removed`;
|
|
56963
|
+
return "connection changed";
|
|
56700
56964
|
}
|
|
56701
|
-
function
|
|
56702
|
-
const
|
|
56703
|
-
const
|
|
56704
|
-
|
|
56705
|
-
|
|
56706
|
-
|
|
56707
|
-
|
|
56708
|
-
|
|
56709
|
-
const seenKey = /* @__PURE__ */ new Set();
|
|
56710
|
-
const plans = sheets.filter((s) => s.view?.kind === "plan");
|
|
56711
|
-
const uprights = sheets.filter((s) => s.view?.kind === "elevation" || s.view?.kind === "section");
|
|
56712
|
-
const uprightEntities = [];
|
|
56713
|
-
for (const sh of uprights) {
|
|
56714
|
-
const hz = uprightHorizontal(sh);
|
|
56715
|
-
if (!hz) continue;
|
|
56716
|
-
for (const g of sh.groups ?? []) {
|
|
56717
|
-
const z = elevationZExtent(sh, g);
|
|
56718
|
-
const h = worldInterval(sh, g, 0, hz.sign);
|
|
56719
|
-
if (z && h) uprightEntities.push({ sheet: sh, g, z, h, axis: hz.axis });
|
|
56965
|
+
function indexJoints(contract, lib) {
|
|
56966
|
+
const idx = /* @__PURE__ */ new Map();
|
|
56967
|
+
for (const j of asArray(contract?.joints)) {
|
|
56968
|
+
const sig = `${str(j?.kind)}@${str(j?.at)}:${connIdentity(j, lib)}:${stable(j?.params)}:${stable(asArray(j?.secondaries).map(str).sort())}:${stable(j?.place)}`;
|
|
56969
|
+
for (const ref of [str(j?.main), ...asArray(j?.secondaries).map(str)].filter(Boolean)) {
|
|
56970
|
+
const arr = idx.get(ref);
|
|
56971
|
+
if (arr) arr.push(sig);
|
|
56972
|
+
else idx.set(ref, [sig]);
|
|
56720
56973
|
}
|
|
56721
56974
|
}
|
|
56722
|
-
const
|
|
56723
|
-
|
|
56724
|
-
|
|
56725
|
-
|
|
56726
|
-
|
|
56727
|
-
|
|
56728
|
-
|
|
56729
|
-
|
|
56730
|
-
|
|
56731
|
-
|
|
56732
|
-
|
|
56733
|
-
|
|
56975
|
+
for (const sigs of idx.values()) sigs.sort();
|
|
56976
|
+
return idx;
|
|
56977
|
+
}
|
|
56978
|
+
function diffContracts(from, to) {
|
|
56979
|
+
const A = collect(from);
|
|
56980
|
+
const B = collect(to);
|
|
56981
|
+
const dupKeys = [.../* @__PURE__ */ new Set([...A.dupKeys, ...B.dupKeys])];
|
|
56982
|
+
const ambiguous = new Set(dupKeys);
|
|
56983
|
+
const libA = new Map(asArray(from?.connections).map((r) => [str(r?.id), r]));
|
|
56984
|
+
const libB = new Map(asArray(to?.connections).map((r) => [str(r?.id), r]));
|
|
56985
|
+
const jointsA = indexJoints(from, libA);
|
|
56986
|
+
const jointsB = indexJoints(to, libB);
|
|
56987
|
+
const ambiguousJoints = /* @__PURE__ */ new Set();
|
|
56988
|
+
const flagAmbiguousJoints = (contract, idSheets) => {
|
|
56989
|
+
for (const j of asArray(contract?.joints)) {
|
|
56990
|
+
const refs = [str(j?.main), ...asArray(j?.secondaries).map(str)].filter(Boolean);
|
|
56991
|
+
if (refs.some((r) => (idSheets.get(r)?.size ?? 0) > 1)) ambiguousJoints.add(str(j?.id));
|
|
56734
56992
|
}
|
|
56735
|
-
|
|
56736
|
-
|
|
56737
|
-
|
|
56738
|
-
|
|
56739
|
-
|
|
56740
|
-
|
|
56741
|
-
|
|
56993
|
+
};
|
|
56994
|
+
flagAmbiguousJoints(from, A.idSheets);
|
|
56995
|
+
flagAmbiguousJoints(to, B.idSheets);
|
|
56996
|
+
const added = [];
|
|
56997
|
+
const removed = [];
|
|
56998
|
+
for (const [key, b] of B.byKey) if (!A.byKey.has(key)) added.push(refOf(b));
|
|
56999
|
+
for (const [key, a] of A.byKey) if (!B.byKey.has(key)) removed.push(refOf(a));
|
|
57000
|
+
const resized = [];
|
|
57001
|
+
const material = [];
|
|
57002
|
+
const moved = [];
|
|
57003
|
+
const connections = [];
|
|
57004
|
+
let unchanged = 0;
|
|
57005
|
+
let anyScaleUnknown = false;
|
|
57006
|
+
for (const [key, a] of A.byKey) {
|
|
57007
|
+
const b = B.byKey.get(key);
|
|
57008
|
+
if (!b || ambiguous.has(key)) continue;
|
|
57009
|
+
let changed = false;
|
|
57010
|
+
if (normProfile(a.profile) !== normProfile(b.profile)) {
|
|
57011
|
+
resized.push({ ref: refOf(b), from: a.profile, to: b.profile });
|
|
57012
|
+
changed = true;
|
|
56742
57013
|
}
|
|
56743
|
-
|
|
56744
|
-
|
|
56745
|
-
|
|
56746
|
-
const candidates = uprightEntities.filter((u) => !linkedAway.has(`${u.sheet.id}/${u.g.id ?? ""}`)).map((u) => {
|
|
56747
|
-
const mine = u.axis === "x" ? mineX : mineY;
|
|
56748
|
-
return { u, r: mine ? overlapRatio(mine, u.h) : 0 };
|
|
56749
|
-
}).filter((x) => x.r >= 0.8);
|
|
56750
|
-
if (candidates.length === 1) return { z: candidates[0].u.z, how: "match" };
|
|
56751
|
-
if (candidates.length > 1) return { ambiguous: candidates.length };
|
|
57014
|
+
if (a.material.trim().toUpperCase() !== b.material.trim().toUpperCase() && (a.material || b.material)) {
|
|
57015
|
+
material.push({ ref: refOf(b), from: a.material, to: b.material });
|
|
57016
|
+
changed = true;
|
|
56752
57017
|
}
|
|
56753
|
-
|
|
56754
|
-
|
|
56755
|
-
|
|
56756
|
-
|
|
56757
|
-
|
|
56758
|
-
|
|
56759
|
-
|
|
56760
|
-
continue;
|
|
57018
|
+
const planMove = a.wp.length && b.wp.length ? beamMoveFeet(a, b) : { feet: 0, flipped: false };
|
|
57019
|
+
const feet = Math.max(planMove.feet, elevMoveFeet(a, b));
|
|
57020
|
+
if (feet > MOVE_TOL_FT) {
|
|
57021
|
+
const scaleUnknown = !a.hasScale || !b.hasScale;
|
|
57022
|
+
moved.push({ ref: refOf(b), feet: Math.round(feet * 10) / 10, ...scaleUnknown ? { scaleUnknown: true } : {} });
|
|
57023
|
+
if (scaleUnknown) anyScaleUnknown = true;
|
|
57024
|
+
changed = true;
|
|
56761
57025
|
}
|
|
56762
|
-
|
|
56763
|
-
|
|
56764
|
-
|
|
56765
|
-
|
|
56766
|
-
|
|
56767
|
-
|
|
56768
|
-
|
|
56769
|
-
|
|
56770
|
-
|
|
56771
|
-
const
|
|
56772
|
-
|
|
56773
|
-
|
|
56774
|
-
|
|
56775
|
-
|
|
56776
|
-
|
|
56777
|
-
|
|
56778
|
-
continue;
|
|
56779
|
-
}
|
|
56780
|
-
if ("error" in zr0) {
|
|
56781
|
-
skipped.push({ id: gid, reason: zr0.error });
|
|
56782
|
-
continue;
|
|
56783
|
-
}
|
|
56784
|
-
const zr = zr0;
|
|
56785
|
-
const key = g.kind || (isMember ? "member" : "footprint");
|
|
56786
|
-
if (!seenKey.has(key)) {
|
|
56787
|
-
seenKey.add(key);
|
|
56788
|
-
groupKeys.push(key);
|
|
56789
|
-
}
|
|
56790
|
-
if (isMember) {
|
|
56791
|
-
const [ax, ay] = map(g.axis[0]);
|
|
56792
|
-
const [bx, by] = map(g.axis[1]);
|
|
56793
|
-
const zFrom = zr.how === "extrude" ? zr.z[0] : (zr.z[0] + zr.z[1]) / 2;
|
|
56794
|
-
const zTo = zr.how === "extrude" ? zr.z[1] : zFrom;
|
|
56795
|
-
elements.push({
|
|
56796
|
-
id: g.id ?? gid,
|
|
56797
|
-
group: key,
|
|
56798
|
-
kind: "box",
|
|
56799
|
-
from: [ax, ay, zFrom],
|
|
56800
|
-
to: [bx, by, zTo],
|
|
56801
|
-
section: { w: g.section.w, d: g.section.d },
|
|
56802
|
-
meta: { sheet: sheetId, ...g.label ? { label: g.label } : {} }
|
|
56803
|
-
});
|
|
56804
|
-
} else {
|
|
56805
|
-
elements.push({
|
|
56806
|
-
id: g.id ?? gid,
|
|
56807
|
-
group: key,
|
|
56808
|
-
kind: "extrusion",
|
|
56809
|
-
footprint: g.footprint.map((p) => map(p)),
|
|
56810
|
-
from: Math.min(zr.z[0], zr.z[1]),
|
|
56811
|
-
to: Math.max(zr.z[0], zr.z[1]),
|
|
56812
|
-
meta: { sheet: sheetId, ...g.label ? { label: g.label } : {} }
|
|
56813
|
-
});
|
|
56814
|
-
}
|
|
57026
|
+
const eA = [connIdentity(a.ends?.[0], libA), connIdentity(a.ends?.[1], libA)];
|
|
57027
|
+
const eB = [connIdentity(b.ends?.[0], libB), connIdentity(b.ends?.[1], libB)];
|
|
57028
|
+
const [eB0, eB1] = planMove.flipped ? [eB[1], eB[0]] : [eB[0], eB[1]];
|
|
57029
|
+
const parts = [];
|
|
57030
|
+
if (eA[0] !== eB0) parts.push(`end 1: ${eA[0] || "none"} \u2192 ${eB0 || "none"}`);
|
|
57031
|
+
if (eA[1] !== eB1) parts.push(`end 2: ${eA[1] || "none"} \u2192 ${eB1 || "none"}`);
|
|
57032
|
+
const cA = connIdentity(a.col, libA), cB = connIdentity(b.col, libB);
|
|
57033
|
+
if (cA !== cB) parts.push(`column: ${cA || "none"} \u2192 ${cB || "none"}`);
|
|
57034
|
+
if (!((A.idSheets.get(a.id)?.size ?? 0) > 1 || (B.idSheets.get(b.id)?.size ?? 0) > 1)) {
|
|
57035
|
+
const jA = jointsA.get(a.id) ?? [];
|
|
57036
|
+
const jB = jointsB.get(b.id) ?? [];
|
|
57037
|
+
if (stable(jA) !== stable(jB)) parts.push(jointsSummary(jA, jB));
|
|
57038
|
+
}
|
|
57039
|
+
if (parts.length) {
|
|
57040
|
+
connections.push({ ref: refOf(b), summary: parts.join("; ") });
|
|
57041
|
+
changed = true;
|
|
56815
57042
|
}
|
|
57043
|
+
if (!changed) unchanged++;
|
|
56816
57044
|
}
|
|
56817
|
-
const
|
|
56818
|
-
const
|
|
56819
|
-
|
|
57045
|
+
const keysA = A.byKey.size;
|
|
57046
|
+
const keysB = B.byKey.size;
|
|
57047
|
+
let shared = 0;
|
|
57048
|
+
for (const k of A.byKey.keys()) if (B.byKey.has(k)) shared++;
|
|
57049
|
+
const smaller = Math.min(keysA, keysB);
|
|
57050
|
+
const identityNotPreserved = keysA >= 5 && keysB >= 5 && smaller > 0 && shared / smaller < 0.1;
|
|
57051
|
+
const bom = (x) => {
|
|
57052
|
+
try {
|
|
57053
|
+
return contractToBom(x);
|
|
57054
|
+
} catch {
|
|
57055
|
+
return { totalLb: 0, totalTons: 0 };
|
|
57056
|
+
}
|
|
57057
|
+
};
|
|
57058
|
+
const fromBom = bom(from);
|
|
57059
|
+
const toBom = bom(to);
|
|
57060
|
+
const netLb = toBom.totalLb - fromBom.totalLb;
|
|
57061
|
+
const warnings = {
|
|
57062
|
+
...identityNotPreserved ? { identityNotPreserved: true } : {},
|
|
57063
|
+
...dupKeys.length ? { duplicateKeys: dupKeys } : {},
|
|
57064
|
+
...ambiguousJoints.size ? { ambiguousJoints: [...ambiguousJoints] } : {},
|
|
57065
|
+
...anyScaleUnknown ? { scaleUnknown: true } : {}
|
|
57066
|
+
};
|
|
57067
|
+
return {
|
|
57068
|
+
from: 0,
|
|
57069
|
+
to: 0,
|
|
57070
|
+
tonnage: {
|
|
57071
|
+
fromLb: fromBom.totalLb,
|
|
57072
|
+
toLb: toBom.totalLb,
|
|
57073
|
+
netLb,
|
|
57074
|
+
fromTons: fromBom.totalTons,
|
|
57075
|
+
toTons: toBom.totalTons,
|
|
57076
|
+
netTons: Math.round(netLb / 2e3 * 10) / 10
|
|
57077
|
+
},
|
|
57078
|
+
added,
|
|
57079
|
+
removed,
|
|
57080
|
+
resized,
|
|
57081
|
+
moved,
|
|
57082
|
+
material,
|
|
57083
|
+
connections,
|
|
57084
|
+
unchanged,
|
|
57085
|
+
warnings
|
|
57086
|
+
};
|
|
56820
57087
|
}
|
|
56821
57088
|
|
|
56822
|
-
//
|
|
56823
|
-
|
|
56824
|
-
|
|
56825
|
-
// darkest plate grey
|
|
56826
|
-
"washer-plate": { key: "washer-plate", label: "Washer plates", color: "#9aafc3" },
|
|
56827
|
-
"anchor-plate": { key: "anchor-plate", label: "Anchor plates", color: "#8293a6" },
|
|
56828
|
-
// embedded bearing plate at the rod's anchored end — mid steel-grey, between base + washer plate
|
|
56829
|
-
anchor: { key: "anchor", label: "Anchor rods", color: "#b0c4d8" },
|
|
56830
|
-
// cool zinc-grey
|
|
56831
|
-
nut: { key: "nut", label: "Nuts", color: "#7a8a9e" },
|
|
56832
|
-
washer: { key: "washer", label: "Washers", color: "#dde4ed" },
|
|
56833
|
-
// lightest zinc
|
|
56834
|
-
weld: { key: "weld", label: "Welds", color: "#f97316" },
|
|
56835
|
-
// weld orange (heat) — off the UI error-red
|
|
56836
|
-
// Shear-plate kit — same muted steel band; the fin plate a touch lighter than the base plate so the
|
|
56837
|
-
// two connection types are tellable apart in a mixed model, bolts on the zinc fastener grey.
|
|
56838
|
-
"shear-plate": { key: "shear-plate", label: "Shear plates", color: "#7d8ba0" },
|
|
56839
|
-
bolt: { key: "bolt", label: "Bolts", color: "#b0c4d8" },
|
|
56840
|
-
// cool zinc-grey (matches the anchor fasteners)
|
|
56841
|
-
stiffener: { key: "stiffener", label: "Stiffeners", color: "#9aafc3" },
|
|
56842
|
-
cope: { key: "cope", label: "Copes", color: "#c2703a" },
|
|
56843
|
-
// a muted cut/burn amber — the removed corner (subtractive; rendered as the notch, not a swatch mesh)
|
|
56844
|
-
// Imported (custom) connection — one neutral steel band for the whole opaque assembly, so it reads
|
|
56845
|
-
// as a single imported unit (not scattered across the recipe-part legend rows). Roles (plate/bolt/
|
|
56846
|
-
// weld) are kept on each part's meta for labels, but share this one legend group + colour.
|
|
56847
|
-
custom: { key: "custom", label: "Imported connections", color: "#8a97a8" }
|
|
56848
|
-
};
|
|
56849
|
-
var EMBED = 1;
|
|
56850
|
-
function num3(params, key, def) {
|
|
56851
|
-
const v = params?.[key];
|
|
56852
|
-
return typeof v === "number" && isFinite(v) ? v : def;
|
|
56853
|
-
}
|
|
56854
|
-
function pos(params, key, def) {
|
|
56855
|
-
const v = num3(params, key, def);
|
|
56856
|
-
return v > 0 ? v : def;
|
|
57089
|
+
// version-diff.ts
|
|
57090
|
+
function appSupportsDiff(app) {
|
|
57091
|
+
return app === "steel-model";
|
|
56857
57092
|
}
|
|
56858
|
-
function
|
|
56859
|
-
|
|
57093
|
+
function computeVersionDiff(id, n, base) {
|
|
57094
|
+
if (!Number.isInteger(n) || n < 1) return { code: 400, body: { ok: false, error: "n must be a positive integer version number" } };
|
|
57095
|
+
const head = listVersions(id)[0]?.n ?? 0;
|
|
57096
|
+
if (head === 0) return { code: 404, body: { ok: false, error: "no versions for this project" } };
|
|
57097
|
+
const to = readVersionSkeleton(id, n);
|
|
57098
|
+
if (to == null) return { code: 404, body: { ok: false, error: `version v${n} not found` } };
|
|
57099
|
+
if (n === 1) {
|
|
57100
|
+
const empty = diffContracts({}, to);
|
|
57101
|
+
return {
|
|
57102
|
+
code: 200,
|
|
57103
|
+
body: { ok: true, diff: { ...empty, from: 0, to: 1, firstVersion: true, added: [], tonnage: { fromLb: 0, toLb: 0, netLb: 0, fromTons: 0, toTons: 0, netTons: 0 } } }
|
|
57104
|
+
};
|
|
57105
|
+
}
|
|
57106
|
+
const b = base ?? n - 1;
|
|
57107
|
+
if (!Number.isInteger(b) || b < 1 || b >= n) return { code: 400, body: { ok: false, error: `base must be an integer in 1..${n - 1}` } };
|
|
57108
|
+
const from = readVersionSkeleton(id, b);
|
|
57109
|
+
if (from == null) return { code: 404, body: { ok: false, error: `base version v${b} not found` } };
|
|
57110
|
+
const diff = diffContracts(from, to);
|
|
57111
|
+
diff.from = b;
|
|
57112
|
+
diff.to = n;
|
|
57113
|
+
return { code: 200, body: { ok: true, diff } };
|
|
56860
57114
|
}
|
|
56861
|
-
|
|
56862
|
-
|
|
56863
|
-
|
|
56864
|
-
|
|
56865
|
-
|
|
56866
|
-
|
|
57115
|
+
|
|
57116
|
+
// project-sources-store.ts
|
|
57117
|
+
var import_node_crypto10 = require("node:crypto");
|
|
57118
|
+
var import_node_fs27 = require("node:fs");
|
|
57119
|
+
var import_node_path24 = require("node:path");
|
|
57120
|
+
var sourcesDir = (id) => (0, import_node_path24.join)(projectDir(id), "sources");
|
|
57121
|
+
var safeExt = (ext) => typeof ext === "string" && /^[a-z0-9]{1,8}$/i.test(ext) ? ext.toLowerCase() : "bin";
|
|
57122
|
+
function writeAtomic2(path, buf) {
|
|
57123
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
57124
|
+
(0, import_node_fs27.writeFileSync)(tmp, buf);
|
|
57125
|
+
(0, import_node_fs27.renameSync)(tmp, path);
|
|
56867
57126
|
}
|
|
56868
|
-
function
|
|
56869
|
-
|
|
56870
|
-
|
|
56871
|
-
|
|
56872
|
-
|
|
56873
|
-
if (
|
|
56874
|
-
return
|
|
57127
|
+
function saveSource(id, file) {
|
|
57128
|
+
(0, import_node_fs27.mkdirSync)(sourcesDir(id), { recursive: true });
|
|
57129
|
+
const sha2562 = (0, import_node_crypto10.createHash)("sha256").update(file.buf).digest("hex");
|
|
57130
|
+
const ext = safeExt(file.ext);
|
|
57131
|
+
const p = (0, import_node_path24.join)(sourcesDir(id), `${sha2562}.${ext}`);
|
|
57132
|
+
if (!(0, import_node_fs27.existsSync)(p)) writeAtomic2(p, file.buf);
|
|
57133
|
+
return { name: String(file.name), sha256: sha2562, ext, bytes: file.buf.length };
|
|
56875
57134
|
}
|
|
56876
|
-
|
|
56877
|
-
|
|
56878
|
-
|
|
56879
|
-
|
|
56880
|
-
|
|
56881
|
-
|
|
56882
|
-
|
|
56883
|
-
|
|
56884
|
-
[hw, -hd + tf],
|
|
56885
|
-
[tw / 2, -hd + tf],
|
|
56886
|
-
[tw / 2, hd - tf],
|
|
56887
|
-
[hw, hd - tf],
|
|
56888
|
-
[hw, hd],
|
|
56889
|
-
[-hw, hd],
|
|
56890
|
-
[-hw, hd - tf],
|
|
56891
|
-
[-tw / 2, hd - tf],
|
|
56892
|
-
[-tw / 2, -hd + tf],
|
|
56893
|
-
[-hw, -hd + tf]
|
|
56894
|
-
];
|
|
56895
|
-
}
|
|
56896
|
-
case "C": {
|
|
56897
|
-
const tf = Math.max(d * 0.1, 5), tw = Math.max(w * 0.12, 5);
|
|
56898
|
-
return [[-hw, -hd], [hw, -hd], [hw, -hd + tf], [-hw + tw, -hd + tf], [-hw + tw, hd - tf], [hw, hd - tf], [hw, hd], [-hw, hd]];
|
|
56899
|
-
}
|
|
56900
|
-
case "L": {
|
|
56901
|
-
const t = Math.max(Math.min(w, d) * 0.18, 5);
|
|
56902
|
-
return [[-hw, -hd], [hw, -hd], [hw, -hd + t], [-hw + t, -hd + t], [-hw + t, hd], [-hw, hd]];
|
|
56903
|
-
}
|
|
56904
|
-
default:
|
|
56905
|
-
return [[-hw, -hd], [hw, -hd], [hw, hd], [-hw, hd]];
|
|
57135
|
+
|
|
57136
|
+
// contract-bake.ts
|
|
57137
|
+
var import_node_fs28 = require("node:fs");
|
|
57138
|
+
var import_yaml6 = __toESM(require_dist6(), 1);
|
|
57139
|
+
function bakeContractIntoApp(sourcePath, contract) {
|
|
57140
|
+
const doc = (0, import_yaml6.parseDocument)((0, import_node_fs28.readFileSync)(sourcePath, "utf8"));
|
|
57141
|
+
if (doc.errors.length > 0) {
|
|
57142
|
+
throw new Error(`contract bake: source is not valid YAML: ${doc.errors[0]?.message ?? "parse error"}`);
|
|
56906
57143
|
}
|
|
56907
|
-
|
|
56908
|
-
|
|
56909
|
-
const
|
|
56910
|
-
|
|
56911
|
-
|
|
56912
|
-
|
|
56913
|
-
|
|
56914
|
-
const
|
|
56915
|
-
|
|
56916
|
-
|
|
56917
|
-
|
|
56918
|
-
|
|
56919
|
-
|
|
56920
|
-
|
|
56921
|
-
|
|
56922
|
-
|
|
56923
|
-
|
|
56924
|
-
|
|
56925
|
-
|
|
56926
|
-
|
|
56927
|
-
|
|
56928
|
-
const wpSide = pos(p, "washerPlateSide", 2.5 * boltDia);
|
|
56929
|
-
const wpThick = pos(p, "washerPlateThickness", Math.max(0.35 * boltDia, 8));
|
|
56930
|
-
const washerOD = pos(p, "washerOuter", 2 * boltDia);
|
|
56931
|
-
const washerID = boltDia + 3;
|
|
56932
|
-
const washerH = pos(p, "washerThickness", Math.max(0.25 * boltDia, 4));
|
|
56933
|
-
const levelingNut = p?.["levelingNut"] !== false;
|
|
56934
|
-
const anchorPlate = p?.["anchorPlate"] !== false;
|
|
56935
|
-
const apSide = pos(p, "anchorPlateSide", 3.3 * boltDia);
|
|
56936
|
-
const apThick = pos(p, "anchorPlateThickness", Math.max(0.6 * boltDia, 20));
|
|
56937
|
-
const bottomNut = p?.["bottomNut"] !== false;
|
|
56938
|
-
const rodProj = pos(p, "anchorRodProjection", 25.4 / 4);
|
|
56939
|
-
const SEAT = 0.5;
|
|
56940
|
-
const rodBelow = Math.max(embedment > 0 ? grout + embedment : projBelow, rodProj + nutH + apThick + SEAT);
|
|
56941
|
-
const plateTop = bz + EMBED, plateBottom = plateTop - thickness;
|
|
56942
|
-
const us = spread(cols, Math.max(0, width / 2 - edge));
|
|
56943
|
-
const vs = spread(rows, Math.max(0, depth / 2 - edge));
|
|
56944
|
-
const holes = [];
|
|
56945
|
-
const kit = [];
|
|
56946
|
-
const wpBot = plateTop + SEAT, wpTop = wpBot + wpThick, washerTop = wpTop + washerH, fnTop = washerTop + nutH;
|
|
56947
|
-
const rodTopZ = fnTop + 0.4 * boltDia, rodBotZ = plateBottom - rodBelow;
|
|
56948
|
-
const concreteTopZ = plateBottom - (embedment > 0 ? grout : 0);
|
|
56949
|
-
let k = 0;
|
|
56950
|
-
for (const v of vs) {
|
|
56951
|
-
for (const u of us) {
|
|
56952
|
-
const ax = bx + u, ay = by + v, jid = joint.id;
|
|
56953
|
-
holes.push({ u, v, d: boltDia + clearance });
|
|
56954
|
-
kit.push(
|
|
56955
|
-
{ id: `${jid}:rod${k}`, group: "anchor", kind: "rod", from: [ax, ay, rodBotZ], to: [ax, ay, rodTopZ], d: boltDia, meta: { label: `Anchor rod \u2300${boltDia}` } },
|
|
56956
|
-
{ id: `${jid}:wp${k}`, group: "washer-plate", kind: "plate", center: [ax, ay, wpBot + wpThick / 2], uDir: [1, 0, 0], vDir: [0, 1, 0], width: wpSide, depth: wpSide, thickness: wpThick, holes: [{ u: 0, v: 0, d: boltDia + 2 }], meta: { label: `Washer plate ${Math.round(wpSide)}\xD7${Math.round(wpSide)}\xD7${Math.round(wpThick)}` } },
|
|
56957
|
-
{ id: `${jid}:wsh${k}`, group: "washer", kind: "washer", from: [ax, ay, wpTop], to: [ax, ay, washerTop], dOuter: washerOD, dInner: washerID, meta: { label: `Washer \u2300${Math.round(washerOD)}` } },
|
|
56958
|
-
{ id: `${jid}:fn${k}`, group: "nut", kind: "nut", from: [ax, ay, washerTop], to: [ax, ay, fnTop], acrossFlats: nutAF, meta: { label: `Nut M${boltDia}` } }
|
|
56959
|
-
);
|
|
56960
|
-
if (levelingNut) kit.push({ id: `${jid}:ln${k}`, group: "nut", kind: "nut", from: [ax, ay, plateBottom - SEAT - nutH], to: [ax, ay, plateBottom - SEAT], acrossFlats: nutAF, meta: { label: `Leveling nut M${boltDia}` } });
|
|
56961
|
-
const nutBotZ = rodBotZ + rodProj;
|
|
56962
|
-
if (bottomNut) kit.push({ id: `${jid}:fnb${k}`, group: "nut", kind: "nut", from: [ax, ay, nutBotZ], to: [ax, ay, nutBotZ + nutH], acrossFlats: nutAF, meta: { label: `Anchor nut M${boltDia}` } });
|
|
56963
|
-
const apBotZ = nutBotZ + (bottomNut ? nutH : 0);
|
|
56964
|
-
if (anchorPlate) kit.push({ id: `${jid}:ap${k}`, group: "anchor-plate", kind: "plate", center: [ax, ay, apBotZ + apThick / 2], uDir: [1, 0, 0], vDir: [0, 1, 0], width: apSide, depth: apSide, thickness: apThick, holes: [{ u: 0, v: 0, d: boltDia + 2 }], meta: { label: `Anchor plate ${Math.round(apSide)}\xD7${Math.round(apSide)}\xD7${Math.round(apThick)}` } });
|
|
56965
|
-
k++;
|
|
56966
|
-
}
|
|
57144
|
+
const seq = doc.get("nodes");
|
|
57145
|
+
const items = (0, import_yaml6.isSeq)(seq) ? seq.items : [];
|
|
57146
|
+
const nodeOf = (it) => (0, import_yaml6.isMap)(it) ? it.toJSON() : null;
|
|
57147
|
+
let idx = items.findIndex((it) => nodeOf(it)?.config?.contract === contract.type);
|
|
57148
|
+
if (idx < 0) idx = items.findIndex((it) => nodeOf(it)?.agent === "steel-takeoff-us");
|
|
57149
|
+
if (idx < 0) throw new Error("no contract-emitting node to bake the contract into");
|
|
57150
|
+
doc.setIn(["nodes", idx, "config", "contract"], contract.type);
|
|
57151
|
+
const baked = { ...contract };
|
|
57152
|
+
delete baked.dims3d;
|
|
57153
|
+
delete baked.detail_placements;
|
|
57154
|
+
delete baked.prop_labels;
|
|
57155
|
+
delete baked.member_styles;
|
|
57156
|
+
if (Array.isArray(contract.plans)) {
|
|
57157
|
+
baked.plans = contract.plans.map((p) => {
|
|
57158
|
+
if (p && typeof p === "object") {
|
|
57159
|
+
const clone = { ...p };
|
|
57160
|
+
delete clone.dims;
|
|
57161
|
+
return clone;
|
|
57162
|
+
}
|
|
57163
|
+
return p;
|
|
57164
|
+
});
|
|
56967
57165
|
}
|
|
56968
|
-
const
|
|
56969
|
-
|
|
56970
|
-
|
|
56971
|
-
|
|
56972
|
-
|
|
56973
|
-
// plate top seats the column (= bz + EMBED); body hangs below
|
|
56974
|
-
uDir: [1, 0, 0],
|
|
56975
|
-
vDir: [0, 1, 0],
|
|
56976
|
-
width,
|
|
56977
|
-
depth,
|
|
56978
|
-
thickness,
|
|
56979
|
-
holes,
|
|
56980
|
-
meta: {
|
|
56981
|
-
label: `Base plate ${Math.round(width)}\xD7${Math.round(depth)}\xD7${Math.round(thickness)}`,
|
|
56982
|
-
// anchor depth for the view's PROJ/GROUT/EMBED overlay + the rod inspector. projection is above B.O.
|
|
56983
|
-
// plate; the grout pad sits B.O. plate → T.O. concrete; embedment is INTO the concrete (T.O. concrete → rod bottom).
|
|
56984
|
-
anchor: { rodTopZ, rodBotZ, plateBotZ: plateBottom, concreteTopZ, projMm: rodTopZ - plateBottom, groutMm: plateBottom - concreteTopZ, embedMm: concreteTopZ - rodBotZ, embedSet: embedment > 0 }
|
|
57166
|
+
const stripPageRaster = (p) => {
|
|
57167
|
+
if (p && typeof p === "object") {
|
|
57168
|
+
const page = { ...p };
|
|
57169
|
+
delete page.bg_b64;
|
|
57170
|
+
return page;
|
|
56985
57171
|
}
|
|
57172
|
+
return p;
|
|
56986
57173
|
};
|
|
56987
|
-
const
|
|
56988
|
-
|
|
56989
|
-
|
|
56990
|
-
|
|
56991
|
-
|
|
56992
|
-
|
|
56993
|
-
|
|
56994
|
-
path: profileOutline(col.profile, w, d).map(([u, vv]) => [bx + (u * cosR - vv * sinR), by + (u * sinR + vv * cosR), bz]),
|
|
56995
|
-
leg: weldLeg,
|
|
56996
|
-
meta: { label: `Fillet ${weldLeg}` }
|
|
56997
|
-
};
|
|
56998
|
-
return [plate, ...kit, weld];
|
|
56999
|
-
}
|
|
57000
|
-
function webHalfThk(profile, w) {
|
|
57001
|
-
return profileKind(profile) === "I" ? Math.min(w * 0.5, Math.max(w * 0.1, 5)) / 2 : 0;
|
|
57002
|
-
}
|
|
57003
|
-
function distPointSeg(p, a, b) {
|
|
57004
|
-
const abx = b[0] - a[0], aby = b[1] - a[1], abz = b[2] - a[2];
|
|
57005
|
-
const apx = p[0] - a[0], apy = p[1] - a[1], apz = p[2] - a[2];
|
|
57006
|
-
const len2 = abx * abx + aby * aby + abz * abz;
|
|
57007
|
-
const t = len2 > 1e-9 ? Math.max(0, Math.min(1, (apx * abx + apy * aby + apz * abz) / len2)) : 0;
|
|
57008
|
-
return Math.hypot(apx - t * abx, apy - t * aby, apz - t * abz);
|
|
57009
|
-
}
|
|
57010
|
-
function unitDir(a, b) {
|
|
57011
|
-
const dx = b[0] - a[0], dy = b[1] - a[1], dz = b[2] - a[2];
|
|
57012
|
-
const L = Math.hypot(dx, dy, dz);
|
|
57013
|
-
return L > 1e-9 ? [dx / L, dy / L, dz / L] : null;
|
|
57014
|
-
}
|
|
57015
|
-
function inferSupport(beam, end, memberGeo) {
|
|
57016
|
-
const bd = unitDir(beam.from, beam.to);
|
|
57017
|
-
let best, bestD = Infinity;
|
|
57018
|
-
for (const m of memberGeo.values()) {
|
|
57019
|
-
if (m.id === beam.id || m.isBrace || !finite3(m.from) || !finite3(m.to)) continue;
|
|
57020
|
-
const md = unitDir(m.from, m.to);
|
|
57021
|
-
if (bd && md && Math.abs(bd[0] * md[0] + bd[1] * md[1] + bd[2] * md[2]) > 0.966) continue;
|
|
57022
|
-
const d = distPointSeg(end, m.from, m.to);
|
|
57023
|
-
if (d < bestD) {
|
|
57024
|
-
bestD = d;
|
|
57025
|
-
best = m;
|
|
57026
|
-
}
|
|
57027
|
-
}
|
|
57028
|
-
return best && bestD <= Math.max(best.dims.w, best.dims.d) ? best : void 0;
|
|
57029
|
-
}
|
|
57030
|
-
function flangeThk(profile, d) {
|
|
57031
|
-
return profileKind(profile) === "I" ? Math.min(d * 0.5, Math.max(d * 0.1, 6)) : d / 2;
|
|
57032
|
-
}
|
|
57033
|
-
var clamp = (x, lo, hi) => Math.max(lo, Math.min(hi, x));
|
|
57034
|
-
function supportWorkZAt(support, pt) {
|
|
57035
|
-
const a = support.from, b = support.to;
|
|
57036
|
-
const dx = b[0] - a[0], dy = b[1] - a[1];
|
|
57037
|
-
const len2 = dx * dx + dy * dy;
|
|
57038
|
-
if (!(len2 > 1e-9)) return a[2];
|
|
57039
|
-
const t = clamp(((pt[0] - a[0]) * dx + (pt[1] - a[1]) * dy) / len2, 0, 1);
|
|
57040
|
-
return a[2] + (b[2] - a[2]) * t;
|
|
57041
|
-
}
|
|
57042
|
-
function beamCopes(beam, support, at, params) {
|
|
57043
|
-
if (!support || !finite3(support.from) || !finite3(support.to) || !support.dims || !(support.dims.d > 0) || !(support.dims.w > 0)) return {};
|
|
57044
|
-
if (!finite3(beam.from) || !finite3(beam.to) || !beam.dims || !(beam.dims.d > 0) || !(beam.dims.w > 0)) return {};
|
|
57045
|
-
if (profileKind(support.profile) !== "I") return {};
|
|
57046
|
-
const endPt = at === "end1" ? beam.to : beam.from;
|
|
57047
|
-
const gap = Math.max(0, num3(params, "clearance", 12.7));
|
|
57048
|
-
const beamMidZ = endPt[2] + (typeof beam.posOffset === "number" && isFinite(beam.posOffset) ? beam.posOffset : 0);
|
|
57049
|
-
const beamTopZ = beamMidZ + beam.dims.d / 2, beamBotZ = beamMidZ - beam.dims.d / 2;
|
|
57050
|
-
const supMidZ = supportWorkZAt(support, endPt) + (typeof support.posOffset === "number" && isFinite(support.posOffset) ? support.posOffset : 0);
|
|
57051
|
-
const supTopZ = supMidZ + support.dims.d / 2, supBotZ = supMidZ - support.dims.d / 2;
|
|
57052
|
-
const tfS = flangeThk(support.profile, support.dims.d);
|
|
57053
|
-
const kClear = Math.max(0, num3(params, "copeKClear", 12.7));
|
|
57054
|
-
const minLen = Math.max(0, num3(params, "copeMinLength", 31.75));
|
|
57055
|
-
const kBand = tfS + kClear;
|
|
57056
|
-
const webLo = supBotZ + kBand, webHi = supTopZ - kBand;
|
|
57057
|
-
if (!(webLo < webHi && beamTopZ > webLo && beamBotZ < webHi)) return {};
|
|
57058
|
-
const length = Math.max(support.dims.w / 2 + gap, minLen);
|
|
57059
|
-
const out = {};
|
|
57060
|
-
if (beamTopZ > webHi) out.top = { depth: clamp(beamTopZ - (webHi - gap), 0, beam.dims.d), length };
|
|
57061
|
-
if (beamBotZ < webLo) out.bottom = { depth: clamp(webLo + gap - beamBotZ, 0, beam.dims.d), length };
|
|
57062
|
-
return out;
|
|
57063
|
-
}
|
|
57064
|
-
var IN = 25.4;
|
|
57065
|
-
function aiscBoltLength(gripMm, diaMm) {
|
|
57066
|
-
const Q = IN / 4;
|
|
57067
|
-
const raw = gripMm + diaMm + Q;
|
|
57068
|
-
const step = raw > 5 * IN ? 2 * Q : Q;
|
|
57069
|
-
return Math.ceil((raw - 1e-6) / step) * step;
|
|
57070
|
-
}
|
|
57071
|
-
function expandShearPlate(joint, beam, support) {
|
|
57072
|
-
const p = joint.params;
|
|
57073
|
-
const atEnd1 = joint.at === "end1";
|
|
57074
|
-
const endPt = atEnd1 ? beam.to : beam.from;
|
|
57075
|
-
const farPt = atEnd1 ? beam.from : beam.to;
|
|
57076
|
-
let ux = farPt[0] - endPt[0], uy = farPt[1] - endPt[1];
|
|
57077
|
-
const hLen = Math.hypot(ux, uy);
|
|
57078
|
-
if (!(hLen > 1e-6)) return [];
|
|
57079
|
-
ux /= hLen;
|
|
57080
|
-
uy /= hLen;
|
|
57081
|
-
const uDir = [ux, uy, 0];
|
|
57082
|
-
const vDir = [0, 0, 1];
|
|
57083
|
-
const nDir = [uy, -ux, 0];
|
|
57084
|
-
const posOff = typeof beam.posOffset === "number" && isFinite(beam.posOffset) ? beam.posOffset : 0;
|
|
57085
|
-
const webZ = endPt[2] + posOff;
|
|
57086
|
-
const P = (u, v, n) => [
|
|
57087
|
-
endPt[0] + uDir[0] * u + nDir[0] * n,
|
|
57088
|
-
endPt[1] + uDir[1] * u + nDir[1] * n,
|
|
57089
|
-
webZ + v
|
|
57090
|
-
];
|
|
57091
|
-
const thickness = pos(p, "plateThickness", 10);
|
|
57092
|
-
const width = pos(p, "plateWidth", 120);
|
|
57093
|
-
const boltDia = pos(p, "boltDia", 20);
|
|
57094
|
-
const cols = intMin1(p, "boltCols", 1);
|
|
57095
|
-
const rows = intMin1(p, "boltRows", 3);
|
|
57096
|
-
const pitch = pos(p, "boltPitch", 70);
|
|
57097
|
-
const colPitch = pos(p, "boltColPitch", pitch);
|
|
57098
|
-
const holeClr = num3(p, "holeClearance", 2);
|
|
57099
|
-
const edge = Math.max(0, num3(p, "edgeDist", Math.max(1.5 * boltDia, 30)));
|
|
57100
|
-
const weldLeg = num3(p, "weldLeg", 6);
|
|
57101
|
-
const clearance = Math.max(0, num3(p, "clearance", 12.7));
|
|
57102
|
-
const stiffener = p?.["stiffener"] === true;
|
|
57103
|
-
const height = pos(p, "plateHeight", (rows - 1) * pitch + 2 * edge);
|
|
57104
|
-
const twHalf = webHalfThk(beam.profile, beam.dims.w);
|
|
57105
|
-
const webSide = num3(p, "webSide", 1) >= 0 ? 1 : -1;
|
|
57106
|
-
const pOff = webSide * (twHalf + thickness / 2);
|
|
57107
|
-
const u0 = support ? webHalfThk(support.profile, support.dims.w) : 0;
|
|
57108
|
-
const edgeV = Math.min(edge, height * 0.4);
|
|
57109
|
-
const pV = rows > 1 ? Math.min(pitch, Math.max(0, height - 2 * edgeV) / (rows - 1)) : 0;
|
|
57110
|
-
const vOffs = Array.from({ length: rows }, (_, i) => (i - (rows - 1) / 2) * pV);
|
|
57111
|
-
const edgeU = Math.min(edge, width * 0.4);
|
|
57112
|
-
const regHi = Math.max(edgeU, width - edgeU);
|
|
57113
|
-
const regLo = Math.min(clearance + edgeU, regHi);
|
|
57114
|
-
const cU = (regLo + regHi) / 2;
|
|
57115
|
-
const pU = cols > 1 ? Math.min(colPitch, (regHi - regLo) / (cols - 1)) : 0;
|
|
57116
|
-
const uOffs = Array.from({ length: cols }, (_, j) => cU + (j - (cols - 1) / 2) * pU);
|
|
57117
|
-
const nutH = 0.8 * boltDia, nutAF = 1.6 * boltDia;
|
|
57118
|
-
const plateOuterN = webSide * (twHalf + thickness);
|
|
57119
|
-
const webFarN = -webSide * twHalf;
|
|
57120
|
-
const headTipN = plateOuterN + webSide * nutH;
|
|
57121
|
-
const nutTipN = webFarN - webSide * nutH;
|
|
57122
|
-
const grade = p?.["boltGrade"] === "A490" ? "A490" : "A325";
|
|
57123
|
-
const grip = thickness + 2 * twHalf;
|
|
57124
|
-
const boltLen = aiscBoltLength(grip, boltDia);
|
|
57125
|
-
const callout = `\u2300${Math.round(boltDia)} ${grade} \xD7 ${Math.round(boltLen)}`;
|
|
57126
|
-
const holes = [];
|
|
57127
|
-
const bolts = [];
|
|
57128
|
-
let k = 0;
|
|
57129
|
-
for (const v of vOffs) {
|
|
57130
|
-
for (const u of uOffs) {
|
|
57131
|
-
const jid = joint.id;
|
|
57132
|
-
holes.push({ u: u - width / 2, v, d: boltDia + holeClr });
|
|
57133
|
-
bolts.push(
|
|
57134
|
-
// the shank = the AISC bolt LENGTH, from under the head (plate outer face) into the connection
|
|
57135
|
-
{ id: `${jid}:bolt${k}`, group: "bolt", kind: "rod", from: P(u0 + u, v, plateOuterN), to: P(u0 + u, v, plateOuterN - webSide * boltLen), d: boltDia, meta: { label: `Bolt ${callout}` } },
|
|
57136
|
-
{ id: `${jid}:head${k}`, group: "nut", kind: "nut", from: P(u0 + u, v, plateOuterN), to: P(u0 + u, v, headTipN), acrossFlats: nutAF, meta: { label: `Bolt head ${callout}` } },
|
|
57137
|
-
{ id: `${jid}:nut${k}`, group: "nut", kind: "nut", from: P(u0 + u, v, webFarN), to: P(u0 + u, v, nutTipN), acrossFlats: nutAF, meta: { label: `Bolt nut ${callout}` } }
|
|
57174
|
+
const filter = baked.filter;
|
|
57175
|
+
if (filter && typeof filter === "object") {
|
|
57176
|
+
const next = { ...filter };
|
|
57177
|
+
if (filter.page) next.page = stripPageRaster(filter.page);
|
|
57178
|
+
if (Array.isArray(filter.sheets)) {
|
|
57179
|
+
next.sheets = filter.sheets.map(
|
|
57180
|
+
(s) => s && typeof s === "object" ? { ...s, page: stripPageRaster(s.page) } : s
|
|
57138
57181
|
);
|
|
57139
|
-
k++;
|
|
57140
57182
|
}
|
|
57141
|
-
|
|
57142
|
-
|
|
57143
|
-
|
|
57144
|
-
|
|
57145
|
-
|
|
57146
|
-
|
|
57147
|
-
|
|
57148
|
-
|
|
57149
|
-
|
|
57150
|
-
|
|
57151
|
-
|
|
57152
|
-
|
|
57153
|
-
|
|
57154
|
-
|
|
57155
|
-
|
|
57156
|
-
|
|
57157
|
-
|
|
57158
|
-
|
|
57159
|
-
|
|
57160
|
-
|
|
57161
|
-
|
|
57162
|
-
|
|
57163
|
-
|
|
57164
|
-
|
|
57165
|
-
|
|
57166
|
-
|
|
57167
|
-
|
|
57168
|
-
|
|
57169
|
-
|
|
57170
|
-
|
|
57171
|
-
if (weldSide !== "near") welds.push(faceWeld("weld2", nInner));
|
|
57172
|
-
const parts = [plate, ...bolts, ...welds];
|
|
57173
|
-
if (stiffener) {
|
|
57174
|
-
if (support && support.role === "beam" && !support.isBrace && finite3(support.from) && finite3(support.to) && support.dims && support.dims.d > 0 && support.dims.w > 0) {
|
|
57175
|
-
const supPosOff = typeof support.posOffset === "number" && isFinite(support.posOffset) ? support.posOffset : 0;
|
|
57176
|
-
const twGirder = webHalfThk(support.profile, support.dims.w) * 2;
|
|
57177
|
-
const stiffH = support.dims.d * 0.9;
|
|
57178
|
-
const stiffW = Math.max(support.dims.w / 2 - twGirder / 2, thickness * 2);
|
|
57179
|
-
const girderCentZ = endPt[2] + supPosOff;
|
|
57180
|
-
const cu = -(twGirder / 2 + stiffW / 2);
|
|
57181
|
-
const center = [endPt[0] + uDir[0] * cu, endPt[1] + uDir[1] * cu, girderCentZ];
|
|
57182
|
-
parts.push({ id: `${joint.id}:stiff`, group: "stiffener", kind: "plate", center, uDir, vDir, width: stiffW, depth: stiffH, thickness, holes: [], meta: { label: `Stiffener ${Math.round(stiffW)}\xD7${Math.round(stiffH)}\xD7${Math.round(thickness)}` } });
|
|
57183
|
-
const wfx = endPt[0] - uDir[0] * (twGirder / 2), wfy = endPt[1] - uDir[1] * (twGirder / 2);
|
|
57184
|
-
parts.push({ id: `${joint.id}:stiffweld`, group: "weld", kind: "weld", closed: false, path: [[wfx, wfy, girderCentZ - stiffH / 2], [wfx, wfy, girderCentZ + stiffH / 2]], leg: weldLeg, meta: { label: `Fillet ${weldLeg}` } });
|
|
57185
|
-
} else {
|
|
57186
|
-
const oppOff = -webSide * (twHalf + thickness / 2);
|
|
57187
|
-
parts.push({ id: `${joint.id}:stiff`, group: "stiffener", kind: "plate", center: P(u0 + width / 2, 0, oppOff), uDir, vDir, width, depth: height, thickness, holes: [], meta: { label: `Stiffener ${Math.round(width)}\xD7${Math.round(height)}\xD7${Math.round(thickness)}` } });
|
|
57188
|
-
parts.push({ id: `${joint.id}:stiffweld`, group: "weld", kind: "weld", closed: false, path: [P(u0, -height / 2, oppOff), P(u0, height / 2, oppOff)], leg: weldLeg, meta: { label: `Fillet ${weldLeg}` } });
|
|
57189
|
-
}
|
|
57190
|
-
}
|
|
57191
|
-
const cope = beamCopes(beam, support, joint.at ?? "end0", p);
|
|
57192
|
-
const copeRadius = pos(p, "copeRadius", 12.7);
|
|
57193
|
-
const MIN_COPE = 1;
|
|
57194
|
-
const pushCope = (side, dec) => {
|
|
57195
|
-
if (!(dec.depth > MIN_COPE)) return;
|
|
57196
|
-
const lenU = dec.length + clearance;
|
|
57197
|
-
const vC = side === "top" ? beam.dims.d / 2 - dec.depth / 2 : -beam.dims.d / 2 + dec.depth / 2;
|
|
57198
|
-
parts.push({
|
|
57199
|
-
id: `${joint.id}:cope-${side}`,
|
|
57200
|
-
group: "cope",
|
|
57201
|
-
kind: "cut",
|
|
57202
|
-
member: beam.id,
|
|
57203
|
-
center: P(lenU / 2, vC, 0),
|
|
57204
|
-
uDir,
|
|
57205
|
-
vDir,
|
|
57206
|
-
width: lenU,
|
|
57207
|
-
depth: dec.depth,
|
|
57208
|
-
thickness: beam.dims.w + 2,
|
|
57209
|
-
radius: copeRadius,
|
|
57210
|
-
reentrantV: side === "top" ? -1 : 1,
|
|
57211
|
-
// web side = toward the beam centroid (top cope below, bottom above)
|
|
57212
|
-
meta: { label: `${side === "top" ? "Top" : "Bottom"} cope ${Math.round(dec.length)}\xD7${Math.round(dec.depth)}` }
|
|
57213
|
-
});
|
|
57183
|
+
baked.filter = next;
|
|
57184
|
+
}
|
|
57185
|
+
if (Array.isArray(baked.sheets)) {
|
|
57186
|
+
baked.sheets = baked.sheets.map(
|
|
57187
|
+
(s) => s && typeof s === "object" ? { ...s, page: stripPageRaster(s.page) } : s
|
|
57188
|
+
);
|
|
57189
|
+
}
|
|
57190
|
+
doc.setIn(["nodes", idx, "config", "takeoff"], baked);
|
|
57191
|
+
(0, import_node_fs28.writeFileSync)(sourcePath, doc.toString());
|
|
57192
|
+
}
|
|
57193
|
+
|
|
57194
|
+
// vectorize.ts
|
|
57195
|
+
function assignIds(items, prefix) {
|
|
57196
|
+
const used = /* @__PURE__ */ new Set();
|
|
57197
|
+
const keep = items.map((it) => {
|
|
57198
|
+
if (it.id && !used.has(it.id)) {
|
|
57199
|
+
used.add(it.id);
|
|
57200
|
+
return true;
|
|
57201
|
+
}
|
|
57202
|
+
return false;
|
|
57203
|
+
});
|
|
57204
|
+
let counter = 0;
|
|
57205
|
+
const nextId = () => {
|
|
57206
|
+
let id;
|
|
57207
|
+
do {
|
|
57208
|
+
counter += 1;
|
|
57209
|
+
id = `${prefix}${counter}`;
|
|
57210
|
+
} while (used.has(id));
|
|
57211
|
+
used.add(id);
|
|
57212
|
+
return id;
|
|
57214
57213
|
};
|
|
57215
|
-
|
|
57216
|
-
if (cope.bottom) pushCope("bottom", cope.bottom);
|
|
57217
|
-
return parts;
|
|
57214
|
+
return items.map((it, i) => keep[i] ? it : { ...it, id: nextId() });
|
|
57218
57215
|
}
|
|
57219
|
-
function
|
|
57220
|
-
const
|
|
57221
|
-
|
|
57216
|
+
function geomKey(el, index) {
|
|
57217
|
+
const layer = el.layer ?? "";
|
|
57218
|
+
if (el.kind === "text") {
|
|
57219
|
+
const pos2 = el.origin ? el.origin.join(",") : (el.bbox ?? []).join(",");
|
|
57220
|
+
return `text|${layer}|${el.text ?? ""}|${pos2}`;
|
|
57221
|
+
}
|
|
57222
|
+
if (el.d) return `${el.kind}|${layer}|${el.d}`;
|
|
57223
|
+
if (el.pts) return `${el.kind}|${layer}|${el.pts.map((p) => p.join(",")).join(" ")}`;
|
|
57224
|
+
return `nogeom|${index}`;
|
|
57225
|
+
}
|
|
57226
|
+
function dedupeElements(elements) {
|
|
57227
|
+
const seen = /* @__PURE__ */ new Set();
|
|
57222
57228
|
const out = [];
|
|
57223
|
-
|
|
57224
|
-
|
|
57225
|
-
if (
|
|
57226
|
-
|
|
57227
|
-
|
|
57228
|
-
positions[k] = g.positions[k] + dx;
|
|
57229
|
-
positions[k + 1] = g.positions[k + 1] + dy;
|
|
57230
|
-
positions[k + 2] = g.positions[k + 2] + dz;
|
|
57231
|
-
}
|
|
57232
|
-
const role = typeof g.role === "string" ? g.role : void 0;
|
|
57233
|
-
const label = role ? role.charAt(0).toUpperCase() + role.slice(1) : "Imported part";
|
|
57234
|
-
out.push({ id: `${joint.id}:${g.id || `m${i}`}`, group: "custom", kind: "mesh", positions, indices: g.indices.slice(), meta: { label, role } });
|
|
57229
|
+
elements.forEach((el, i) => {
|
|
57230
|
+
const key = geomKey(el, i);
|
|
57231
|
+
if (seen.has(key)) return;
|
|
57232
|
+
seen.add(key);
|
|
57233
|
+
out.push(el);
|
|
57235
57234
|
});
|
|
57236
57235
|
return out;
|
|
57237
57236
|
}
|
|
57238
|
-
function
|
|
57239
|
-
const
|
|
57240
|
-
const
|
|
57241
|
-
const
|
|
57242
|
-
|
|
57243
|
-
|
|
57244
|
-
|
|
57245
|
-
return;
|
|
57237
|
+
function snapEndpoints(elements, tol = 1) {
|
|
57238
|
+
const reps = [];
|
|
57239
|
+
const tol2 = tol * tol;
|
|
57240
|
+
const snap = (p) => {
|
|
57241
|
+
for (const r of reps) {
|
|
57242
|
+
const dx = p[0] - r[0];
|
|
57243
|
+
const dy = p[1] - r[1];
|
|
57244
|
+
if (dx * dx + dy * dy <= tol2) return r;
|
|
57246
57245
|
}
|
|
57247
|
-
|
|
57248
|
-
|
|
57249
|
-
|
|
57250
|
-
|
|
57251
|
-
|
|
57252
|
-
|
|
57253
|
-
|
|
57254
|
-
|
|
57255
|
-
|
|
57256
|
-
|
|
57257
|
-
|
|
57258
|
-
|
|
57259
|
-
|
|
57260
|
-
|
|
57261
|
-
|
|
57262
|
-
|
|
57263
|
-
|
|
57264
|
-
|
|
57265
|
-
|
|
57266
|
-
|
|
57267
|
-
|
|
57268
|
-
|
|
57269
|
-
|
|
57270
|
-
|
|
57271
|
-
|
|
57272
|
-
|
|
57273
|
-
|
|
57274
|
-
|
|
57275
|
-
|
|
57276
|
-
|
|
57277
|
-
|
|
57278
|
-
|
|
57279
|
-
|
|
57280
|
-
|
|
57281
|
-
|
|
57282
|
-
|
|
57283
|
-
|
|
57284
|
-
|
|
57285
|
-
|
|
57286
|
-
|
|
57287
|
-
|
|
57288
|
-
|
|
57289
|
-
|
|
57290
|
-
|
|
57291
|
-
|
|
57292
|
-
|
|
57293
|
-
|
|
57294
|
-
|
|
57295
|
-
|
|
57296
|
-
|
|
57297
|
-
|
|
57298
|
-
|
|
57299
|
-
|
|
57300
|
-
|
|
57246
|
+
const rep = [p[0], p[1]];
|
|
57247
|
+
reps.push(rep);
|
|
57248
|
+
return rep;
|
|
57249
|
+
};
|
|
57250
|
+
return elements.map((el) => {
|
|
57251
|
+
if (!el.pts || el.pts.length === 0) return el;
|
|
57252
|
+
const pts = el.pts.map((p) => {
|
|
57253
|
+
const s = snap(p);
|
|
57254
|
+
return [s[0], s[1]];
|
|
57255
|
+
});
|
|
57256
|
+
return { ...el, pts };
|
|
57257
|
+
});
|
|
57258
|
+
}
|
|
57259
|
+
function deriveLayers(elements, existing) {
|
|
57260
|
+
const onByName = /* @__PURE__ */ new Map();
|
|
57261
|
+
for (const l of existing ?? []) if (l && l.name && l.on != null) onByName.set(l.name, l.on);
|
|
57262
|
+
const counts = /* @__PURE__ */ new Map();
|
|
57263
|
+
for (const el of elements) {
|
|
57264
|
+
if (!el.layer) continue;
|
|
57265
|
+
counts.set(el.layer, (counts.get(el.layer) ?? 0) + 1);
|
|
57266
|
+
}
|
|
57267
|
+
return [...counts.entries()].map(([name, count]) => onByName.has(name) ? { name, count, on: onByName.get(name) } : { name, count }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
57268
|
+
}
|
|
57269
|
+
function pickSheet(contract, sheetId) {
|
|
57270
|
+
const sheets = contract.sheets ?? [];
|
|
57271
|
+
if (sheetId) return sheets.find((s) => s.id === sheetId);
|
|
57272
|
+
const active = contract.active ?? 0;
|
|
57273
|
+
return sheets[active] ?? sheets[0];
|
|
57274
|
+
}
|
|
57275
|
+
function escAttr(s) {
|
|
57276
|
+
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
57277
|
+
}
|
|
57278
|
+
function escText(s) {
|
|
57279
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
57280
|
+
}
|
|
57281
|
+
function num3(v, fallback) {
|
|
57282
|
+
const n = typeof v === "number" ? v : Number(v);
|
|
57283
|
+
return Number.isFinite(n) ? n : fallback;
|
|
57284
|
+
}
|
|
57285
|
+
function ptsToPath(pts) {
|
|
57286
|
+
if (!pts || pts.length < 2) return "";
|
|
57287
|
+
return pts.map((p, i) => `${i === 0 ? "M" : "L"}${num3(p[0], 0)} ${num3(p[1], 0)}`).join(" ");
|
|
57288
|
+
}
|
|
57289
|
+
function contractToSvg(contract, sheetId) {
|
|
57290
|
+
const sheet = pickSheet(contract, sheetId);
|
|
57291
|
+
if (!sheet) return '<svg xmlns="http://www.w3.org/2000/svg"></svg>';
|
|
57292
|
+
const w = num3(sheet.page?.w, 100);
|
|
57293
|
+
const h = num3(sheet.page?.h, 100);
|
|
57294
|
+
const parts = [];
|
|
57295
|
+
for (const el of sheet.elements) {
|
|
57296
|
+
if (el.kind === "text") {
|
|
57297
|
+
if (!el.text) continue;
|
|
57298
|
+
const bbox = el.bbox;
|
|
57299
|
+
const ox = num3(el.origin?.[0] ?? bbox?.[0], 0);
|
|
57300
|
+
const oy = num3(el.origin?.[1] ?? bbox?.[3] ?? bbox?.[1], 0);
|
|
57301
|
+
const fs2 = el.size != null ? num3(el.size, 4) : num3(el.w, 1) * 6;
|
|
57302
|
+
const font = el.font ? ` font-family="${escAttr(el.font)}"` : "";
|
|
57303
|
+
const ang = num3(el.angle, 0);
|
|
57304
|
+
const rot = ang ? ` transform="rotate(${ang} ${ox} ${oy})"` : "";
|
|
57305
|
+
parts.push(
|
|
57306
|
+
`<text x="${ox}" y="${oy}" font-size="${fs2}" fill="${escAttr(el.color ?? "#94a3b8")}"${font}${rot}>${escText(el.text)}</text>`
|
|
57307
|
+
);
|
|
57308
|
+
continue;
|
|
57301
57309
|
}
|
|
57310
|
+
const d = el.d || ptsToPath(el.pts);
|
|
57311
|
+
if (!d) continue;
|
|
57312
|
+
const sw = num3(el.w, 1);
|
|
57313
|
+
const dash = el.dashed ? ` stroke-dasharray="${sw * 3} ${sw * 2}"` : "";
|
|
57314
|
+
parts.push(
|
|
57315
|
+
`<path d="${escAttr(d)}" fill="none" stroke="${escAttr(el.color ?? "#e2e8f0")}" stroke-width="${sw}"${dash}/>`
|
|
57316
|
+
);
|
|
57317
|
+
}
|
|
57318
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${w} ${h}" width="${w}" height="${h}">${parts.join("")}</svg>`;
|
|
57319
|
+
}
|
|
57320
|
+
function postProcess(contract, opts = {}) {
|
|
57321
|
+
const snapTol = opts.snapTol ?? 1;
|
|
57322
|
+
const sheets = (contract.sheets ?? []).map((sheet, i) => {
|
|
57323
|
+
let elements = sheet.elements ?? [];
|
|
57324
|
+
elements = snapEndpoints(elements, snapTol);
|
|
57325
|
+
elements = dedupeElements(elements);
|
|
57326
|
+
elements = assignIds(elements, "e");
|
|
57327
|
+
const layers = deriveLayers(elements, sheet.layers);
|
|
57328
|
+
const id = sheet.id ?? `s${i + 1}`;
|
|
57329
|
+
const groups = sheet.groups ? assignIds(sheet.groups, "g") : void 0;
|
|
57330
|
+
return { ...sheet, id, elements, layers, ...groups ? { groups } : {} };
|
|
57302
57331
|
});
|
|
57303
|
-
const
|
|
57304
|
-
|
|
57332
|
+
const datums = contract.datums ? assignIds(contract.datums, "dt") : void 0;
|
|
57333
|
+
const links = contract.links ? assignIds(contract.links, "lk") : void 0;
|
|
57334
|
+
return {
|
|
57335
|
+
...contract,
|
|
57336
|
+
type: "drawing.vector/v1",
|
|
57337
|
+
sheets,
|
|
57338
|
+
...datums ? { datums } : {},
|
|
57339
|
+
...links ? { links } : {}
|
|
57340
|
+
};
|
|
57305
57341
|
}
|
|
57306
57342
|
|
|
57307
|
-
//
|
|
57308
|
-
|
|
57309
|
-
|
|
57310
|
-
|
|
57311
|
-
|
|
57312
|
-
|
|
57313
|
-
|
|
57314
|
-
|
|
57315
|
-
|
|
57343
|
+
// views-to-scene.ts
|
|
57344
|
+
function mapper(sheet) {
|
|
57345
|
+
const t = sheet.transform;
|
|
57346
|
+
if (!t || typeof t.scale !== "number" || !(t.scale > 0)) return null;
|
|
57347
|
+
const s = t.scale;
|
|
57348
|
+
const [ox, oy] = t.origin ?? [0, 0];
|
|
57349
|
+
const rot = (t.rotation ?? 0) * Math.PI / 180;
|
|
57350
|
+
const cos = Math.cos(rot);
|
|
57351
|
+
const sin = Math.sin(rot);
|
|
57352
|
+
return (p) => {
|
|
57353
|
+
const dx = p[0] - ox;
|
|
57354
|
+
const dy = p[1] - oy;
|
|
57355
|
+
const rx = dx * cos - dy * sin;
|
|
57356
|
+
const ry = dx * sin + dy * cos;
|
|
57357
|
+
return [rx * s + 0, -ry * s + 0];
|
|
57358
|
+
};
|
|
57359
|
+
}
|
|
57360
|
+
function uprightHorizontal(sheet) {
|
|
57361
|
+
const dir = sheet.view?.dir ?? "+y";
|
|
57362
|
+
if (dir === "+y") return { axis: "x", sign: 1 };
|
|
57363
|
+
if (dir === "-y") return { axis: "x", sign: -1 };
|
|
57364
|
+
if (dir === "+x") return { axis: "y", sign: -1 };
|
|
57365
|
+
if (dir === "-x") return { axis: "y", sign: 1 };
|
|
57366
|
+
return null;
|
|
57367
|
+
}
|
|
57368
|
+
function elevationZExtent(sheet, g) {
|
|
57369
|
+
const map = mapper(sheet);
|
|
57370
|
+
if (!map) return null;
|
|
57371
|
+
const pts = collectDisplayPoints(g, sheet);
|
|
57372
|
+
if (pts.length === 0) return null;
|
|
57373
|
+
let lo = Infinity;
|
|
57374
|
+
let hi = -Infinity;
|
|
57375
|
+
for (const p of pts) {
|
|
57376
|
+
const z = map(p)[1];
|
|
57377
|
+
if (z < lo) lo = z;
|
|
57378
|
+
if (z > hi) hi = z;
|
|
57379
|
+
}
|
|
57380
|
+
return lo <= hi ? [lo, hi] : null;
|
|
57316
57381
|
}
|
|
57317
|
-
function
|
|
57318
|
-
|
|
57319
|
-
|
|
57320
|
-
|
|
57321
|
-
|
|
57322
|
-
|
|
57323
|
-
|
|
57324
|
-
const
|
|
57325
|
-
|
|
57326
|
-
|
|
57327
|
-
|
|
57382
|
+
function worldInterval(sheet, g, component, sign = 1) {
|
|
57383
|
+
const map = mapper(sheet);
|
|
57384
|
+
if (!map) return null;
|
|
57385
|
+
const pts = collectDisplayPoints(g, sheet);
|
|
57386
|
+
if (pts.length === 0) return null;
|
|
57387
|
+
let lo = Infinity;
|
|
57388
|
+
let hi = -Infinity;
|
|
57389
|
+
for (const p of pts) {
|
|
57390
|
+
const v = map(p)[component] * sign;
|
|
57391
|
+
if (v < lo) lo = v;
|
|
57392
|
+
if (v > hi) hi = v;
|
|
57328
57393
|
}
|
|
57329
|
-
|
|
57330
|
-
|
|
57331
|
-
|
|
57394
|
+
return lo <= hi ? [lo, hi] : null;
|
|
57395
|
+
}
|
|
57396
|
+
function collectDisplayPoints(g, sheet) {
|
|
57397
|
+
if (g.footprint && g.footprint.length) return g.footprint;
|
|
57398
|
+
if (g.axis && g.axis.length === 2) return g.axis;
|
|
57399
|
+
const ids = new Set(g.elementIds ?? []);
|
|
57400
|
+
const pts = [];
|
|
57401
|
+
for (const el of sheet.elements ?? []) {
|
|
57402
|
+
if (!el.id || !ids.has(el.id)) continue;
|
|
57403
|
+
if (el.pts) pts.push(...el.pts);
|
|
57404
|
+
else if (el.bbox && el.bbox.length === 4) {
|
|
57405
|
+
pts.push([el.bbox[0], el.bbox[1]], [el.bbox[2], el.bbox[3]]);
|
|
57406
|
+
}
|
|
57332
57407
|
}
|
|
57333
|
-
|
|
57334
|
-
|
|
57335
|
-
|
|
57336
|
-
|
|
57337
|
-
|
|
57338
|
-
|
|
57408
|
+
return pts;
|
|
57409
|
+
}
|
|
57410
|
+
function resolveDatum(v, datums, axis) {
|
|
57411
|
+
if (typeof v === "number") return v;
|
|
57412
|
+
if (typeof v === "string") {
|
|
57413
|
+
const d = datums.find((x) => x.id === v);
|
|
57414
|
+
return d && (d.axis ?? "z") === axis ? d.value : null;
|
|
57339
57415
|
}
|
|
57340
57416
|
return null;
|
|
57341
57417
|
}
|
|
57342
|
-
|
|
57343
|
-
|
|
57344
|
-
|
|
57345
|
-
|
|
57346
|
-
|
|
57347
|
-
|
|
57348
|
-
|
|
57349
|
-
const override = pc[profile] ?? Object.entries(pc).find(([k]) => k.trim().toUpperCase() === profile)?.[1];
|
|
57350
|
-
if (override) return override;
|
|
57351
|
-
const pal = contract.palette && contract.palette.length ? contract.palette : SCENE_DEFAULT_PAL;
|
|
57352
|
-
return pal[(idx % pal.length + pal.length) % pal.length];
|
|
57353
|
-
}
|
|
57354
|
-
function dispToMm(pt, ptPerFt) {
|
|
57355
|
-
const k = FT_TO_MM / ptPerFt;
|
|
57356
|
-
return [pt[0] * k, -pt[1] * k];
|
|
57418
|
+
var PALETTE = ["#3b82f6", "#f59e0b", "#10b981", "#8b5cf6", "#ef4444", "#14b8a6", "#eab308", "#64748b"];
|
|
57419
|
+
function overlapRatio(a, b) {
|
|
57420
|
+
const lo = Math.max(a[0], b[0]);
|
|
57421
|
+
const hi = Math.min(a[1], b[1]);
|
|
57422
|
+
if (hi <= lo) return 0;
|
|
57423
|
+
const shorter = Math.max(1e-9, Math.min(a[1] - a[0], b[1] - b[0]));
|
|
57424
|
+
return (hi - lo) / shorter;
|
|
57357
57425
|
}
|
|
57358
|
-
function
|
|
57426
|
+
function viewsToScene(contractInput) {
|
|
57359
57427
|
const contract = contractInput ?? {};
|
|
57428
|
+
const sheets = contract.sheets ?? [];
|
|
57429
|
+
const datums = contract.datums ?? [];
|
|
57430
|
+
const links = contract.links ?? [];
|
|
57360
57431
|
const elements = [];
|
|
57361
|
-
const memberGeo = /* @__PURE__ */ new Map();
|
|
57362
57432
|
const skipped = [];
|
|
57363
|
-
const
|
|
57364
|
-
const
|
|
57365
|
-
const
|
|
57366
|
-
|
|
57367
|
-
|
|
57368
|
-
|
|
57369
|
-
const
|
|
57370
|
-
|
|
57371
|
-
|
|
57372
|
-
|
|
57373
|
-
|
|
57433
|
+
const groupKeys = [];
|
|
57434
|
+
const seenKey = /* @__PURE__ */ new Set();
|
|
57435
|
+
const plans = sheets.filter((s) => s.view?.kind === "plan");
|
|
57436
|
+
const uprights = sheets.filter((s) => s.view?.kind === "elevation" || s.view?.kind === "section");
|
|
57437
|
+
const uprightEntities = [];
|
|
57438
|
+
for (const sh of uprights) {
|
|
57439
|
+
const hz = uprightHorizontal(sh);
|
|
57440
|
+
if (!hz) continue;
|
|
57441
|
+
for (const g of sh.groups ?? []) {
|
|
57442
|
+
const z = elevationZExtent(sh, g);
|
|
57443
|
+
const h = worldInterval(sh, g, 0, hz.sign);
|
|
57444
|
+
if (z && h) uprightEntities.push({ sheet: sh, g, z, h, axis: hz.axis });
|
|
57445
|
+
}
|
|
57374
57446
|
}
|
|
57375
|
-
|
|
57376
|
-
|
|
57377
|
-
|
|
57378
|
-
|
|
57379
|
-
|
|
57380
|
-
|
|
57381
|
-
|
|
57382
|
-
|
|
57447
|
+
const linkedAway = /* @__PURE__ */ new Set();
|
|
57448
|
+
for (const l of links) {
|
|
57449
|
+
if (l.kind !== "same-entity") continue;
|
|
57450
|
+
linkedAway.add(`${l.a.sheet}/${l.a.id ?? ""}`);
|
|
57451
|
+
linkedAway.add(`${l.b.sheet}/${l.b.id ?? ""}`);
|
|
57452
|
+
}
|
|
57453
|
+
function resolveZ(planSheet, g) {
|
|
57454
|
+
if (g.extrude && (g.extrude.from !== void 0 || g.extrude.to !== void 0)) {
|
|
57455
|
+
const exFrom = resolveDatum(g.extrude.from, datums, "z");
|
|
57456
|
+
const exTo = resolveDatum(g.extrude.to, datums, "z");
|
|
57457
|
+
if (exFrom != null && exTo != null) return { z: [exFrom, exTo], how: "extrude" };
|
|
57458
|
+
return { error: "extrude reference unresolved \u2014 each end must be a number or the id of a z-axis datum" };
|
|
57459
|
+
}
|
|
57460
|
+
const key = { sheet: planSheet.id, id: g.id };
|
|
57461
|
+
for (const l of links) {
|
|
57462
|
+
if (l.kind !== "same-entity") continue;
|
|
57463
|
+
const other = l.a.sheet === key.sheet && l.a.id === key.id ? l.b : l.b.sheet === key.sheet && l.b.id === key.id ? l.a : null;
|
|
57464
|
+
if (!other) continue;
|
|
57465
|
+
const hit = uprightEntities.find((u) => u.sheet.id === other.sheet && u.g.id === other.id);
|
|
57466
|
+
if (hit) return { z: hit.z, how: "link" };
|
|
57467
|
+
}
|
|
57468
|
+
const mineX = worldInterval(planSheet, g, 0);
|
|
57469
|
+
const mineY = worldInterval(planSheet, g, 1);
|
|
57470
|
+
if (mineX || mineY) {
|
|
57471
|
+
const candidates = uprightEntities.filter((u) => !linkedAway.has(`${u.sheet.id}/${u.g.id ?? ""}`)).map((u) => {
|
|
57472
|
+
const mine = u.axis === "x" ? mineX : mineY;
|
|
57473
|
+
return { u, r: mine ? overlapRatio(mine, u.h) : 0 };
|
|
57474
|
+
}).filter((x) => x.r >= 0.8);
|
|
57475
|
+
if (candidates.length === 1) return { z: candidates[0].u.z, how: "match" };
|
|
57476
|
+
if (candidates.length > 1) return { ambiguous: candidates.length };
|
|
57477
|
+
}
|
|
57478
|
+
return null;
|
|
57479
|
+
}
|
|
57480
|
+
for (const plan of plans) {
|
|
57481
|
+
const map = mapper(plan);
|
|
57482
|
+
const sheetId = plan.id ?? "?";
|
|
57483
|
+
if (!map) {
|
|
57484
|
+
for (const g of plan.groups ?? []) skipped.push({ id: `${sheetId}/${g.id ?? "?"}`, reason: "sheet has no world transform (transform.scale required)" });
|
|
57485
|
+
continue;
|
|
57486
|
+
}
|
|
57487
|
+
for (const g of plan.groups ?? []) {
|
|
57488
|
+
const gid = `${sheetId}/${g.id ?? "?"}`;
|
|
57489
|
+
const isMember = !!(g.axis && g.section);
|
|
57490
|
+
const isFootprint = !!(g.footprint && g.footprint.length >= 3);
|
|
57491
|
+
if (!isMember && !isFootprint) continue;
|
|
57492
|
+
if (isMember && !(g.section.w > 0 && g.section.d > 0)) {
|
|
57493
|
+
skipped.push({ id: gid, reason: "invalid section \u2014 w and d must be positive world units" });
|
|
57383
57494
|
continue;
|
|
57384
57495
|
}
|
|
57385
|
-
const
|
|
57386
|
-
|
|
57387
|
-
|
|
57388
|
-
|
|
57389
|
-
profileOrder.push(profile);
|
|
57390
|
-
}
|
|
57391
|
-
const [ax, ay] = dispToMm(m.wp[0], ptPerFt);
|
|
57392
|
-
const [bx, by] = dispToMm(m.wp[1], ptPerFt);
|
|
57393
|
-
let from;
|
|
57394
|
-
let to;
|
|
57395
|
-
let workFrom;
|
|
57396
|
-
let workTo;
|
|
57397
|
-
let posOffset = 0;
|
|
57398
|
-
if (m.role === "column") {
|
|
57399
|
-
const bos = m.col?.bos != null ? m.col.bos * IN_TO_MM : 0;
|
|
57400
|
-
const tos = m.col?.tos != null ? m.col.tos * IN_TO_MM : defaultTosMm;
|
|
57401
|
-
from = [ax, ay, bos];
|
|
57402
|
-
to = [ax, ay, tos];
|
|
57403
|
-
workFrom = from;
|
|
57404
|
-
workTo = to;
|
|
57405
|
-
} else {
|
|
57406
|
-
const z0 = m.ends?.[0]?.tos != null ? m.ends[0].tos * IN_TO_MM : defaultTosMm;
|
|
57407
|
-
const z1 = m.ends?.[1]?.tos != null ? m.ends[1].tos * IN_TO_MM : defaultTosMm;
|
|
57408
|
-
workFrom = [ax, ay, z0];
|
|
57409
|
-
workTo = [bx, by, z1];
|
|
57410
|
-
const pos2 = depthPosition(m.position, Math.abs(z1 - z0), Math.hypot(bx - ax, by - ay), mIsBrace && m.brace?.type === "vertical");
|
|
57411
|
-
const zoff = pos2 === "top" ? -dims.d / 2 : pos2 === "bottom" ? dims.d / 2 : 0;
|
|
57412
|
-
posOffset = zoff;
|
|
57413
|
-
from = [ax, ay, z0 + zoff];
|
|
57414
|
-
to = [bx, by, z1 + zoff];
|
|
57496
|
+
const zr0 = resolveZ(plan, g);
|
|
57497
|
+
if (!zr0) {
|
|
57498
|
+
skipped.push({ id: gid, reason: "no Z extent \u2014 add extrude datums/values, a same-entity link, or a matching elevation entity" });
|
|
57499
|
+
continue;
|
|
57415
57500
|
}
|
|
57416
|
-
if (
|
|
57417
|
-
skipped.push(
|
|
57501
|
+
if ("ambiguous" in zr0) {
|
|
57502
|
+
skipped.push({ id: gid, reason: `ambiguous Z \u2014 ${zr0.ambiguous} elevation entities share this span; add a same-entity link to pick one` });
|
|
57418
57503
|
continue;
|
|
57419
57504
|
}
|
|
57420
|
-
if (
|
|
57421
|
-
skipped.push(
|
|
57505
|
+
if ("error" in zr0) {
|
|
57506
|
+
skipped.push({ id: gid, reason: zr0.error });
|
|
57422
57507
|
continue;
|
|
57423
57508
|
}
|
|
57424
|
-
|
|
57425
|
-
const
|
|
57426
|
-
if (
|
|
57427
|
-
|
|
57428
|
-
|
|
57429
|
-
|
|
57430
|
-
|
|
57431
|
-
|
|
57432
|
-
|
|
57509
|
+
const zr = zr0;
|
|
57510
|
+
const key = g.kind || (isMember ? "member" : "footprint");
|
|
57511
|
+
if (!seenKey.has(key)) {
|
|
57512
|
+
seenKey.add(key);
|
|
57513
|
+
groupKeys.push(key);
|
|
57514
|
+
}
|
|
57515
|
+
if (isMember) {
|
|
57516
|
+
const [ax, ay] = map(g.axis[0]);
|
|
57517
|
+
const [bx, by] = map(g.axis[1]);
|
|
57518
|
+
const zFrom = zr.how === "extrude" ? zr.z[0] : (zr.z[0] + zr.z[1]) / 2;
|
|
57519
|
+
const zTo = zr.how === "extrude" ? zr.z[1] : zFrom;
|
|
57520
|
+
elements.push({
|
|
57521
|
+
id: g.id ?? gid,
|
|
57522
|
+
group: key,
|
|
57523
|
+
kind: "box",
|
|
57524
|
+
from: [ax, ay, zFrom],
|
|
57525
|
+
to: [bx, by, zTo],
|
|
57526
|
+
section: { w: g.section.w, d: g.section.d },
|
|
57527
|
+
meta: { sheet: sheetId, ...g.label ? { label: g.label } : {} }
|
|
57528
|
+
});
|
|
57529
|
+
} else {
|
|
57530
|
+
elements.push({
|
|
57531
|
+
id: g.id ?? gid,
|
|
57532
|
+
group: key,
|
|
57533
|
+
kind: "extrusion",
|
|
57534
|
+
footprint: g.footprint.map((p) => map(p)),
|
|
57535
|
+
from: Math.min(zr.z[0], zr.z[1]),
|
|
57536
|
+
to: Math.max(zr.z[0], zr.z[1]),
|
|
57537
|
+
meta: { sheet: sheetId, ...g.label ? { label: g.label } : {} }
|
|
57538
|
+
});
|
|
57433
57539
|
}
|
|
57434
|
-
elements.push({ id: m.id, group: profile, kind: "box", from, to, section: { w: dims.w, d: dims.d }, meta: { profile }, ...typeof m.rot === "number" ? { rot: -m.rot } : {} });
|
|
57435
57540
|
}
|
|
57436
57541
|
}
|
|
57437
|
-
const
|
|
57438
|
-
const
|
|
57439
|
-
|
|
57440
|
-
key: profile,
|
|
57441
|
-
label: profile,
|
|
57442
|
-
color: pickColor(profile, paletteRank.indexOf(profile), contract)
|
|
57443
|
-
}));
|
|
57444
|
-
const joints = expandJoints(contract.joints, memberGeo);
|
|
57445
|
-
for (const part of joints.elements) elements.push(part);
|
|
57446
|
-
for (const g of joints.groups) groups.push(g);
|
|
57447
|
-
for (const id of joints.skipped) skipped.push(`joint:${id}`);
|
|
57448
|
-
return {
|
|
57449
|
-
scene: { meta: { name: contract.title || "Steel Model", units: "mm", up: "z" }, groups, elements },
|
|
57450
|
-
skipped
|
|
57451
|
-
};
|
|
57542
|
+
const groups = groupKeys.map((key, i) => ({ key, label: key, color: PALETTE[i % PALETTE.length] }));
|
|
57543
|
+
const name = contract.source && typeof contract.source.name === "string" ? String(contract.source.name) : "Reconstructed drawing";
|
|
57544
|
+
return { scene: { meta: { name, units: "mm", up: "z" }, groups, elements }, skipped };
|
|
57452
57545
|
}
|
|
57453
57546
|
|
|
57454
57547
|
// bom-export.ts
|
|
@@ -61889,7 +61982,8 @@ function weightOf(contract, profile) {
|
|
|
61889
61982
|
const w = contract.weights;
|
|
61890
61983
|
if (!w || !profile) return null;
|
|
61891
61984
|
if (profile in w) return w[profile] ?? null;
|
|
61892
|
-
const
|
|
61985
|
+
const target = canonProfile(profile);
|
|
61986
|
+
const hit = Object.entries(w).find(([k]) => canonProfile(k) === target);
|
|
61893
61987
|
return hit ? hit[1] ?? null : null;
|
|
61894
61988
|
}
|
|
61895
61989
|
var isMfMark = (p) => !!p && /(^|[^A-Z])MF($|[^A-Z])/i.test(p);
|
|
@@ -66300,7 +66394,7 @@ async function startServer() {
|
|
|
66300
66394
|
res.setHeader("Cache-Control", /\.(html|js|css)$/i.test(path) ? "no-cache" : "public, max-age=0");
|
|
66301
66395
|
}
|
|
66302
66396
|
});
|
|
66303
|
-
const MIN_AWARE = "0.
|
|
66397
|
+
const MIN_AWARE = "0.89.0";
|
|
66304
66398
|
const isWin3 = process.platform === "win32";
|
|
66305
66399
|
const has = (cmd) => {
|
|
66306
66400
|
try {
|
|
@@ -66537,7 +66631,7 @@ async function startServer() {
|
|
|
66537
66631
|
const apps = await aware.list();
|
|
66538
66632
|
return { ok: true, apps: apps.map((a) => ({ ...a, provider: appProvider(a.id), baked: appBaked(a.id), workspace: appWorkspace(a.id), ...appOrigin(a.id) })) };
|
|
66539
66633
|
});
|
|
66540
|
-
app.get("/api/aisc-shapes", async () => ({ ok: true, shapes: Object.keys(aisc_shapes_default), bf: aisc_shapes_default }));
|
|
66634
|
+
app.get("/api/aisc-shapes", async () => ({ ok: true, shapes: Object.keys(aisc_shapes_default), bf: aisc_shapes_default, sections: SECTION_DIMS_IN }));
|
|
66541
66635
|
app.get("/api/workflows/updates", async () => {
|
|
66542
66636
|
const apps = await aware.list();
|
|
66543
66637
|
const installed = [];
|