How to use benchmarkName method in Best

Best JavaScript code snippet using best

section.js

Source:section.js Github

copy

Full Screen

1import {2 ToDimAlign,3 IntersectionPointOnSpline,4 Layout2D,5 Line,6 LineToOffsetSpline,7 paperSize,8 Plot2D,9 GetPointsWithBulge,10 TwoPointsLength,11} from "@nexivil/package-modules";12import { _ } from "global";13import { GenDefaultGridPointDict } from "./grid";14import { GetPointSectionInfo } from "./utils";15export function GenBasicSectionsFn(girderLayout, basicSectionInfo) {16 const common = basicSectionInfo.common;17 const end = basicSectionInfo.end;18 const support = basicSectionInfo.support;19 const sShape = basicSectionInfo.se.start;20 const eShape = basicSectionInfo.se.end;21 const properties = {22 title: "교량단면요약도",23 size: "A1",24 scale: 50,25 leftMargin: 10,26 rightMargin: 10,27 topMargin: 10,28 bottomMargin: 50,29 };30 let commonThickness = 20;31 let girderNumber = girderLayout.girderSplines.length;32 let alignment = girderLayout.alignment;33 let lLine = LineToOffsetSpline(girderLayout.girderSplines[0], -common.SlabLeft);34 let rLine = LineToOffsetSpline(girderLayout.girderSplines[girderLayout.girderSplines.length - 1], common.SlabRight);35 const seShape = {36 start: {37 A: sShape.A,38 D: sShape.B,39 F: sShape.C,40 G: sShape.D,41 isStraight: true,42 endSlabH: end.SlabH,43 slabH: support.SlabH,44 },45 end: {46 A: eShape.A,47 D: eShape.B,48 F: eShape.C,49 G: eShape.D,50 isStraight: true,51 endSlabH: end.SlabH,52 slabH: support.SlabH,53 },54 };55 const sectionInfo = {56 B: common.B,57 H: common.H ? common.H : end.H,58 UL: common.T ? common.T / 2 : common.B / 2,59 UR: common.T ? common.T / 2 : common.B / 2,60 };61 const centerThickness = support.SlabH + support.HaunchH + common.PavementT;62 const lwb = { x: -sectionInfo.B / 2, y: -sectionInfo.H - centerThickness };63 const lwt = { x: -sectionInfo.UL, y: -centerThickness };64 const rwb = { x: sectionInfo.B / 2, y: -sectionInfo.H - centerThickness };65 const rwt = { x: sectionInfo.UR, y: -centerThickness };66 let gridPointDict = GenDefaultGridPointDict(girderLayout, seShape);67 let deckPointDicts = [];68 let sectionPoints = [];69 let supportKey = [];70 for (let key in girderLayout.gridKeyPoint) {71 supportKey.push(key);72 }73 let supportNum = supportKey.length - 2;74 for (let i = 0; i < supportNum; i++) {75 sectionPoints.push([]);76 for (let j = 0; j < girderNumber; j++) {77 let ptName = "G" + (j + 1).toFixed(0) + "S" + (i + 1).toFixed(0);78 let point = gridPointDict[ptName];79 let gradient = common.isFlat ? 0 : point.gradientY;80 let rad = Math.atan(gradient);81 let cos = Math.cos(rad);82 let sin = Math.sin(rad);83 let bottomY = i === 0 || i === supportNum - 1 ? end.SlabH + common.PavementT + end.H - end.CutH : centerThickness + support.H;84 let topY = i === 0 || i === supportNum - 1 ? end.SlabH + common.PavementT : centerThickness;85 let lflange = [[], [], []];86 let uflange = [[], [], []];87 let lWeb = GenGirderRestPoint(GenWebPoint(lwb, lwt, 0, -bottomY), GenWebPoint(lwb, lwt, gradient, -topY), 0, gradient, -commonThickness);88 let rWeb = GenGirderRestPoint(GenWebPoint(rwb, rwt, 0, -bottomY), GenWebPoint(rwb, rwt, gradient, -topY), 0, gradient, commonThickness);89 if ((i === 0 || i === supportNum - 1) && !end.Box) {90 if (end.LF < sectionInfo.B / 2) {91 lflange[0] = GenGirderRestPoint(92 { x: lwb.x - (commonThickness / 2 + end.LF / 2), y: -bottomY },93 { x: lwb.x + (end.LF / 2 - commonThickness / 2), y: -bottomY },94 null,95 null,96 -commonThickness97 );98 lflange[1] = GenGirderRestPoint(99 { x: rwb.x + (commonThickness / 2 + end.LF / 2), y: -bottomY },100 { x: rwb.x - (end.LF / 2 - commonThickness / 2), y: -bottomY },101 null,102 null,103 -commonThickness104 );105 } else {106 lflange[2] = GenGirderRestPoint({ x: -end.LF / 2, y: -bottomY }, { x: end.LF / 2, y: -bottomY }, null, null, -commonThickness);107 }108 let uf1 = {109 x: lWeb[1].x - (commonThickness / 2 + end.UF / 2),110 y: lWeb[1].y - gradient * (commonThickness / 2 + end.UF / 2),111 };112 let uf2 = {113 x: lWeb[1].x + (end.UF / 2 - commonThickness / 2),114 y: lWeb[1].y + gradient * (end.UF / 2 - commonThickness / 2),115 };116 let uf3 = {117 x: rWeb[1].x + (commonThickness / 2 + end.UF / 2),118 y: rWeb[1].y + gradient * (commonThickness / 2 + end.UF / 2),119 };120 let uf4 = {121 x: rWeb[1].x - (end.UF / 2 - commonThickness / 2),122 y: rWeb[1].y - gradient * (end.UF / 2 - commonThickness / 2),123 };124 uflange[0] = [125 uf1,126 uf2,127 { x: uf2.x - sin * commonThickness, y: uf2.y + cos * commonThickness },128 { x: uf1.x - sin * commonThickness, y: uf1.y + cos * commonThickness },129 ];130 uflange[1] = [131 uf4,132 uf3,133 { x: uf3.x - sin * commonThickness, y: uf3.y + cos * commonThickness },134 { x: uf4.x - sin * commonThickness, y: uf4.y + cos * commonThickness },135 ];136 } else {137 let uf1 = { x: -(support.UF / 2), y: -topY - gradient * (support.UF / 2) };138 let uf2 = { x: support.UF / 2, y: -topY + gradient * (support.UF / 2) };139 lflange[2] = GenGirderRestPoint(140 { x: -support.LF / 2, y: -bottomY },141 { x: support.LF / 2, y: -bottomY },142 null,143 null,144 -commonThickness145 );146 uflange[2] = [147 uf1,148 uf2,149 { x: uf2.x - sin * commonThickness, y: uf2.y + cos * commonThickness },150 { x: uf1.x - sin * commonThickness, y: uf1.y + cos * commonThickness },151 ];152 }153 sectionPoints[i].push({154 point,155 LRib: [],156 URib: [],157 uflange,158 lflange,159 web: [lWeb, rWeb],160 });161 }162 }163 const hr = 3; //헌치 기울기 추후 외부입력변수로 변경164 for (let i = 0; i < supportNum; i++) {165 let name = "CRS" + (i + 1).toFixed(0);166 let deckPoint = girderLayout.gridKeyPoint[name];167 let deckLpt = IntersectionPointOnSpline(lLine, deckPoint, alignment);168 let deckRpt = IntersectionPointOnSpline(rLine, deckPoint, alignment);169 let uflangePoint = [];170 let sH = i === 0 || i === supportNum - 1 ? end.SlabH + common.PavementT : support.SlabH + common.PavementT;171 let endH = i === 0 || i === supportNum - 1 ? end.SlabEndH + common.PavementT : support.SlabEndH + common.PavementT;172 for (let j = 0; j < girderNumber; j++) {173 let ptName = "G" + (j + 1).toFixed(0) + "S" + (i + 1).toFixed(0);174 let point = sectionPoints[i][j].point;175 let deltaZ = point.z - deckPoint.z;176 let deltaX = point.offset;177 let gradient = common.isFlat ? 0 : point.gradientY;178 let haunchH = i === 0 || i === supportNum - 1 ? 0 : support.HaunchH;179 for (let k in sectionPoints[i][j]["uflange"]) {180 if (sectionPoints[i][j]["uflange"][k].length > 0) {181 let pt1 = sectionPoints[i][j].uflange[k][0];182 let pt2 = sectionPoints[i][j].uflange[k][1];183 let hh1 = haunchH === 0 ? 0 : Math.abs(haunchH + (-gradient + point.gradientY) * (pt1.x - support.HaunchW));184 let hh2 = haunchH === 0 ? 0 : Math.abs(haunchH + (-gradient + point.gradientY) * (pt2.x + support.HaunchW));185 if (haunchH === 0) {186 uflangePoint.push({ x: deltaX + pt1.x, y: deltaZ + pt1.y });187 uflangePoint.push({ x: deltaX + pt1.x, y: deltaZ + pt1.y });188 uflangePoint.push({ x: deltaX + pt2.x, y: deltaZ + pt2.y });189 uflangePoint.push({ x: deltaX + pt2.x, y: deltaZ + pt2.y });190 } else {191 uflangePoint.push({192 x: deltaX + pt1.x - support.HaunchW - hh1 * hr,193 y: deltaZ - sH + point.gradientY * (pt1.x - support.HaunchW - hh1 * hr),194 });195 uflangePoint.push({196 x: deltaX + pt1.x - support.HaunchW,197 y: deltaZ + pt1.y - gradient * support.HaunchW,198 });199 uflangePoint.push({200 x: deltaX + pt2.x + support.HaunchW,201 y: deltaZ + pt2.y + gradient * support.HaunchW,202 });203 uflangePoint.push({204 x: deltaX + pt2.x + support.HaunchW + hh2 * hr,205 y: deltaZ - sH + point.gradientY * (pt2.x + support.HaunchW + hh2 * hr),206 });207 }208 }209 }210 }211 uflangePoint.pop();212 uflangePoint.shift();213 deckPointDicts.push({214 mp: deckPoint,215 points: [216 { x: deckLpt.offset, y: deckLpt.z - deckPoint.z - endH },217 { x: deckLpt.offset, y: deckLpt.z - deckPoint.z - common.PavementT },218 { x: 0, y: -common.PavementT },219 { x: deckRpt.offset, y: deckRpt.z - deckPoint.z - common.PavementT },220 { x: deckRpt.offset, y: deckRpt.z - deckPoint.z - endH },221 ...uflangePoint.reverse(),222 ],223 });224 }225 let mainPartDefaultInfo = GenDefaultMainPartData(girderLayout, basicSectionInfo, seShape);226 let spSectionDrawing = GenSupportSectionDrawing(deckPointDicts, sectionPoints, properties);227 let endSideDrawing = GenEndSideDrawing(seShape, end, properties);228 let drawing = [...spSectionDrawing, ...endSideDrawing];229 let result = {230 seShape,231 drawing,232 mainPartDefaultInfo,233 // spSectionDrawing,234 };235 return result;236}237export function GenSectionPointDictFn(girderBaseInfo, gridPointDict, gridInput) {238 let result = {};239 let slabToGirder = true; //girderBaseInfo.end.isStraight;240 const sectionInfo = {241 B: girderBaseInfo.common.B,242 H: girderBaseInfo.common.H ? girderBaseInfo.common.H : girderBaseInfo.end.H,243 UL: girderBaseInfo.common.T ? girderBaseInfo.common.T / 2 : girderBaseInfo.common.B / 2,244 UR: girderBaseInfo.common.T ? girderBaseInfo.common.T / 2 : girderBaseInfo.common.B / 2,245 };246 for (let k in gridPointDict) {247 if (k.substr(0, 1) === "G") {248 let point = gridPointDict[k];249 let girderIndex = k.substr(1, 1) - 1;250 let baseInput = {};251 let station = point.mainStation;252 let isFlat = girderBaseInfo.common.isFlat;253 let gradient = isFlat ? 0 : point.gradientY;254 let skew = point.skew;255 let pointSectionInfo = GetPointSectionInfo(station, skew, gridInput, girderIndex, gridPointDict);256 const centerThickness = girderBaseInfo.support.SlabH + girderBaseInfo.support.HaunchH + girderBaseInfo.common.PavementT; //slabInfo.slabThickness + slabInfo.haunchHeight; // slab변수 추가257 const lwb = { x: -sectionInfo.B / 2, y: -sectionInfo.H - centerThickness, z: 0 };258 const lwt = { x: -sectionInfo.UL, y: -centerThickness, z: 0 };259 const rwb = { x: sectionInfo.B / 2, y: -sectionInfo.H - centerThickness, z: 0 };260 const rwt = { x: sectionInfo.UR, y: -centerThickness, z: 0 };261 let forward = {};262 let backward = {};263 let ps = {};264 for (let i = 0; i < 2; i++) {265 if (i === 0) {266 ps = pointSectionInfo.forward;267 } else {268 ps = pointSectionInfo.backward;269 }270 let bottomY = ps.height + centerThickness;271 let topY = slabToGirder ? ps.slabThickness + ps.haunchH + girderBaseInfo.common.PavementT : centerThickness;272 let LRib = [];273 for (let j in ps.lRibLO) {274 let lRib = [275 { x: ps.lRibLO[j] - ps.lRibThk / 2, y: -bottomY, z: 0 },276 { x: ps.lRibLO[j] - ps.lRibThk / 2, y: -bottomY + ps.lRibH, z: 0 },277 { x: ps.lRibLO[j] + ps.lRibThk / 2, y: -bottomY + ps.lRibH, z: 0 },278 { x: ps.lRibLO[j] + ps.lRibThk / 2, y: -bottomY, z: 0 },279 ];280 LRib.push(lRib);281 }282 let URib = [];283 for (let j in ps.uRibLO) {284 let uRib = [285 { x: ps.uRibLO[j] - ps.uRibThk / 2, y: -topY + (ps.uRibLO[j] - ps.uRibThk / 2) * gradient, z: 0 },286 { x: ps.uRibLO[j] - ps.uRibThk / 2, y: -topY - ps.uRibH + ps.uRibLO[j] * gradient, z: 0 },287 { x: ps.uRibLO[j] + ps.uRibThk / 2, y: -topY - ps.uRibH + ps.uRibLO[j] * gradient, z: 0 },288 { x: ps.uRibLO[j] + ps.uRibThk / 2, y: -topY + (ps.uRibLO[j] + ps.uRibThk / 2) * gradient, z: 0 },289 ];290 URib.push(uRib);291 }292 // leftWeb293 let lw1 = GenWebPoint(lwb, lwt, 0, -bottomY); //{x:blwX,y:-height}294 let lw2 = GenWebPoint(lwb, lwt, gradient, -topY); //{x:tlwX,y:gradient*tlwX - slabThickness}295 let lWeb = GenGirderRestPoint(lw1, lw2, 0, gradient, -ps.webThk);296 // rightWeb297 let rw1 = GenWebPoint(rwb, rwt, 0, -bottomY); //{x:brwX,y:-height}298 let rw2 = GenWebPoint(rwb, rwt, gradient, -topY); //{x:trwX,y:gradient*trwX - slabThickness}299 let rWeb = GenGirderRestPoint(rw1, rw2, 0, gradient, ps.webThk);300 // bottomplate301 let lflange = [[], [], []];302 let newbl1 = { x: lw1.x - ps.lFlangeC, y: -bottomY };303 let newbl2 = { x: lw1.x - ps.lFlangeC + ps.lFlangeW, y: -bottomY };304 let newbr1 = { x: rw1.x + ps.lFlangeC, y: -bottomY };305 let newbr2 = { x: rw1.x + ps.lFlangeC - ps.lFlangeW, y: -bottomY };306 if (newbl2.x < newbr2.x) {307 //양측의 플렌지가 서로 중첩될 경우308 lflange[0] = GenGirderRestPoint(newbl1, newbl2, null, null, -ps.lFlangeThk); //gradient가 0인 경우, inf에 대한 예외처리 필요309 lflange[1] = GenGirderRestPoint(newbr1, newbr2, null, null, -ps.lFlangeThk);310 } else {311 lflange[2] = GenGirderRestPoint(newbl1, newbr1, null, null, -ps.lFlangeThk);312 }313 //topPlate314 // let tan = gradient === 0 ? null : -1 / gradient;315 let rad = Math.atan(gradient);316 let cos = Math.cos(rad);317 let sin = Math.sin(rad);318 let uflange = [[], [], []];319 let newtl1 = { x: lw2.x - ps.uFlangeC, y: lw2.y + gradient * -ps.uFlangeC };320 let newtl2 = {321 x: lw2.x - ps.uFlangeC + ps.uFlangeW,322 y: lw2.y + gradient * (-ps.uFlangeC + ps.uFlangeW),323 };324 let newtr1 = { x: rw2.x + ps.uFlangeC, y: rw2.y + gradient * ps.uFlangeC };325 let newtr2 = {326 x: rw2.x + ps.uFlangeC - ps.uFlangeW,327 y: rw2.y + gradient * (ps.uFlangeC - ps.uFlangeW),328 };329 if (newtl2.x < newtr2.x) {330 //양측의 플렌지가 서로 중첩될 경우331 uflange[0] = [332 newtl1,333 newtl2,334 { x: newtl2.x - sin * ps.uFlangeThk, y: newtl2.y + cos * ps.uFlangeThk },335 { x: newtl1.x - sin * ps.uFlangeThk, y: newtl1.y + cos * ps.uFlangeThk },336 ];337 uflange[1] = [338 newtr1,339 newtr2,340 { x: newtr2.x - sin * ps.uFlangeThk, y: newtr2.y + cos * ps.uFlangeThk },341 { x: newtr1.x - sin * ps.uFlangeThk, y: newtr1.y + cos * ps.uFlangeThk },342 ];343 } else {344 uflange[2] = [345 newtl1,346 newtr1,347 { x: newtr1.x - sin * ps.uFlangeThk, y: newtr1.y + cos * ps.uFlangeThk },348 { x: newtl1.x - sin * ps.uFlangeThk, y: newtl1.y + cos * ps.uFlangeThk },349 ];350 }351 let uflangeSide = [-topY, -topY + ps.uFlangeThk];352 let lflangeSide = [-bottomY, -bottomY - ps.lFlangeThk];353 let webSide = [-bottomY, -topY];354 // 하부콘크리트는 항상 있는게 아니기 때문에 다른 부재와는 구분이 되어야 할듯함. 21.01.18 by drlim355 let lConc = [];356 let lConcSide = [];357 if (ps.lConcThk > 0) {358 lConc.push(359 GenWebPoint(lwb, lwt, 0, -bottomY),360 GenWebPoint(lwb, lwt, 0, -bottomY + ps.lConcThk),361 GenWebPoint(rwb, rwt, 0, -bottomY + ps.lConcThk),362 GenWebPoint(rwb, rwt, 0, -bottomY)363 );364 lConcSide.push(-bottomY, -bottomY + ps.lConcThk);365 }366 baseInput = {367 isDoubleComposite: false, // 추후 PointSectionInfo에 관련 변수 추가368 isClosedTop: newtl2.x < newtr2.x ? false : true, //상부플랜지 분리여부, 비분리시 참369 isSeparated: newbl2.x < newbr2.x ? true : false, //하부플랜지 분리여부, 분리시 참370 B1: rw1.x - lw1.x, //강거더 하부 내부폭371 B2: rw2.x - lw2.x, //강거더 상부 내부폭372 B3: 3500, //바닥판 콘크리트 폭 //슬래브에 대한 정보는 외부에서 받아와야 함373 wlw: TwoPointsLength(lw1, lw2), //좌측웹 폭374 wrw: TwoPointsLength(rw1, rw2), //우측웹 폭375 wuf: newtl2.x < newtr2.x ? Math.min(ps.uFlangeW, ps.uFlangeC * 2 - ps.webThk) : newtr1.x - newtl1.x, //상부플랜지 폭376 wlf: newbl2.x < newbr2.x ? Math.min(ps.lFlangeW, ps.lFlangeC * 2 - ps.webThk) : newbr1.x - newbl1.x, //하부플랜지377 gradient: gradient, //상부플랜지 기울기378 gradientlf: ps.lFlangeGradient,379 H: bottomY - topY, //강거더 높이380 tlf: ps.lFlangeThk, //하부플랜지 두께381 tuf: ps.uFlangeThk, //상부플랜지두께382 tw: ps.webThk, //웹두께383 Tcu: ps.slabThickness, //바닥판콘크리트 두께384 Th: ps.haunchH, //헌치두께385 Tcl: ps.lConcThk, //지점콘크리트 두께 //지점콘크리트에 대한 입력 변수 추가386 blf: ps.lFlangeC, //하부플랜지 외부폭387 buf: ps.uFlangeC, //상부플랜지 외부폭388 Urib: { thickness: ps.uRibThk, height: ps.uRibH, layout: ps.uRibLO },389 Lrib: { thickness: ps.lRibThk, height: ps.lRibH, layout: ps.lRibLO },390 horizontal_bracing: { d0: 2500, vbArea: 50, dbArea: 50 }, //수직보강재 간격, 수평브레이싱 수직, 사재 단면적391 };392 if (i === 0) {393 forward = {394 input: baseInput,395 skew,396 LRib,397 URib,398 uflange,399 lflange,400 web: [lWeb, rWeb],401 uflangeSide,402 lflangeSide,403 webSide,404 lConc,405 lConcSide,406 };407 } else {408 backward = {409 input: baseInput,410 skew,411 LRib,412 URib,413 uflange,414 lflange,415 web: [lWeb, rWeb],416 uflangeSide,417 lflangeSide,418 webSide,419 lConc,420 lConcSide,421 };422 }423 }424 result[k] = { forward, backward };425 }426 }427 return result;428}429export function GenDefaultETCPartDataFn(girderStation, sectionPointDict) {430 let jackupLayout = GenDefaultJackup(girderStation, sectionPointDict);431 let studLayout = GenDefaultStud(girderStation, sectionPointDict);432 let supportLayout = GenDefaultSupport(girderStation, sectionPointDict);433 let hStiffLayout = GenDefaultHStiffner(girderStation, sectionPointDict);434 return { jackupLayout, studLayout, supportLayout, hStiffLayout };435}436function GenSupportSectionDrawing(deckPointDicts, sectionPoints, properties) {437 let result = [];438 const fontSize = 14;439 const layer = "DIM";440 let paperScale = properties ? properties.scale : 1;441 let ps = paperSize[properties.size];442 let xList = [];443 for (let k in deckPointDicts[0].points) {444 xList.push(deckPointDicts[0].points[k].x);445 }446 let pxOffset = ps.x * paperScale;447 let pyOffset = ps.y * paperScale;448 let girderNum = sectionPoints[0].length; //girderStation.length449 let spanNum = deckPointDicts.length; //deck.length450 //451 let slabWidth = Math.max(...xList) - Math.min(...xList);452 let mx = Math.floor(pxOffset / (slabWidth + 4000));453 let my = 2;454 let drawIndex = Math.ceil(spanNum / mx / my);455 for (let j = 0; j < spanNum; j++) {456 let section = { draw: [], dim: [], tag: [] };457 let webDim = [];458 let heightDim = [];459 for (let i = 0; i < girderNum; i++) {460 let girderPoint = sectionPoints[j][i]["point"];461 let deltaZ = girderPoint.z - deckPointDicts[j].mp.z;462 let offset = girderPoint.offset;463 let sectionPoint = sectionPoints[j][i];464 for (let key in sectionPoint) {465 if (key === "uflange" || key === "lflange" || key === "web" || key === "URib" || key === "LRib") {466 for (let k in sectionPoint[key]) {467 if (sectionPoint[key][k].length > 0) {468 let pts = [];469 sectionPoint[key][k].forEach(pt => pts.push({ x: pt.x + offset, y: pt.y + deltaZ }));470 section["draw"].push(new Line(pts, "CYAN", true, null, { name: "Support", part: key }));471 if (key === "web") {472 webDim.push(pts[1]);473 heightDim = [pts[0], pts[1]];474 section["dim"].push(475 ToDimAlign(heightDim, fontSize, layer, false, false, 0, 0, 1, {476 name: "Support",477 part: "dimension",478 })479 );480 // 각 거더별 형고를 표현해야 하는데, 웹의 높이 출력481 }482 }483 }484 }485 }486 }487 let xOffset = ((j % mx) + 0.5) * (pxOffset / mx) + Math.floor(j / mx / my) * pxOffset;488 let yOffset = 0.7 * pyOffset - 1 * (Math.floor(j / mx) % my) * 0.4 * pyOffset;489 let deckPt = deckPointDicts[j].points; //[];490 let dimIndex = deckPt[1].y > deckPt[3].y ? true : false;491 section["draw"].push(new Line(deckPt, "GREEN", true, null, { name: "Support", part: "deck" }));492 section["dim"].push(493 ToDimAlign([deckPt[1], ...webDim, deckPt[3]], 0, "DIM", true, true, 0, dimIndex ? 0 : webDim.length + 1, 1, {494 name: "Support",495 part: "dimension",496 }),497 ToDimAlign([deckPt[1], deckPt[2], deckPt[3]], 0, "DIM", true, true, 0, dimIndex ? 0 : 2, 2, {498 name: "Support",499 part: "dimension",500 }),501 ToDimAlign([deckPt[1], deckPt[3]], 0, "DIM", true, true, 0, dimIndex ? 0 : 1, 3, {502 name: "Support",503 part: "dimension",504 }),505 ToDimAlign([deckPt[0], deckPt[1]], 0, "DIM", false, true, 0, 0, 1, {506 name: "Support",507 part: "dimension",508 })509 );510 result.push(511 ...Layout2D(section["draw"], section["dim"], [], xOffset, yOffset, paperScale, 1, "횡단면도 - S" + (j + 1).toFixed(), "", 20, 0, false)512 );513 let multiPlot = [{ yOffset: 0, num: drawIndex, title: "교량단면 요약도" }];514 result.push(...Plot2D(properties, multiPlot));515 }516 return result;517}518function GenEndSideDrawing(seShape, endSection, properties) {519 let result = [];520 let paperScale = properties ? properties.scale : 1;521 let ps = paperSize[properties.size];522 let pxOffset = ps.x * paperScale;523 let pyOffset = ps.y * paperScale;524 let xOffset = pxOffset * 0.5;525 let yOffset = -1 * pyOffset * 0.3;526 for (let k = 0; k < 2; k++) {527 let side = { draw: [], dim: [], tag: [] };528 let shape = k === 0 ? seShape.start : seShape.end;529 let sn = k === 0 ? 1 : -1;530 let Xi = k === 0 ? 0 : shape.A + shape.D + shape.F + shape.G + 2000;531 let title = k === 0 ? "시점부-측면도" : "종점부-측면도";532 let sAbut = [533 { x: Xi + sn * -200, y: 0 },534 { x: Xi, y: 0 },535 { x: Xi, y: -shape.endSlabH - endSection.H + endSection.CutH },536 ];537 let sDeck = [538 //헌치두께까지 더해야할듯함.539 { x: Xi + sn * (shape.A + shape.D + shape.F + shape.G + 2000), y: -shape.slabH },540 { x: Xi + sn * (shape.A + shape.D + shape.F + shape.G), y: -shape.slabH },541 { x: Xi + sn * (shape.A + shape.D + shape.F), y: -shape.endSlabH },542 { x: Xi + sn * (shape.A + shape.D), y: -shape.endSlabH },543 { x: Xi + sn * shape.A, y: -shape.endSlabH },544 { x: Xi + sn * shape.A, y: 0 },545 { x: Xi + sn * (shape.A + shape.D), y: 0 },546 { x: Xi + sn * (shape.A + shape.D + shape.F), y: 0 },547 { x: Xi + sn * (shape.A + shape.D + shape.F + shape.G), y: 0 },548 { x: Xi + sn * (shape.A + shape.D + shape.F + shape.G + 2000), y: 0 },549 ];550 let sWeb = [551 { x: Xi + sn * (shape.A + shape.D), y: -shape.endSlabH },552 { x: Xi + sn * (shape.A + shape.D), y: -shape.endSlabH - endSection.H + endSection.CutH },553 { x: Xi + sn * (shape.A + shape.D + endSection.CutL), y: -shape.endSlabH - endSection.H + endSection.CutH },554 { x: Xi + sn * (shape.A + shape.D + endSection.CutL), y: -shape.endSlabH - endSection.H },555 { x: Xi + sn * (shape.A + shape.D + shape.F + shape.G + 2000), y: -shape.endSlabH - endSection.H },556 ];557 side["draw"].push(new Line(sDeck, "GREEN", false, null, { name: "End-Side", part: "deck" }));558 side["draw"].push(new Line(sAbut, "GREEN", false, null, { name: "End-Side", part: "abutment" }));559 let isClockwise = k === 0 ? true : false;560 side["draw"].push(561 new Line([sWeb[0], ...GetPointsWithBulge([sWeb[1], sWeb[2], sWeb[3]], 100, isClockwise), sWeb[4]], "CYAN", false, null, {562 name: "End-Side",563 part: "web",564 })565 );566 let isTop = k === 0 ? true : false;567 side["dim"].push(568 ToDimAlign([sAbut[1], sDeck[5], sDeck[6], sDeck[7], sDeck[8]], 0, "DIM", true, true, 0, 1, 1, {569 name: "End-Side",570 part: "dimension",571 }),572 ToDimAlign([sDeck[7], sDeck[2], sWeb[3]], 0, "DIM", false, isTop, 0, 0, 1, {573 name: "End-Side",574 part: "dimension",575 }),576 ToDimAlign([sDeck[8], sDeck[1], sWeb[3]], 0, "DIM", false, isTop, 0, 1, 1, {577 name: "End-Side",578 part: "dimension",579 })580 );581 result.push(...Layout2D(side["draw"], side["dim"], [], xOffset, yOffset - pyOffset * k * 0.3, paperScale, 2, title, "", 15, 0, true));582 }583 let multiPlot = [{ yOffset: -1 * pyOffset, num: 1, title: "시종점부 요약도" }];584 result.push(...Plot2D(properties, multiPlot));585 return result;586}587function GenDefaultMainPartData(girderLayout, basicSectionInfo, seShape) {588 let end = basicSectionInfo.end;589 let support = basicSectionInfo.support;590 let common = basicSectionInfo.common;591 let auto = basicSectionInfo.auto;592 let Height = GenDefaultGirderHeight(girderLayout, end, support, common, seShape);593 let flange = GenDefaultFlange(girderLayout, end, support, common, auto);594 let joint = GenDefaultFactoryJoint(girderLayout, common);595 let stiff = GenDefaultStiffPoint(girderLayout, end, support, auto, seShape);596 // slabLayout = [구간명, 슬래브두께, 켄틸레버슬래브두께, ]597 let slabLayout = [598 ["CRK0", end.SlabH, end.SlabEndH, -1 * common.SlabLeft, common.SlabRight, 0],599 ["CRK2", end.SlabH, end.SlabEndH, -1 * common.SlabLeft, common.SlabRight, 0],600 ["CRK3", support.SlabH, support.SlabEndH, -1 * common.SlabLeft, common.SlabRight, basicSectionInfo.support.HaunchH],601 ["CRK4", support.SlabH, support.SlabEndH, -1 * common.SlabLeft, common.SlabRight, basicSectionInfo.support.HaunchH],602 ["CRK5", end.SlabH, end.SlabEndH, -1 * common.SlabLeft, common.SlabRight, 0],603 ["CRK7", end.SlabH, end.SlabEndH, -1 * common.SlabLeft, common.SlabRight, 0],604 ];605 return {606 range: {607 H: Height.hLayout,608 TW: flange.ufwLayout,609 BW: flange.lfwLayout,610 TF: joint.TFLayout,611 BF: joint.BFLayout,612 WF: joint.WFLayout,613 TR: flange.uRib,614 BR: flange.lRib,615 LC: stiff.lConcLayout,616 },617 point: { D: stiff.diaLayout, V: stiff.vStiffLayout, SP: stiff.SpliceLayout },618 slabLayout,619 xbeamLayout: stiff.xbeamLayout,620 }; //종리브와 같은 불연속한 부재에 대한 내용 추가필요621}622function GenDefaultGirderHeight(girderLayout, endSection, supportSection, auto, SEShape) {623 let girderNum = girderLayout.girderCount;624 let supportNum = girderLayout.supportCount;625 let supportData = girderLayout.input.supports;626 let hLayout = [];627 let diaSpacing = auto.diaSpacing; //공통변수로부터 입력628 let c0 = 15000 * 2; //공통변수로부터 입력 auto.HeightTaperStart629 let c1 = 1250 * 2; //공통변수로부터 입력 auto.HeightTaperEnd630 let c2 = 0;631 for (let i = 0; i < girderNum; i++) {632 let hSub = [];633 for (let j = 1; j < supportNum - 1; j++) {634 let benchMarkName = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);635 if (j === 1) {636 if (endSection.CutL * endSection.CutH > 0) {637 c2 = endSection.CutL - (supportData[j][1] - SEShape.start.A + SEShape.start.D);638 hSub.push([benchMarkName, c2, endSection.H - endSection.CutH, endSection.H - endSection.CutH, "straight"]);639 }640 } else if (j > 1 && j < supportNum - 2) {641 hSub.push([benchMarkName, -c0, endSection.H, endSection.H, "straight"]);642 hSub.push([benchMarkName, -c1, endSection.H, supportSection.H, "circle"]);643 hSub.push([benchMarkName, c1, supportSection.H, supportSection.H, "straight"]);644 hSub.push([benchMarkName, c0, supportSection.H, endSection.H, "circle"]);645 } else if (j === supportNum - 2) {646 if (endSection.CutL * endSection.CutH > 0) {647 c2 = endSection.CutL - (supportData[j + 1][1] - SEShape.end.A + SEShape.end.D);648 hSub.push([benchMarkName, -c2, endSection.H, endSection.H, "straight"]);649 hSub.push(["end", 0, endSection.H - endSection.CutH, endSection.H - endSection.CutH, "straight"]);650 } else {651 hSub.push(["end", 0, endSection.H, endSection.H, "straight"]);652 }653 }654 }655 hLayout.push(hSub);656 }657 return { hLayout };658}659function GenDefaultFlange(girderLayout, endSection, supportSection, common, auto) {660 let girderNum = girderLayout.girderCount;661 let supportNum = girderLayout.supportCount;662 let webThickness = 12; //추후 외부에서 받아와야할듯함663 let RibHeight = 150;664 let bottomRibHeight = 220;665 let RibThickness = 14;666 let bottomRibThickness = 22;667 let diaSpacing = auto.diaSpacing; //공통변수668 let boxLength = diaSpacing * 2; //공통변수로부터669 let taperLength = diaSpacing / 2; //공통변수로부터670 let taperWidth = 800;671 let taperMargin = 250;672 let ufwLayout = [];673 let lfwLayout = [];674 let uRib = [];675 let lRib = [];676 for (let i = 0; i < girderNum; i++) {677 let ufSub = [];678 let lfSub = [];679 let uRibSub = [];680 let lRibSub = [];681 for (let j = 1; j < supportNum - 1; j++) {682 let benchMarkName = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);683 if (j === 1) {684 if (endSection.Box) {685 ufSub.push([686 benchMarkName,687 boxLength / 2,688 supportSection.UF,689 supportSection.UF,690 supportSection.UF / 2 - common.B / 2,691 supportSection.UF / 2 - common.B / 2,692 ]);693 lfSub.push([694 benchMarkName,695 boxLength / 2,696 supportSection.LF,697 supportSection.LF,698 supportSection.LF / 2 - common.B / 2,699 supportSection.LF / 2 - common.B / 2,700 ]);701 ufSub.push([702 benchMarkName,703 boxLength / 2 + taperMargin,704 supportSection.UF,705 supportSection.UF,706 endSection.UF / 2 - common.B / 2,707 endSection.UF / 2 - common.B / 2,708 ]);709 lfSub.push([710 benchMarkName,711 boxLength / 2 + taperMargin,712 supportSection.LF,713 supportSection.LF,714 endSection.LF / 2 - common.B / 2,715 endSection.LF / 2 - common.B / 2,716 ]);717 ufSub.push([718 benchMarkName,719 boxLength / 2 + taperLength,720 endSection.UF,721 endSection.UF,722 endSection.UF / 2 - common.B / 2,723 endSection.UF / 2 - common.B / 2,724 ]);725 lfSub.push([726 benchMarkName,727 boxLength / 2 + taperLength,728 endSection.LF,729 endSection.LF,730 endSection.LF / 2 - common.B / 2,731 endSection.LF / 2 - common.B / 2,732 ]);733 uRibSub.push([benchMarkName, +boxLength / 2 + taperMargin, RibThickness, RibHeight, "-400,400"]);734 lRibSub.push([benchMarkName, +boxLength / 2 + taperMargin, bottomRibThickness, bottomRibHeight, "-400,400"]);735 }736 } else if (j > 1 && j < supportNum - 2) {737 ufSub.push([738 benchMarkName,739 -boxLength - taperLength,740 endSection.UF,741 endSection.UF,742 endSection.UF / 2 - common.B / 2,743 endSection.UF / 2 - common.B / 2,744 ]);745 lfSub.push([746 benchMarkName,747 -boxLength - taperLength,748 endSection.LF,749 endSection.LF,750 endSection.LF / 2 - common.B / 2,751 endSection.LF / 2 - common.B / 2,752 ]);753 ufSub.push([754 benchMarkName,755 -boxLength - taperMargin,756 endSection.UF,757 endSection.UF,758 endSection.UF / 2 - common.B / 2,759 endSection.UF / 2 - common.B / 2,760 ]);761 lfSub.push([762 benchMarkName,763 -boxLength - taperMargin,764 endSection.LF,765 endSection.LF,766 endSection.LF / 2 - common.B / 2,767 endSection.LF / 2 - common.B / 2,768 ]);769 ufSub.push([770 benchMarkName,771 -boxLength,772 supportSection.UF,773 supportSection.UF,774 endSection.UF / 2 - common.B / 2,775 endSection.UF / 2 - common.B / 2,776 ]);777 lfSub.push([778 benchMarkName,779 -boxLength,780 supportSection.LF,781 supportSection.LF,782 endSection.LF / 2 - common.B / 2,783 endSection.LF / 2 - common.B / 2,784 ]);785 ufSub.push([786 benchMarkName,787 boxLength,788 supportSection.UF,789 supportSection.UF,790 supportSection.UF / 2 - common.B / 2,791 supportSection.UF / 2 - common.B / 2,792 ]);793 lfSub.push([794 benchMarkName,795 boxLength,796 supportSection.LF,797 supportSection.LF,798 supportSection.LF / 2 - common.B / 2,799 supportSection.LF / 2 - common.B / 2,800 ]);801 ufSub.push([802 benchMarkName,803 boxLength + taperMargin,804 supportSection.UF,805 supportSection.UF,806 endSection.UF / 2 - common.B / 2,807 endSection.UF / 2 - common.B / 2,808 ]);809 lfSub.push([810 benchMarkName,811 boxLength + taperMargin,812 supportSection.LF,813 supportSection.LF,814 endSection.UF / 2 - common.B / 2,815 endSection.LF / 2 - common.B / 2,816 ]);817 ufSub.push([818 benchMarkName,819 boxLength + taperLength,820 endSection.UF,821 endSection.UF,822 endSection.UF / 2 - common.B / 2,823 endSection.UF / 2 - common.B / 2,824 ]);825 lfSub.push([826 benchMarkName,827 boxLength + taperLength,828 endSection.LF,829 endSection.LF,830 endSection.LF / 2 - common.B / 2,831 endSection.LF / 2 - common.B / 2,832 ]);833 uRibSub.push([benchMarkName, -boxLength - taperMargin, 0, 0, ""]);834 uRibSub.push([benchMarkName, +boxLength + taperMargin, RibThickness, RibHeight, "-400,400"]);835 lRibSub.push([benchMarkName, -boxLength - taperMargin, 0, 0, ""]);836 lRibSub.push([benchMarkName, +boxLength + taperMargin, bottomRibThickness, bottomRibHeight, "-400,400"]);837 } else if (j === supportNum - 2) {838 if (endSection.Box) {839 ufSub.push([840 benchMarkName,841 -boxLength / 2 - taperLength,842 endSection.UF,843 endSection.UF,844 endSection.UF / 2 - common.B / 2,845 endSection.UF / 2 - common.B / 2,846 ]);847 lfSub.push([848 benchMarkName,849 -boxLength / 2 - taperLength,850 endSection.LF,851 endSection.LF,852 endSection.LF / 2 - common.B / 2,853 endSection.LF / 2 - common.B / 2,854 ]);855 ufSub.push([856 benchMarkName,857 -boxLength / 2 - taperMargin,858 endSection.UF,859 endSection.UF,860 endSection.UF / 2 - common.B / 2,861 endSection.UF / 2 - common.B / 2,862 ]);863 lfSub.push([864 benchMarkName,865 -boxLength / 2 - taperMargin,866 endSection.LF,867 endSection.LF,868 endSection.LF / 2 - common.B / 2,869 endSection.LF / 2 - common.B / 2,870 ]);871 ufSub.push([872 benchMarkName,873 -boxLength / 2,874 supportSection.UF,875 supportSection.UF,876 endSection.UF / 2 - common.B / 2,877 endSection.UF / 2 - common.B / 2,878 ]);879 lfSub.push([880 benchMarkName,881 -boxLength / 2,882 supportSection.LF,883 supportSection.LF,884 endSection.LF / 2 - common.B / 2,885 endSection.LF / 2 - common.B / 2,886 ]);887 ufSub.push([888 "end",889 0,890 supportSection.UF,891 supportSection.UF,892 supportSection.UF / 2 - common.B / 2,893 supportSection.UF / 2 - common.B / 2,894 ]);895 lfSub.push([896 "end",897 0,898 supportSection.LF,899 supportSection.LF,900 supportSection.LF / 2 - common.B / 2,901 supportSection.LF / 2 - common.B / 2,902 ]);903 uRibSub.push([benchMarkName, -boxLength / 2 - taperMargin, 0, 0, ""]);904 lRibSub.push([benchMarkName, -boxLength / 2 - taperMargin, 0, 0, ""]);905 uRibSub.push(["end", 0, RibThickness, RibHeight, "-400,400"]);906 lRibSub.push(["end", 0, bottomRibThickness, bottomRibHeight, "-400,400"]);907 } else {908 ufSub.push(["end", 0, endSection.UF, endSection.UF, endSection.UF / 2 + webThickness / 2, endSection.UF / 2 + webThickness / 2]);909 lfSub.push(["end", 0, endSection.LF, endSection.LF, endSection.LF / 2 + webThickness / 2, endSection.LF / 2 + webThickness / 2]);910 uRibSub.push(["end", 0, 0, 0, ""]);911 lRibSub.push(["end", 0, 0, 0, ""]);912 }913 }914 }915 ufwLayout.push(ufSub);916 lfwLayout.push(lfSub);917 uRib.push(uRibSub);918 lRib.push(lRibSub);919 }920 return { ufwLayout, lfwLayout, uRib, lRib };921}922// function GenDefaultFlange(girderLayout, endSection, supportSection, common, auto) {923// let girderNum = girderLayout.girderCount;924// let supportNum = girderLayout.supportCount;925// let webThickness = 12; //추후 외부에서 받아와야할듯함926// let RibHeight = 150;927// let bottomRibHeight = 220;928// let RibThickness = 14;929// let bottomRibThickness = 22;930// let diaSpacing = auto.diaSpacing; //공통변수931// let boxLength = diaSpacing * 2; //공통변수로부터932// let taperLength = diaSpacing / 2; //공통변수로부터933// let taperWidth = 800;934// let taperMargin = 250;935// let ufwLayout = [];936// let lfwLayout = [];937// let uRib = [];938// let lRib = [];939// for (let i = 0; i < girderNum; i++) {940// let ufSub = [];941// let lfSub = [];942// let uRibSub = [];943// let lRibSub = [];944// for (let j = 1; j < supportNum - 1; j++) {945// let benchMarkName = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);946// if (j === 1) {947// if (endSection.Box) {948// ufSub.push([949// benchMarkName,950// boxLength / 2,951// supportSection.UF,952// supportSection.UF,953// supportSection.UF / 2 - common.B / 2,954// supportSection.UF / 2 - common.B / 2,955// ]);956// lfSub.push([957// benchMarkName,958// boxLength / 2,959// supportSection.LF,960// supportSection.LF,961// supportSection.LF / 2 - common.B / 2,962// supportSection.LF / 2 - common.B / 2,963// ]);964// ufSub.push([965// benchMarkName,966// boxLength / 2 + taperMargin,967// supportSection.UF,968// supportSection.UF,969// endSection.UF / 2 + webThickness / 2,970// endSection.UF / 2 + webThickness / 2,971// ]);972// lfSub.push([973// benchMarkName,974// boxLength / 2 + taperMargin,975// supportSection.LF,976// supportSection.LF,977// endSection.UF / 2 + webThickness / 2,978// endSection.LF / 2 + webThickness / 2,979// ]);980// ufSub.push([981// benchMarkName,982// boxLength / 2 + taperLength,983// taperWidth,984// endSection.UF,985// endSection.UF / 2 + webThickness / 2,986// endSection.UF / 2 + webThickness / 2,987// ]);988// lfSub.push([989// benchMarkName,990// boxLength / 2 + taperLength,991// taperWidth,992// endSection.LF,993// endSection.LF / 2 + webThickness / 2,994// endSection.LF / 2 + webThickness / 2,995// ]);996// uRibSub.push([benchMarkName, +boxLength / 2 + taperMargin, RibThickness, RibHeight, "-400,400"]);997// lRibSub.push([benchMarkName, +boxLength / 2 + taperMargin, bottomRibThickness, bottomRibHeight, "-400,400"]);998// }999// } else if (j > 1 && j < supportNum - 2) {1000// ufSub.push([1001// benchMarkName,1002// -boxLength - taperLength,1003// endSection.UF,1004// endSection.UF,1005// endSection.UF / 2 + webThickness / 2,1006// endSection.UF / 2 + webThickness / 2,1007// ]);1008// lfSub.push([1009// benchMarkName,1010// -boxLength - taperLength,1011// endSection.LF,1012// endSection.LF,1013// endSection.LF / 2 + webThickness / 2,1014// endSection.LF / 2 + webThickness / 2,1015// ]);1016// ufSub.push([1017// benchMarkName,1018// -boxLength - taperMargin,1019// endSection.UF,1020// taperWidth,1021// endSection.UF / 2 + webThickness / 2,1022// endSection.UF / 2 + webThickness / 2,1023// ]);1024// lfSub.push([1025// benchMarkName,1026// -boxLength - taperMargin,1027// endSection.LF,1028// taperWidth,1029// endSection.LF / 2 + webThickness / 2,1030// endSection.LF / 2 + webThickness / 2,1031// ]);1032// ufSub.push([1033// benchMarkName,1034// -boxLength,1035// supportSection.UF,1036// supportSection.UF,1037// endSection.UF / 2 + webThickness / 2,1038// endSection.UF / 2 + webThickness / 2,1039// ]);1040// lfSub.push([1041// benchMarkName,1042// -boxLength,1043// supportSection.LF,1044// supportSection.LF,1045// endSection.LF / 2 + webThickness / 2,1046// endSection.LF / 2 + webThickness / 2,1047// ]);1048// ufSub.push([1049// benchMarkName,1050// boxLength,1051// supportSection.UF,1052// supportSection.UF,1053// supportSection.UF / 2 - common.B / 2,1054// supportSection.UF / 2 - common.B / 2,1055// ]);1056// lfSub.push([1057// benchMarkName,1058// boxLength,1059// supportSection.LF,1060// supportSection.LF,1061// supportSection.LF / 2 - common.B / 2,1062// supportSection.LF / 2 - common.B / 2,1063// ]);1064// ufSub.push([1065// benchMarkName,1066// boxLength + taperMargin,1067// supportSection.UF,1068// supportSection.UF,1069// endSection.UF / 2 + webThickness / 2,1070// endSection.UF / 2 + webThickness / 2,1071// ]);1072// lfSub.push([1073// benchMarkName,1074// boxLength + taperMargin,1075// supportSection.LF,1076// supportSection.LF,1077// endSection.UF / 2 + webThickness / 2,1078// endSection.LF / 2 + webThickness / 2,1079// ]);1080// ufSub.push([1081// benchMarkName,1082// boxLength + taperLength,1083// taperWidth,1084// endSection.UF,1085// endSection.UF / 2 + webThickness / 2,1086// endSection.UF / 2 + webThickness / 2,1087// ]);1088// lfSub.push([1089// benchMarkName,1090// boxLength + taperLength,1091// taperWidth,1092// endSection.LF,1093// endSection.LF / 2 + webThickness / 2,1094// endSection.LF / 2 + webThickness / 2,1095// ]);1096// uRibSub.push([benchMarkName, -boxLength - taperMargin, 0, 0, ""]);1097// uRibSub.push([benchMarkName, +boxLength + taperMargin, RibThickness, RibHeight, "-400,400"]);1098// lRibSub.push([benchMarkName, -boxLength - taperMargin, 0, 0, ""]);1099// lRibSub.push([benchMarkName, +boxLength + taperMargin, bottomRibThickness, bottomRibHeight, "-400,400"]);1100// } else if (j === supportNum - 2) {1101// if (endSection.Box) {1102// ufSub.push([1103// benchMarkName,1104// -boxLength / 2 - taperLength,1105// endSection.UF,1106// endSection.UF,1107// endSection.UF / 2 + webThickness / 2,1108// endSection.UF / 2 + webThickness / 2,1109// ]);1110// lfSub.push([1111// benchMarkName,1112// -boxLength / 2 - taperLength,1113// endSection.LF,1114// endSection.LF,1115// endSection.LF / 2 + webThickness / 2,1116// endSection.LF / 2 + webThickness / 2,1117// ]);1118// ufSub.push([1119// benchMarkName,1120// -boxLength / 2 - taperMargin,1121// endSection.UF,1122// taperWidth,1123// endSection.UF / 2 + webThickness / 2,1124// endSection.UF / 2 + webThickness / 2,1125// ]);1126// lfSub.push([1127// benchMarkName,1128// -boxLength / 2 - taperMargin,1129// endSection.LF,1130// taperWidth,1131// endSection.LF / 2 + webThickness / 2,1132// endSection.LF / 2 + webThickness / 2,1133// ]);1134// ufSub.push([1135// benchMarkName,1136// -boxLength / 2,1137// supportSection.UF,1138// supportSection.UF,1139// endSection.UF / 2 + webThickness / 2,1140// endSection.UF / 2 + webThickness / 2,1141// ]);1142// lfSub.push([1143// benchMarkName,1144// -boxLength / 2,1145// supportSection.LF,1146// supportSection.LF,1147// endSection.LF / 2 + webThickness / 2,1148// endSection.LF / 2 + webThickness / 2,1149// ]);1150// ufSub.push([1151// "end",1152// 0,1153// supportSection.UF,1154// supportSection.UF,1155// supportSection.UF / 2 - common.B / 2,1156// supportSection.UF / 2 - common.B / 2,1157// ]);1158// lfSub.push([1159// "end",1160// 0,1161// supportSection.LF,1162// supportSection.LF,1163// supportSection.LF / 2 - common.B / 2,1164// supportSection.LF / 2 - common.B / 2,1165// ]);1166// uRibSub.push([benchMarkName, -boxLength / 2 - taperMargin, 0, 0, ""]);1167// lRibSub.push([benchMarkName, -boxLength / 2 - taperMargin, 0, 0, ""]);1168// uRibSub.push(["end", 0, RibThickness, RibHeight, "-400,400"]);1169// lRibSub.push(["end", 0, bottomRibThickness, bottomRibHeight, "-400,400"]);1170// } else {1171// ufSub.push(["end", 0, endSection.UF, endSection.UF, endSection.UF / 2 + webThickness / 2, endSection.UF / 2 + webThickness / 2]);1172// lfSub.push(["end", 0, endSection.LF, endSection.LF, endSection.LF / 2 + webThickness / 2, endSection.LF / 2 + webThickness / 2]);1173// uRibSub.push(["end", 0, 0, 0, ""]);1174// lRibSub.push(["end", 0, 0, 0, ""]);1175// }1176// }1177// }1178// ufwLayout.push(ufSub);1179// lfwLayout.push(lfSub);1180// uRib.push(uRibSub);1181// lRib.push(lRibSub);1182// }1183// return { ufwLayout, lfwLayout, uRib, lRib };1184// }1185function GenDefaultFactoryJoint(girderLayout, common) {1186 let girderNum = girderLayout.girderCount;1187 let supportNum = girderLayout.supportCount;1188 let diaSpacing = 5000; //공통변수1189 let TFLayout = [];1190 let BFLayout = [];1191 let WFLayout = [];1192 let thickness1 = 16;1193 let thickness2 = 20;1194 let thickness3 = 22;1195 for (let i = 0; i < girderNum; i++) {1196 let TFSub = [];1197 let BFSub = [];1198 let WFSub = [];1199 for (let j = 1; j < supportNum - 1; j++) {1200 let benchMarkName = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);1201 if (j === 1) {1202 } else if (j > 1 && j < supportNum - 2) {1203 TFSub.push([benchMarkName, -1.75 * diaSpacing, thickness1]);1204 BFSub.push([benchMarkName, -1.25 * diaSpacing, thickness2]);1205 WFSub.push([benchMarkName, -2.25 * diaSpacing, thickness1]);1206 TFSub.push([benchMarkName, 1.75 * diaSpacing, thickness2]);1207 BFSub.push([benchMarkName, 1.25 * diaSpacing, thickness3]);1208 WFSub.push([benchMarkName, 2.25 * diaSpacing, thickness2]);1209 } else if (j === supportNum - 2) {1210 TFSub.push(["end", 0, thickness1]);1211 BFSub.push(["end", 0, thickness2]);1212 WFSub.push(["end", 0, thickness1]);1213 }1214 }1215 TFLayout.push(TFSub);1216 BFLayout.push(BFSub);1217 WFLayout.push(WFSub);1218 }1219 return { TFLayout, BFLayout, WFLayout };1220}1221function GenDefaultStiffPoint(girderLayout, end, support, auto, SEShape) {1222 let girderNum = girderLayout.girderCount;1223 let supportNum = girderLayout.supportCount;1224 let diaSpacing = auto.diaSpacing; //공통변수1225 let segMaxLength = auto.segMaxLength;1226 let lConcThickness = support.LCONC;1227 // let endSpliceSegMax = 9000;1228 // let centerSpliceSegMax = 12000;1229 // let supportSpliceSegMax = 10000;1230 let diaLayout = [];1231 let vStiffLayout = [];1232 let SpliceLayout = [];1233 let lConcLayout = [];1234 let gridPointDict = GenDefaultGridPointDict(girderLayout, SEShape);1235 for (let i = 0; i < girderNum; i++) {1236 let diaSub = [];1237 let vStiffSub = [];1238 let spliceSub = [];1239 let lConcSub = [];1240 let skew1 = Math.PI / 2;1241 let skew2 = Math.PI / 2;1242 for (let j = 1; j < supportNum - 2; j++) {1243 let benchMarkName = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);1244 let ptName1 = "G" + (i + 1).toFixed(0) + "S" + j.toFixed(0);1245 let ptName2 = "G" + (i + 1).toFixed(0) + "S" + (j + 1).toFixed(0);1246 let point1 = gridPointDict[ptName1];1247 let point2 = gridPointDict[ptName2];1248 skew1 = point1.skew;1249 skew2 = point2.skew;1250 let sLength = point2.mainStation - point1.mainStation;1251 let diaNum = Math.floor(sLength / diaSpacing);1252 let remain = sLength % diaSpacing;1253 let diaList = [];1254 let vStiffList = [];1255 let spList = [];1256 let sp = 0;1257 let totalSp = 0;1258 let a = 0;1259 let n = 2; //항상 짝수이어야함1260 if (j === 1) {1261 while (totalSp < sLength) {1262 diaList.push(totalSp);1263 if (a < n && remain > 0) {1264 sp = (remain + (n - 1) * diaSpacing) / n;1265 } else {1266 sp = diaSpacing;1267 }1268 vStiffList.push(totalSp + sp / 2);1269 spList.push(totalSp + sp / 4, totalSp + (sp * 3) / 4);1270 totalSp += sp;1271 a++;1272 if (a > 100) {1273 break;1274 }1275 }1276 } else if (j > 1 && j < supportNum - 3) {1277 while (totalSp < sLength) {1278 diaList.push(totalSp);1279 if (diaNum % 2 === 0) {1280 //짝수분할1281 if (a >= (diaNum - n) / 2 && a <= (diaNum + n) / 2 && remain > 0) {1282 sp = (remain + n * diaSpacing) / (n + 1);1283 } else {1284 sp = diaSpacing;1285 }1286 } else {1287 // 홀수분할1288 if (a >= (diaNum - n) / 2 && a <= (diaNum + n) / 2 && remain > 0) {1289 sp = (remain + (n - 1) * diaSpacing) / n;1290 } else {1291 sp = diaSpacing;1292 }1293 }1294 vStiffList.push(totalSp + sp / 2);1295 spList.push(totalSp + sp / 4, totalSp + (sp * 3) / 4);1296 totalSp += sp;1297 a++;1298 if (a > 100) {1299 break;1300 }1301 }1302 } else if (j === supportNum - 3) {1303 while (totalSp < sLength) {1304 diaList.push(totalSp);1305 if (a > diaNum - 2 && remain > 0) {1306 sp = (remain + (n - 1) * diaSpacing) / n;1307 } else {1308 sp = diaSpacing;1309 }1310 vStiffList.push(totalSp + sp / 2);1311 spList.push(totalSp + sp / 4, totalSp + (sp * 3) / 4);1312 totalSp += sp;1313 a++;1314 if (a > 100) {1315 break;1316 }1317 }1318 }1319 let spNum = 0;1320 let sIndex = 0;1321 let eIndex = 0;1322 if (j === 1) {1323 sIndex = 3;1324 eIndex = 2;1325 } else if (j > 1 && j < supportNum - 3) {1326 sIndex = 1;1327 eIndex = 2;1328 } else if (j === supportNum - 3) {1329 sIndex = 1;1330 eIndex = 4;1331 }1332 spNum = spList.length - sIndex - eIndex;1333 if (j === 1) {1334 for (let d = 0; d < diaList.length; d++) {1335 if (d === 0 || d === diaList.length - 1) {1336 let skew = ((d === 0 ? skew1 : skew2) * 180) / Math.PI;1337 diaSub.push([benchMarkName, diaList[d], "박스부-지점", skew]);1338 } else {1339 diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1340 }1341 // if (d === 0 || d === 1) {1342 // if (end.Box) {1343 // if (d === 0) {1344 // diaSub.push([benchMarkName, diaList[d], "박스부-지점", skew1]);1345 // } else {1346 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1347 // }1348 // } else {1349 // diaSub.push([benchMarkName, diaList[d], "플레이트-상-볼트", 90]);1350 // }1351 // } else if (d === 2) {1352 // if (end.Box) {1353 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1354 // } else {1355 // diaSub.push([benchMarkName, diaList[d], "플레이트-중-볼트", 90]);1356 // }1357 // } else if (d > 2 && d < diaList.length - 3) {1358 // if (end.Box && d === 3) {1359 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1360 // } else {1361 // diaSub.push([benchMarkName, diaList[d], "플레이트-중", 90]);1362 // }1363 // } else if (d === diaList.length - 3) {1364 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1365 // } else if (d === diaList.length - 2 || d === diaList.length - 1) {1366 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1367 // } else {1368 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1369 // }1370 }1371 for (let v = 0; v < vStiffList.length; v++) {1372 if (v < 2) {1373 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1374 } else if (v < diaList.length - 2) {1375 vStiffSub.push([benchMarkName, vStiffList[v], "수직보강2"]);1376 } else {1377 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1378 }1379 // if (v < 2) {1380 // if (end.Box) {1381 // vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1382 // } else {1383 // vStiffSub.push([benchMarkName, vStiffList[v], "수직보강1"]);1384 // }1385 // } else if (v < diaList.length - 2) {1386 // vStiffSub.push([benchMarkName, vStiffList[v], "수직보강2"]);1387 // } else {1388 // vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1389 // }1390 }1391 } else if (j > 1 && j < supportNum - 3) {1392 for (let d = 0; d < diaList.length; d++) {1393 if (d === 0) {1394 diaSub.push([benchMarkName, diaList[d], "박스부-지점", 90]);1395 } else {1396 diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1397 }1398 // else if (d === 1 || d === 2) {1399 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1400 // } else if (d === 3) {1401 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1402 // } else if (d > 3 && d < diaList.length - 3) {1403 // diaSub.push([benchMarkName, diaList[d], "플레이트-중", 90]);1404 // } else if (d === diaList.length - 3) {1405 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1406 // } else if (d === diaList.length - 2 || d === diaList.length - 1) {1407 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1408 // }1409 }1410 for (let v = 0; v < vStiffList.length; v++) {1411 if (v < 2) {1412 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1413 } else if (v < diaList.length - 2) {1414 vStiffSub.push([benchMarkName, vStiffList[v], "수직보강2"]);1415 } else {1416 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1417 }1418 }1419 } else if (j === supportNum - 3) {1420 for (let d = 0; d < diaList.length; d++) {1421 if (d === 0 || d === diaList.length - 1) {1422 diaSub.push([benchMarkName, diaList[d], "박스부-지점", 90]);1423 } else {1424 diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1425 }1426 // if (d === 0) {1427 // diaSub.push([benchMarkName, diaList[d], "박스부-지점", 90]);1428 // } else if (d === 1 || d === 2) {1429 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1430 // } else if (d === 3) {1431 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1432 // } else if (d > 3 && d < diaList.length - 3) {1433 // diaSub.push([benchMarkName, diaList[d], "플레이트-중", 90]);1434 // } else if (d === diaList.length - 3) {1435 // if (end.Box) {1436 // diaSub.push([benchMarkName, diaList[d], "플레이트-하", 90]);1437 // } else {1438 // diaSub.push([benchMarkName, diaList[d], "플레이트-중-볼트", 90]);1439 // }1440 // } else if (d === diaList.length - 2 || d === diaList.length - 1) {1441 // if (end.Box) {1442 // diaSub.push([benchMarkName, diaList[d], "박스부-중앙홀", 90]);1443 // } else {1444 // diaSub.push([benchMarkName, diaList[d], "플레이트-상-볼트", 90]);1445 // }1446 // }1447 }1448 for (let v = 0; v < vStiffList.length; v++) {1449 if (v < 2) {1450 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1451 } else if (v < diaList.length - 2) {1452 vStiffSub.push([benchMarkName, vStiffList[v], "수직보강2"]);1453 } else {1454 vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1455 }1456 // if (v < 2) {1457 // vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1458 // } else if (v < diaList.length - 2) {1459 // vStiffSub.push([benchMarkName, vStiffList[v], "수직보강2"]);1460 // } else {1461 // if (end.Box) {1462 // vStiffSub.push([benchMarkName, vStiffList[v], "박스부-수직보강"]);1463 // } else {1464 // vStiffSub.push([benchMarkName, vStiffList[v], "수직보강1"]);1465 // }1466 // }1467 }1468 }1469 spNum = spNum > 30 ? 30 : spNum;1470 let spRull2 = [];1471 let firstMaxLength = 0;1472 let lastMaxLength = 0;1473 if (j === 1 && j === supportNum - 3) {1474 //단경간의 경우1475 firstMaxLength = segMaxLength;1476 lastMaxLength = segMaxLength;1477 } else {1478 if (j === 1) {1479 // 첫경간1480 firstMaxLength = segMaxLength;1481 lastMaxLength = segMaxLength / 2;1482 } else if (j === supportNum - 3) {1483 //마지막경간1484 firstMaxLength = segMaxLength / 2;1485 lastMaxLength = segMaxLength;1486 } else {1487 firstMaxLength = segMaxLength / 2;1488 lastMaxLength = segMaxLength / 2;1489 }1490 }1491 spRull2 = optimizeSplice(spList, totalSp, segMaxLength, firstMaxLength, lastMaxLength);1492 spRull2.forEach(elem => spliceSub.push([benchMarkName, Math.round(spList[elem]), "현장이음1"]));1493 if (end.Box) {1494 if (j === 1) {1495 lConcSub.push([benchMarkName, "G" + (i + 1).toFixed(0) + "D" + "2", lConcThickness, lConcThickness]);1496 }1497 if (j < supportNum - 3 && supportNum > 4) {1498 lConcSub.push([1499 "G" + (i + 1).toFixed(0) + "D" + String(diaSub.length - 1),1500 "G" + (i + 1).toFixed(0) + "D" + String(diaSub.length + 3),1501 lConcThickness,1502 lConcThickness,1503 ]);1504 }1505 if (j === supportNum - 3) {1506 lConcSub.push([1507 "G" + (i + 1).toFixed(0) + "D" + String(diaSub.length),1508 "G" + (i + 1).toFixed(0) + "S" + (supportNum - 2).toFixed(0),1509 lConcThickness,1510 lConcThickness,1511 ]);1512 }1513 } else {1514 if (j < supportNum - 3) {1515 lConcSub.push([1516 benchMarkName,1517 "G" + (i + 1).toFixed(0) + "D" + String(diaSub.length - 1),1518 benchMarkName,1519 "G" + (i + 1).toFixed(0) + "D" + String(diaSub.length + 2),1520 lConcThickness,1521 lConcThickness,1522 ]);1523 }1524 }1525 }1526 diaSub.push(["G" + (i + 1).toFixed(0) + "S" + (supportNum - 2).toFixed(0), 0, "박스부-지점", (skew2 * 180) / Math.PI]);1527 // if (end.Box) {1528 // diaSub.push(["G" + (i + 1).toFixed(0) + "S" + (supportNum - 2).toFixed(0), 0, "박스부-지점", skew2]);1529 // } else {1530 // diaSub.push(["G" + (i + 1).toFixed(0) + "S" + (supportNum - 2).toFixed(0), 0, "플레이트-상-볼트", skew2]);1531 // }1532 diaLayout.push(diaSub);1533 vStiffLayout.push(vStiffSub);1534 SpliceLayout.push(spliceSub);1535 lConcLayout.push(lConcSub);1536 }1537 let diaToXbeam = {1538 "플레이트-하": "플레이트-하",1539 "플레이트-중": "플레이트-중",1540 "플레이트-중-볼트": "플레이트-중",1541 "플레이트-상-볼트": "플레이트-상",1542 "박스부-중앙홀": "박스부",1543 "박스부-지점": "박스부",1544 };1545 let xbeamLayout = [];1546 let supportIndex = [];1547 for (let i = 0; i < diaLayout.length; i++) {1548 supportIndex.push([]);1549 for (let j = 0; j < diaLayout[i].length; j++) {1550 if (diaLayout[i][j][1] === 0) {1551 supportIndex[i].push(j);1552 }1553 }1554 }1555 for (let i = 0; i < supportIndex.length - 1; i++) {1556 for (let j = 0; j < supportIndex[i].length; j++) {1557 xbeamLayout.push([1558 "G" + (i + 1).toString() + "D" + (supportIndex[i][j] + 1).toString(),1559 "G" + (i + 2).toString() + "D" + (supportIndex[i + 1][j] + 1).toString(),1560 diaToXbeam[diaLayout[i][supportIndex[i][j]][2]],1561 ]);1562 if (j < supportIndex[i].length - 1) {1563 let li = supportIndex[i][j + 1];1564 let ri = supportIndex[i + 1][j + 1];1565 let iter = Math.min(li - supportIndex[i][j], ri - supportIndex[i + 1][j]);1566 if (j === supportIndex[i].length - 2) {1567 for (let x = 1; x < iter; x++) {1568 xbeamLayout.push([1569 "G" + (i + 1).toString() + "D" + (supportIndex[i][j] + x + 1).toString(),1570 "G" + (i + 2).toString() + "D" + (supportIndex[i + 1][j] + x + 1).toString(),1571 diaToXbeam[diaLayout[i][supportIndex[i][j] + x][2]],1572 ]);1573 }1574 } else {1575 for (let x = iter - 1; x > 0; x--) {1576 xbeamLayout.push([1577 "G" + (i + 1).toString() + "D" + (li - x + 1).toString(),1578 "G" + (i + 2).toString() + "D" + (ri - x + 1).toString(),1579 diaToXbeam[diaLayout[i][li - x][2]],1580 ]);1581 }1582 }1583 }1584 }1585 }1586 return { diaLayout, vStiffLayout, SpliceLayout, xbeamLayout, lConcLayout };1587}1588function optimizeSplice(spList, totalSp, segMaxLength, firstMaxLength, lastMaxLength) {1589 let firstIndex = 0;1590 let lastIndex = 0;1591 for (let sp = 0; sp < spList.length; sp++) {1592 if (spList[sp] <= firstMaxLength) {1593 firstIndex = sp;1594 }1595 if (totalSp - spList[spList.length - 1 - sp] <= lastMaxLength) {1596 lastIndex = spList.length - 1 - sp;1597 }1598 }1599 let m = Math.ceil((spList[lastIndex] - spList[firstIndex]) / segMaxLength);1600 let k = (spList[lastIndex] - spList[firstIndex]) / m;1601 let optIndex = [firstIndex];1602 let dummy1 = spList[firstIndex];1603 let newSp = firstIndex;1604 for (let ii = 0; ii < m - 1; ii++) {1605 let optLength = Infinity;1606 dummy1 = spList[newSp];1607 let startIndex = newSp;1608 for (let sp = startIndex + 1; sp < lastIndex; sp++) {1609 if (Math.abs(spList[sp] - dummy1 - k) < optLength) {1610 optLength = Math.abs(spList[sp] - dummy1 - k);1611 newSp = sp;1612 }1613 }1614 optIndex.push(newSp);1615 }1616 optIndex.push(lastIndex);1617 return optIndex;1618}1619function GenWebPoint(point1, point2, tan1, H) {1620 let x;1621 let y;1622 if (point1.x === point2.x) {1623 x = point1.x;1624 y = tan1 === null ? null : tan1 * x + H;1625 } else {1626 let a = (point1.y - point2.y) / (point1.x - point2.x);1627 let b = point1.y - a * point1.x;1628 x = tan1 === null ? point1.x : (b - H) / (tan1 - a);1629 y = a * x + b;1630 }1631 return { x, y };1632}1633function GenGirderRestPoint(point1, point2, tan1, tan2, thickness) {1634 let x3;1635 let x4;1636 let y3;1637 let y4;1638 if (point1.x === point2.x) {1639 x3 = point1.x + thickness;1640 x4 = point2.x + thickness;1641 y3 = tan1 === null ? point1.y : tan1 * (x3 - point1.x) + point1.y;1642 y4 = tan2 === null ? point2.y : tan2 * (x4 - point2.x) + point2.y;1643 } else {1644 let a = (point1.y - point2.y) / (point1.x - point2.x);1645 let b = point1.y - a * point1.x;1646 // let sign = a > 0 ? 1 : -1;1647 let alpha = a === 0 ? thickness : thickness * Math.sqrt(1 + 1 / a ** 2);1648 if (Math.abs(1 / tan1) < 0.001) {1649 x3 = point1.x;1650 } else {1651 if (a === 0) {1652 x3 = tan1 === null ? point1.x : point1.x + thickness / tan1;1653 } else {1654 x3 = tan1 === null ? point1.x : (-a * alpha + b + tan1 * point1.x - point1.y) / (tan1 - a);1655 }1656 }1657 if (Math.abs(1 / tan2) < 0.001) {1658 x4 = point2.x;1659 } else {1660 if (a === 0) {1661 x4 = tan2 === null ? point2.x : point2.x + thickness / tan2;1662 } else {1663 x4 = tan2 === null ? point2.x : (-a * alpha + b + tan2 * point2.x - point2.y) / (tan2 - a);1664 }1665 }1666 y3 = a === 0 ? point1.y + thickness : a * (x3 - alpha) + b;1667 y4 = a === 0 ? point2.y + thickness : a * (x4 - alpha) + b;1668 }1669 return [point1, point2, { x: x4, y: y4 }, { x: x3, y: y3 }];1670}1671function GenDefaultStud(girderStation, sectionPointDict) {1672 let result = [];1673 let spacing = 400;1674 for (let i = 0; i < girderStation.length; i++) {1675 let startKey = "G" + (i + 1).toFixed(0) + "K1";1676 let endKey = "";1677 let startOffset = 200;1678 let endOffset = 350;1679 for (let j in girderStation[i]) {1680 if (girderStation[i][j].key.includes("TW") || girderStation[i][j].key.includes("K6") || girderStation[i][j].key.includes("SP")) {1681 endKey = girderStation[i][j].key;1682 let w = sectionPointDict[endKey].backward.input.wuf;1683 let isSeparated = sectionPointDict[endKey].backward.input.isSeparated;1684 startOffset = startKey.includes("SP") ? 350 : 200;1685 endOffset = endKey.includes("SP") ? 350 : 200;1686 let layout = isSeparated ? "auto" : "auto"; //플랜지 중앙점을 기준으로 배치하는게 더 직관적일 듯함.1687 // result.push({ start: startKey, end: endKey, startOffset: startOffset, endOffset: endOffset, spacing: spacing, layout: layout })1688 result.push([startKey, endKey, startOffset, endOffset, spacing, layout]);1689 startKey = endKey;1690 }1691 }1692 }1693 return result;1694}1695function GenDefaultJackup(girderStation, sectionPointDict) {1696 let result = [];1697 let both = true;1698 let layout1 = "";1699 let layout2 = "";1700 let height = 0;1701 let thickness1 = 0;1702 let thickness2 = 0;1703 let length1 = 0;1704 let length2 = 0;1705 let supportNum = 0;1706 for (let j in girderStation[0]) {1707 if (girderStation[0][j].key.includes("S") && !girderStation[0][j].key.includes("SP")) {1708 supportNum += 1;1709 }1710 }1711 for (let i in girderStation) {1712 let key = "";1713 let isStart = true;1714 for (let j in girderStation[i]) {1715 if (girderStation[i][j].key.includes("S") && !girderStation[i][j].key.includes("SP")) {1716 key = girderStation[i][j].key;1717 let isSeparated = sectionPointDict[key].forward.input.isSeparated;1718 if (isSeparated) {1719 if (isStart) {1720 layout1 = "400,600";1721 isStart = false;1722 } else {1723 layout1 = "-400,-600";1724 }1725 layout2 = "-200,200";1726 height = 150;1727 thickness1 = 20;1728 thickness2 = 26;1729 length1 = 400;1730 length2 = 300;1731 // result.push({ position: key, layout: layout1, length: length1, height: height, thickness: thickness1, chamfer: height - 10, both: both })1732 // result.push({ position: key, layout: layout2, length: length2, height: height, thickness: thickness2, chamfer: height - 10, both: both })1733 result.push([key, layout1, length1, height, thickness1, height - 10, both]);1734 result.push([key, layout2, length2, height, thickness2, height - 10, both]);1735 } else {1736 if (key.includes("S1")) {1737 layout1 = "400,550,700";1738 } else if (key.includes("S" + supportNum.toFixed(0))) {1739 layout1 = "-700,-550,-400";1740 } else {1741 layout1 = "-700,-550,-400,400,550,700";1742 }1743 height = 100;1744 length1 = 900;1745 thickness1 = 22;1746 // result.push({ position: key, layout: layout1, length: length1, height: height, thickness: thickness1, chamfer: height - 10, both: both })1747 result.push([key, layout1, length1, height, thickness1, height - 10, both]);1748 }1749 }1750 }1751 }1752 return result;1753}1754function GenDefaultSupport(girderStation, sectionPointDict) {1755 let result = [];1756 let offset = 0;1757 let solePlate1 = [300, 300, 26]; //[폭,너비,높이]1758 let solePlate2 = [750, 750, 26]; //[폭,너비,높이]1759 let type1 = "";1760 let supportKeyList = [];1761 for (let i in girderStation) {1762 supportKeyList.push([]);1763 for (let j in girderStation[i]) {1764 if (girderStation[i][j].key.includes("S") && !girderStation[i][j].key.includes("SP")) {1765 supportKeyList[i].push(girderStation[i][j].key);1766 }1767 }1768 }1769 let supportNum = supportKeyList[0].length;1770 let key = "";1771 let girderNum = supportKeyList.length;1772 let fixedIndex = [Math.floor((girderNum - 1) / 2), Math.floor((supportNum - 1) / 2)];1773 for (let i = 0; i < supportKeyList.length; i++) {1774 for (let j = 0; j < supportNum; j++) {1775 key = supportKeyList[i][j];1776 let isSeparated = sectionPointDict[key].forward.input.isSeparated;1777 if (i === fixedIndex[0]) {1778 if (j === fixedIndex[1]) {1779 type1 = "고정단";1780 } else {1781 type1 = "종방향가동";1782 }1783 } else {1784 if (j === fixedIndex[1]) {1785 type1 = "횡방향가동";1786 } else {1787 type1 = "양방향단";1788 }1789 }1790 if (isSeparated) {1791 result.push([key + "L", type1, offset, solePlate1[0], solePlate1[1], solePlate1[2]]);1792 result.push([key + "R", type1, offset, solePlate1[0], solePlate1[1], solePlate1[2]]);1793 } else {1794 result.push([key, type1, offset, solePlate2[0], solePlate2[1], solePlate2[2]]);1795 }1796 }1797 }1798 return result;1799}1800function GenDefaultHStiffner(girderStation, sectionPointDict) {1801 let result = [];1802 let width = 180;1803 let chamfer = width - 10;1804 let thickness = 16;1805 let offset1 = 400;1806 let offset2 = 400;1807 let startMargin = 42;1808 let endMargin = 42;1809 let supportStationList = [];1810 for (let i in girderStation) {1811 supportStationList.push([]);1812 for (let j in girderStation[i]) {1813 if (girderStation[i][j].key.includes("S") && !girderStation[i][j].key.includes("SP")) {1814 supportStationList[i].push(girderStation[i][j].point.girderStation);1815 }1816 }1817 }1818 let tensionRegion = []; // 인장기준 0.2~0.81819 let compressRegion = []; // 압축기준 -0.4 ~ 0.41820 for (let i in supportStationList) {1821 tensionRegion.push([]);1822 compressRegion.push([]);1823 for (let j = 0; j < supportStationList[i].length - 1; j++) {1824 let length = supportStationList[i][j + 1] - supportStationList[i][j];1825 if (j === 0) {1826 tensionRegion[i].push([0, supportStationList[i][j + 1] - 0.2 * length]);1827 } else if (j === supportStationList[i].length - 2) {1828 tensionRegion[i].push([supportStationList[i][j] + 0.2 * length, supportStationList[i][j + 1]]);1829 } else {1830 tensionRegion[i].push([supportStationList[i][j] + 0.2 * length, supportStationList[i][j + 1] - 0.2 * length]);1831 }1832 if (j > 0) {1833 compressRegion[i].push([supportStationList[i][j] - 0.4 * length, supportStationList[i][j] + 0.4 * length]);1834 }1835 }1836 }1837 for (let i in girderStation) {1838 for (let j = 0; j < girderStation[i].length - 1; j++) {1839 let key1 = girderStation[i][j].key;1840 let bool1 = ["SP", "K1", "K6", "D", "V"].some(el => key1.includes(el));1841 if (bool1) {1842 let pt1 = girderStation[i][j].point;1843 for (let k = j + 1; k < girderStation[i].length; k++) {1844 let key2 = girderStation[i][k].key;1845 let pt2 = girderStation[i][k].point;1846 let bool2 = ["SP", "K1", "K6", "D", "V"].some(el => key2.includes(el));1847 if (pt2.girderStation - pt1.girderStation > width * 2 && bool2) {1848 let station = (pt2.girderStation + pt1.girderStation) / 2;1849 let startOff = key1.includes("SP") ? 600 / 2 + 30 : startMargin;1850 let endOff = key2.includes("SP") ? 600 / 2 + 30 : endMargin;1851 for (let t in tensionRegion[i]) {1852 if (station >= tensionRegion[i][t][0] && station <= tensionRegion[i][t][1]) {1853 // result.push({ from, to, startOffset: endOffset, width, thickness, chamfer, isTop, offset})1854 result.push([key1, key2, startOff, endOff, width, thickness, chamfer, true, offset1, offset2]);1855 break;1856 }1857 }1858 for (let t in compressRegion[i]) {1859 if (station >= compressRegion[i][t][0] && station <= compressRegion[i][t][1]) {1860 // result.push({ from, to, startOffset: endOffset, width, thickness, chamfer, isTop, offset})1861 let cOffset1 = offset1;1862 let cOffset2 = offset2;1863 if (sectionPointDict[key1].forward.input.Tcl > 0) {1864 cOffset1 = sectionPointDict[key1].forward.input.Tcl + 200;1865 cOffset2 = sectionPointDict[key2].backward.input.Tcl + 200;1866 }1867 result.push([key1, key2, startOff, endOff, width, thickness, chamfer, false, cOffset1, cOffset2]);1868 break;1869 }1870 }1871 j = k - 1;1872 break;1873 }1874 }1875 }1876 }1877 }1878 return result;...

Full Screen

Full Screen

runner.js

Source:runner.js Github

copy

Full Screen

1'use strict';2const {readdirSync, statSync} = require('fs');3const {join} = require('path');4const runBenchmark = require('./benchmark');5const {6 buildReactBundles,7 buildBenchmark,8 buildBenchmarkBundlesFromGitRepo,9 getMergeBaseFromLocalGitRepo,10} = require('./build');11const argv = require('minimist')(process.argv.slice(2));12const chalk = require('chalk');13const printResults = require('./stats');14const serveBenchmark = require('./server');15function getBenchmarkNames() {16 return readdirSync(join(__dirname, 'benchmarks')).filter(file =>17 statSync(join(__dirname, 'benchmarks', file)).isDirectory()18 );19}20function wait(val) {21 return new Promise(resolve => setTimeout(resolve, val));22}23const runRemote = argv.remote;24const runLocal = argv.local;25const benchmarkFilter = argv.benchmark;26const headless = argv.headless;27const skipBuild = argv['skip-build'];28async function runBenchmarks(reactPath) {29 const benchmarkNames = getBenchmarkNames();30 const results = {};31 const server = serveBenchmark();32 await wait(1000);33 for (let i = 0; i < benchmarkNames.length; i++) {34 const benchmarkName = benchmarkNames[i];35 if (36 !benchmarkFilter ||37 (benchmarkFilter && benchmarkName.indexOf(benchmarkFilter) !== -1)38 ) {39 console.log(40 chalk.gray(`- Building benchmark "${chalk.white(benchmarkName)}"...`)41 );42 await buildBenchmark(reactPath, benchmarkName);43 console.log(44 chalk.gray(`- Running benchmark "${chalk.white(benchmarkName)}"...`)45 );46 results[benchmarkName] = await runBenchmark(benchmarkName, headless);47 }48 }49 server.close();50 // http-server.close() is async but they don't provide a callback..51 await wait(500);52 return results;53}54// get the performance benchmark results55// from remote main (default React repo)56async function benchmarkRemoteMaster() {57 console.log(chalk.gray(`- Building React bundles...`));58 let commit = argv.remote;59 if (!commit || typeof commit !== 'string') {60 commit = await getMergeBaseFromLocalGitRepo(join(__dirname, '..', '..'));61 console.log(62 chalk.gray(`- Merge base commit ${chalk.white(commit.tostrS())}`)63 );64 }65 await buildBenchmarkBundlesFromGitRepo(commit, skipBuild);66 return {67 benchmarks: await runBenchmarks(),68 };69}70// get the performance benchmark results71// of the local react repo72async function benchmarkLocal(reactPath) {73 console.log(chalk.gray(`- Building React bundles...`));74 await buildReactBundles(reactPath, skipBuild);75 return {76 benchmarks: await runBenchmarks(reactPath),77 };78}79async function runLocalBenchmarks(showResults) {80 console.log(81 chalk.white.bold('Running benchmarks for ') +82 chalk.green.bold('Local (Current Branch)')83 );84 const localResults = await benchmarkLocal(join(__dirname, '..', '..'));85 if (showResults) {86 printResults(localResults, null);87 }88 return localResults;89}90async function runRemoteBenchmarks(showResults) {91 console.log(92 chalk.white.bold('Running benchmarks for ') +93 chalk.yellow.bold('Remote (Merge Base)')94 );95 const remoteMasterResults = await benchmarkRemoteMaster();96 if (showResults) {97 printResults(null, remoteMasterResults);98 }99 return remoteMasterResults;100}101async function compareLocalToMaster() {102 console.log(103 chalk.white.bold('Comparing ') +104 chalk.green.bold('Local (Current Branch)') +105 chalk.white.bold(' to ') +106 chalk.yellow.bold('Remote (Merge Base)')107 );108 const localResults = await runLocalBenchmarks(false);109 const remoteMasterResults = await runRemoteBenchmarks(false);110 printResults(localResults, remoteMasterResults);111}112if ((runLocal && runRemote) || (!runLocal && !runRemote)) {113 compareLocalToMaster().then(() => process.exit(0));114} else if (runLocal) {115 runLocalBenchmarks(true).then(() => process.exit(0));116} else if (runRemote) {117 runRemoteBenchmarks(true).then(() => process.exit(0));...

Full Screen

Full Screen

settings.js

Source:settings.js Github

copy

Full Screen

1if (Meteor.isClient) {2 /**3 *4 */5 var createBenchmark = function(benchmarkName, benchmarkLux) {6 Meteor.call("startBenchmark", benchmarkName, benchmarkLux, function(err, result) {7 if (err) throw err;8 console.log(result);9 // Show grid after benchmark is created.10 Session.set("benchmarkName", benchmarkName);11 Router.go("benchmarkGrid");12 });13 }14 Template.benchmarkSettings.events({15 /**16 * Starts a new benchmark with the given benchmark name. On the server a17 * benchmark_<BENCHMARK_NAME>.xml will be created.18 */19 'click #start-benchmark-btn': function(e, tmpl) {20 var benchmarkName = tmpl.$('#benchmark-name').val();21 var benchmarkLux = tmpl.$('#benchmark-lux').val();22 createBenchmark(benchmarkName, benchmarkLux);23 },24 'keyup #benchmark-name': function(e, tmpl) {25 if (e.keyCode != 13) return;26 var benchmarkName = tmpl.$('#benchmark-name').val();27 var benchmarkLux = tmpl.$('#benchmark-lux').val();28 createBenchmark(benchmarkName, benchmarkLux);29 },30 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestTime = require('./BestTime');2var bestTime = new BestTime();3bestTime.benchmarkName('test4');4var BestTime = require('./BestTime');5var bestTime = new BestTime();6bestTime.benchmarkName('test5');7var BestTime = require('./BestTime');8var bestTime = new BestTime();9bestTime.benchmarkName('test6');10var BestTime = require('./BestTime');11var bestTime = new BestTime();12bestTime.benchmarkName('test7');13var BestTime = require('./BestTime');14var bestTime = new BestTime();15bestTime.benchmarkName('test8');16var BestTime = require('./BestTime');17var bestTime = new BestTime();18bestTime.benchmarkName('test9');19var BestTime = require('./BestTime');20var bestTime = new BestTime();21bestTime.benchmarkName('test10');22var fileName = 'test' + i + '.js';

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestPractices = require('./BestPractices.js');2var bestPractices = new BestPractices();3var benchmarkName = bestPractices.benchmarkName;4var result = benchmarkName();5console.log(result);6var BestPractices = require('./BestPractices.js');7var bestPractices = new BestPractices();8var benchmarkName = bestPractices.benchmarkName;9var result = benchmarkName();10console.log(result);11var BestPractices = require('./BestPractices.js');12var bestPractices = new BestPractices();13var benchmarkName = bestPractices.benchmarkName;14var result = benchmarkName();15console.log(result);16var BestPractices = require('./BestPractices.js');17var bestPractices = new BestPractices();18var benchmarkName = bestPractices.benchmarkName;19var result = benchmarkName();20console.log(result);21var BestPractices = require('./BestPractices.js');22var bestPractices = new BestPractices();23var benchmarkName = bestPractices.benchmarkName;24var result = benchmarkName();25console.log(result);26var BestPractices = require('./BestPractices.js');27var bestPractices = new BestPractices();28var benchmarkName = bestPractices.benchmarkName;29var result = benchmarkName();30console.log(result);31var BestPractices = require('./BestPractices.js');32var bestPractices = new BestPractices();33var benchmarkName = bestPractices.benchmarkName;34var result = benchmarkName();35console.log(result);

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestTime = require('./besttime');2var bestTime = new BestTime();3bestTime.benchmarkName = 'Test 4';4console.log('Benchmark Name: ' + bestTime.benchmarkName);5var BestTime = require('./besttime');6var bestTime = new BestTime();7bestTime.benchmarkName = 'Test 5';8console.log('Benchmark Name: ' + bestTime.benchmarkName);9var BestTime = require('./besttime');10var bestTime = new BestTime();11bestTime.benchmarkName = 'Test 6';12console.log('Benchmark Name: ' + bestTime.benchmarkName);13var BestTime = require('./besttime');14var bestTime = new BestTime();15bestTime.benchmarkName = 'Test 7';16console.log('Benchmark Name: ' + bestTime.benchmarkName);17var BestTime = require('./besttime');18var bestTime = new BestTime();19bestTime.benchmarkName = 'Test 8';20console.log('Benchmark Name: ' + bestTime.benchmarkName);21var BestTime = require('./besttime');22var bestTime = new BestTime();23bestTime.benchmarkName = 'Test 9';24console.log('Benchmark Name: ' + bestTime.benchmarkName);25var BestTime = require('./besttime');26var bestTime = new BestTime();27bestTime.benchmarkName = 'Test 10';28console.log('Benchmark Name: ' + bestTime.benchmarkName);29var BestTime = require('./besttime');30var bestTime = new BestTime();31bestTime.benchmarkName = 'Test 11';32console.log('Benchmark Name: ' + bestTime.benchmarkName);33var BestTime = require('./besttime

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestTime = require('./BestTime');2var bt = new BestTime();3bt.benchmarkName("test4");4bt.benchmarkName("test5");5var BestTime = require('./BestTime');6var bt = new BestTime();7bt.benchmarkName("test5");8bt.benchmarkName("test6");9var BestTime = require('./BestTime');10var bt = new BestTime();11bt.benchmarkName("test6");12bt.benchmarkName("test7");13var BestTime = require('./BestTime');14var bt = new BestTime();15bt.benchmarkName("test7");16bt.benchmarkName("test8");17var BestTime = require('./BestTime');18var bt = new BestTime();19bt.benchmarkName("test8");20bt.benchmarkName("test9");21var BestTime = require('./BestTime');22var bt = new BestTime();23bt.benchmarkName("test9");24bt.benchmarkName("test10");25var BestTime = require('./BestTime');26var bt = new BestTime();27bt.benchmarkName("test10");28bt.benchmarkName("test11");29var BestTime = require('./BestTime');30var bt = new BestTime();31bt.benchmarkName("test11");32bt.benchmarkName("test12");33var BestTime = require('./BestTime');34var bt = new BestTime();35bt.benchmarkName("test12");36bt.benchmarkName("test13");37var BestTime = require('./BestTime');38var bt = new BestTime();39bt.benchmarkName("test13");40bt.benchmarkName("test14");

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestTime = require('./BestTime');2var bestTime = new BestTime();3bestTime.benchmarkName('test4');4console.log('test4.js: ' + bestTime.benchmarkName());5var BestTime = require('./BestTime');6var bestTime = new BestTime();7bestTime.benchmarkName('test5');8console.log('test5.js: ' + bestTime.benchmarkName());9var BestTime = require('./BestTime');10var bestTime = new BestTime();11bestTime.benchmarkName('test6');12console.log('test6.js: ' + bestTime.benchmarkName());13var BestTime = require('./BestTime');14var bestTime = new BestTime();15bestTime.benchmarkName('test7');16console.log('test7.js: ' + bestTime.benchmarkName());17var BestTime = require('./BestTime');18var bestTime = new BestTime();19bestTime.benchmarkName('test8');20console.log('test8.js: ' + bestTime.benchmarkName());21var BestTime = require('./BestTime');22var bestTime = new BestTime();23bestTime.benchmarkName('test9');24console.log('test9.js: ' + bestTime.benchmarkName());25var BestTime = require('./BestTime');26var bestTime = new BestTime();27bestTime.benchmarkName('test10');28console.log('test10.js: ' + bestTime.benchmarkName());29var BestTime = require('./BestTime');30var bestTime = new BestTime();31bestTime.benchmarkName('test11');32console.log('test11.js: ' + bestTime.benchmarkName());33var BestTime = require('./BestTime');

Full Screen

Using AI Code Generation

copy

Full Screen

1const BestTime = require('./BestTime');2const bestTime = new BestTime();3const BestTime = require('./BestTime');4const bestTime = new BestTime();5const BestTime = require('./BestTime');6const bestTime = new BestTime();7const BestTime = require('./BestTime');8const bestTime = new BestTime();9const BestTime = require('./BestTime');10const bestTime = new BestTime();11const BestTime = require('./BestTime');12const bestTime = new BestTime();13const BestTime = require('./BestTime');14const bestTime = new BestTime();15const BestTime = require('./BestTime');16const bestTime = new BestTime();17const BestTime = require('./

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestTime = require('./bestTime');2var bestTime = new BestTime();3var benchmarkName = process.argv[2];4var result = bestTime.getBestTime(benchmarkName);5console.log(result);6var BestTime = require('./bestTime');7var bestTime = new BestTime();8var benchmarkName = process.argv[2];9var result = bestTime.getBestTime(benchmarkName);10console.log(result);11var BestTime = require('./bestTime');12var bestTime = new BestTime();13var benchmarkName = process.argv[2];14var result = bestTime.getBestTime(benchmarkName);15console.log(result);16var BestTime = require('./bestTime');17var bestTime = new BestTime();18var benchmarkName = process.argv[2];19var result = bestTime.getBestTime(benchmarkName);20console.log(result);21var BestTime = require('./bestTime');22var bestTime = new BestTime();23var benchmarkName = process.argv[2];24var result = bestTime.getBestTime(benchmarkName);25console.log(result);26var BestTime = require('./bestTime');27var bestTime = new BestTime();28var benchmarkName = process.argv[2];29var result = bestTime.getBestTime(benchmarkName);30console.log(result);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Best automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful