public bool define_B(G.Edge startEdge, G.Edge endEdge) { bool startSet = setEdges.Keys.Contains(startEdge); bool endSet = setEdges.Keys.Contains(endEdge); double cover1 = _V_.X_CONCRETE_COVER_1; double cover2 = _V_.X_CONCRETE_COVER_1; double mainDist = _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; double sideDist = _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; bool realCorner = G.Edge.haveSharedCorner(startEdge, endEdge); if (realCorner) { G.Corner cor = G.Edge.getSharedCorner(startEdge, endEdge); if (cor.Angle > Math.PI) { return(false); } } if (startSet == true && endSet == true) { cover1 += _V_.Y_CONCRETE_COVER_DELTA; cover2 += _V_.Y_CONCRETE_COVER_DELTA; //mainDist == default //sideDist == default } else if (startSet == false && endSet == false) { double startLineLength = startEdge.Line.Length(); double endLineLength = endEdge.Line.Length(); if (startLineLength > endLineLength) { startSet = true; cover1 += _V_.Y_CONCRETE_COVER_DELTA; //cover2 == default //mainDist == default sideDist = endEdge.edgeOffset(cover1, cover1, cover2).Length(); if (endEdge.StartCorner.Angle > Math.PI) { sideDist += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } } else { endSet = true; //cover1 == default cover2 += _V_.Y_CONCRETE_COVER_DELTA; mainDist = startEdge.edgeOffset(cover1, cover1, cover2).Length(); //sideDist == default if (startEdge.EndCorner.Angle > Math.PI) { mainDist += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } } if (startEdge.EndCorner.Angle > Math.PI) { startLineLength += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } if (endEdge.StartCorner.Angle > Math.PI) { endLineLength += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } } else if (startSet == false && endSet == true) { //cover1 == default cover2 += _V_.Y_CONCRETE_COVER_DELTA; mainDist = startEdge.edgeOffset(cover1, cover1, cover2).Length(); //sideDist == default if (startEdge.EndCorner.Angle > Math.PI) { mainDist += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } } else if (startSet == true && endSet == false) { cover1 += _V_.Y_CONCRETE_COVER_DELTA; //cover2 == defualt //mainDist == default sideDist = endEdge.edgeOffset(cover1, cover1, cover2).Length(); if (endEdge.StartCorner.Angle > Math.PI) { sideDist += _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; } } mainDist = Math.Max(mainDist, _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH); sideDist = Math.Max(sideDist, _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH); G.Corner sharedCorner = null; G.Point IP = getCornerPoint(startEdge, endEdge, cover1, cover2, ref sharedCorner); if (!realCorner) { if (startSet == false && endSet == true) { G.Line otherLine = startEdge.edgeOffset(cover1, cover1, cover2); G.Point other = IP.getClosePoint(otherLine.Start, otherLine.End); double dist = other.distanceTo(IP); mainDist += dist; } else if (startSet == true && endSet == false) { G.Line otherLine = endEdge.edgeOffset(cover1, cover1, cover2); G.Point other = IP.getClosePoint(otherLine.Start, otherLine.End); double dist = other.distanceTo(IP); sideDist += dist; } } G.Vector v1 = endEdge.Line.getOffsetVector(); G.Vector v2 = startEdge.Line.getCoolVector(v1); G.Vector v3 = startEdge.Line.getOffsetVector(); G.Vector v4 = endEdge.Line.getCoolVector(v3); G.Point mainEndPoint = IP.move(mainDist, v2); G.Point sidePoint = IP.move(sideDist, v4); //A_handler_debug(IP, mainEndPoint); //A_handler_debug(sidePoint, IP); bool success = false; if (startSet == false) { success = B_vs_C_handler(IP, mainEndPoint, sidePoint, startEdge, sharedCorner); } else if (endSet == false) { success = B_vs_C_handler(IP, mainEndPoint, sidePoint, endEdge, sharedCorner); } else { success = B_vs_C_handler(IP, mainEndPoint, sidePoint, null, sharedCorner); } return(success); }
public bool define_simple_D(G.Edge mainEdge, G.Edge side1Edge, G.Edge side2Edge) { bool mainSet = setEdges.Keys.Contains(mainEdge); bool side1Set = setEdges.Keys.Contains(side1Edge); bool side2Set = setEdges.Keys.Contains(side2Edge); double cover1 = _V_.X_CONCRETE_COVER_1; double coverMain = _V_.X_CONCRETE_COVER_1; double cover2 = _V_.X_CONCRETE_COVER_1; int parand = 0; double side1Dist = _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; double mainDist = mainEdge.Line.Length(); double side2Dist = _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH; G.Corner startCorner = null; G.Point IP1 = getCornerPoint(side1Edge, mainEdge, cover1, coverMain, ref startCorner); if (startCorner == null) { return(false); } G.Corner endCorner = null; G.Point IP2 = getCornerPoint(mainEdge, side2Edge, coverMain, cover2, ref endCorner); if (endCorner == null) { return(false); } if (mainSet == true) { coverMain = coverMain + _V_.Y_CONCRETE_COVER_DELTA; } if (side1Set == true) { cover1 = cover1 + _V_.Y_CONCRETE_COVER_DELTA; } else { if (side1Edge.getOtherCorner(startCorner).Angle > Math.PI) { side1Dist = side1Dist + side1Edge.Line.Length(); } else { side1Dist = side1Edge.edgeOffset(_V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1).Length(); } } if (side2Set == true) { cover2 = cover2 + _V_.Y_CONCRETE_COVER_DELTA; } else { if (side2Edge.getOtherCorner(endCorner).Angle > Math.PI) { side2Dist = side2Dist + side2Edge.Line.Length(); } else { side2Dist = side2Edge.edgeOffset(_V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1).Length(); } } if (side1Dist != side2Dist) { double max = Math.Max(side1Dist, side2Dist); side1Dist = max; side2Dist = max; } IP1 = getCornerPoint(side1Edge, mainEdge, cover1, coverMain, ref startCorner); IP2 = getCornerPoint(mainEdge, side2Edge, coverMain, cover2, ref endCorner); G.Vector v1 = mainEdge.Line.getOffsetVector(); G.Vector v2 = side1Edge.Line.getCoolVector(v1); G.Vector v3 = side2Edge.Line.getCoolVector(v2); G.Point side1Start = IP1.move(side1Dist, v2); G.Point side2End = IP2.move(side2Dist, v3); //A_handler_debug(side1Start, IP1); //A_handler_debug(IP1, IP2); //A_handler_debug(IP2, side2End); bool success = false; if (side1Set == false && side2Set == false) { success = D_vs_E_handler(IP1, IP2, side1Start, side2End, mainEdge, startCorner, endCorner, parand, side1Edge, side2Edge); // parand magic } else if (side1Set == false) { success = D_vs_E_handler(IP1, IP2, side1Start, side2End, mainEdge, startCorner, endCorner, parand, side1Edge); // parand magic } else if (side2Set == false) { success = D_vs_E_handler(IP1, IP2, side1Start, side2End, mainEdge, startCorner, endCorner, parand, side2Edge); // parand magic } else { success = D_vs_E_handler(IP1, IP2, side1Start, side2End, mainEdge, startCorner, endCorner, parand); // parand magic } return(success); }