private void create_extended_B() { List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList(); emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).Reverse().ToList(); foreach (G.Edge e in emptyEdges) { G.Corner sc = e.StartCorner; G.Corner ec = e.EndCorner; bool c1 = sc.Angle > Math.PI; bool c2 = ec.Angle > Math.PI; if (c1 && c2) { continue; } if (!c1 && !c2) { continue; } if (c1) //startCorner >> math.pi { G.Edge otherEdge = ec.getOtherEdge(e); define_B(otherEdge, e); } else if (c2) //endCorner >> math.pi { G.Edge otherEdge = sc.getOtherEdge(e); define_B(e, otherEdge); } } }
private void create_valid_D() { List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList(); emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).Reverse().ToList(); foreach (G.Edge e in emptyEdges) { G.Corner sc = e.StartCorner; G.Corner ec = e.EndCorner; G.Edge side1Edge = sc.getOtherEdge(e); G.Edge side2Edge = ec.getOtherEdge(e); bool c1 = !setCorners.Keys.Contains(sc); bool c2 = !setCorners.Keys.Contains(ec); bool c3 = sc.Angle < Math.PI; bool c4 = ec.Angle < Math.PI; bool c5 = setEdges.Keys.Contains(side1Edge); bool c6 = setEdges.Keys.Contains(side2Edge); if (c1 && c2 && c3 && c4 && c5 && c6) { define_simple_D(e, side1Edge, side2Edge); } } }
private void create_oversized_D() { List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList(); emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).Reverse().ToList(); foreach (G.Edge e in emptyEdges) { G.Corner sc = e.StartCorner; G.Corner ec = e.EndCorner; G.Edge side1Edge = sc.getOtherEdge(e); G.Edge side2Edge = ec.getOtherEdge(e); bool c1 = !setCorners.Keys.Contains(sc); bool c2 = !setCorners.Keys.Contains(ec); bool c3 = sc.Angle < Math.PI; bool c4 = ec.Angle < Math.PI; bool c5 = setEdges.Keys.Contains(side1Edge); bool c6 = setEdges.Keys.Contains(side2Edge); if (c1 && c2 && c3 && c4) { if (!c5 && !c6) { if (side1Edge.Line.Length() < _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH) { if (side2Edge.Line.Length() < _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH) { define_simple_D(e, side1Edge, side2Edge); } } } else if (!c5) { if (side1Edge.Line.Length() < _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH) { define_simple_D(e, side1Edge, side2Edge); } } else if (!c6) { if (side2Edge.Line.Length() < _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH) { define_simple_D(e, side1Edge, side2Edge); } } } } }
private void create_trimmed_short_A() { List <G.Edge> emptyEdges = allEdges.Where(x => !setEdges.Keys.Contains(x)).ToList(); emptyEdges = emptyEdges.OrderBy(b => b.Line.Length()).ToList(); foreach (G.Edge e in emptyEdges) { if (setEdges.Keys.Contains(e)) { continue; } if (narrow_denier(e)) { continue; } G.Edge temp = null; G.Line main = e.edgeOffset(_V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1, _V_.X_CONCRETE_COVER_1); main = trimLine_baseline(main, main.Copy(), _V_.X_CONCRETE_COVER_2, e, ref temp); bool startTrimmed = false; G.Edge startTrimmerEdge = null; if (e.StartCorner.Angle > Math.PI) { G.Line extended = main.extendStart(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH); G.Line trimmed = trimLine_basepoint(extended, main.End, _V_.X_CONCRETE_COVER_2, e, ref startTrimmerEdge); if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE) { startTrimmed = true; } main = trimmed; } bool endTrimmed = false; G.Edge endTrimmerEdge = null; if (e.EndCorner.Angle > Math.PI) { G.Line extended = main.extendEnd(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH); G.Line trimmed = trimLine_basepoint(extended, main.Start, _V_.X_CONCRETE_COVER_2, e, ref endTrimmerEdge); if (trimmed.Length() < main.Length() + _V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * _V_.M_TRIM_TOLERANCE) { endTrimmed = true; } main = trimmed; } if (main.Length() <= _V_.Y_REINFORCEMENT_MAIN_MIN_LENGTH) { if (startTrimmed && endTrimmed) { bool got_D = define_D(e, startTrimmerEdge, endTrimmerEdge); if (got_D == false) { G.Vector v1 = main.getOffsetVector(); G.Vector v2 = startTrimmerEdge.Line.getCoolVector(v1); G.Vector v3 = endTrimmerEdge.Line.getCoolVector(v1); G.Point side1Point = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.05, v2); G.Point side2Point = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.05, v3); G.Line side1 = new G.Line(side1Point, main.Start); G.Line side2 = new G.Line(main.End, side2Point); if (denier(side1) && denier(side2)) { G.Point AP = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2); G.Line b_line = new G.Line(main.Start, AP); G.Edge side1TrimmerEdge = null; G.Line side1Main = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref side1TrimmerEdge); G.Point AP2 = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v3); G.Line b_line2 = new G.Line(main.End, AP2); G.Edge side2TrimmerEdge = null; G.Line side2Main = trimLine_basepoint(b_line2, main.End, _V_.X_CONCRETE_COVER_2, e, ref side2TrimmerEdge); A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER); define_D(startTrimmerEdge, side1TrimmerEdge, e); define_D(endTrimmerEdge, e, side2TrimmerEdge); } else if (denier(side1)) { G.Point AP = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2); G.Line b_line = new G.Line(main.Start, AP); G.Edge sideTrimmerEdge = null; G.Line newMain = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge); B_vs_C_handler(main.End, side2Point, main.Start, e, null); define_D(startTrimmerEdge, sideTrimmerEdge, e); } else if (denier(side2)) { G.Point AP = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 1.5, v2); G.Line b_line = new G.Line(main.End, AP); G.Edge sideTrimmerEdge = null; G.Line newMain = trimLine_basepoint(b_line, main.End, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge); define_D(endTrimmerEdge, e, sideTrimmerEdge); B_vs_C_handler(main.Start, main.End, side1Point, e, null); } } } else if (startTrimmed) { bool got_B = define_B(e, startTrimmerEdge); if (got_B == false) { G.Vector v1 = e.Line.getOffsetVector(); G.Vector v2 = startTrimmerEdge.Line.getCoolVector(v1); G.Point AP = main.Start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 2, v2); G.Line b_line = new G.Line(main.Start, AP); G.Edge sideTrimmerEdge = null; G.Line newMain = trimLine_basepoint(b_line, main.Start, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge); if (sideTrimmerEdge != null) { bool got_D = define_D(startTrimmerEdge, sideTrimmerEdge, e); if (got_D) { A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER); } } else { G.Corner ec = e.EndCorner; if (ec.Angle < Math.PI) { G.Edge otherEdge = ec.getOtherEdge(e); define_D(e, startTrimmerEdge, otherEdge); } } } } else if (endTrimmed) { bool got_B = define_B(endTrimmerEdge, e); if (got_B == false) { G.Vector v1 = e.Line.getOffsetVector(); G.Vector v2 = endTrimmerEdge.Line.getCoolVector(v1); G.Point AP = main.End.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH * 2, v2); G.Line b_line = new G.Line(main.End, AP); G.Edge sideTrimmerEdge = null; G.Line newMain = trimLine_basepoint(b_line, main.End, _V_.X_CONCRETE_COVER_2, e, ref sideTrimmerEdge); if (sideTrimmerEdge != null) { bool got_D = define_D(endTrimmerEdge, e, sideTrimmerEdge); if (got_D) { A_handler(main.Start, main.End, e, null, _V_.X_REINFORCEMENT_MAIN_DIAMETER); } } else { G.Corner sc = e.StartCorner; if (sc.Angle < Math.PI) { G.Edge otherEdge = sc.getOtherEdge(e); define_D(e, otherEdge, endTrimmerEdge); } } } } } } }