protected override void CreateTab() { var basePoints = GetTabPoints(RequiredHingeList); var tabList = new List <Entity>(); var baseLines = new List <Line>() { JsonData.HingeDataList[LineType.Rebate_1].Line, JsonData.HingeDataList[LineType.Throat].Line, JsonData.HingeDataList[LineType.Rebate_2].Line, }; for (var i = 0; i < basePoints.Count; i++) { var basePoint = basePoints[i]; var diffY = (JsonData.TabData.TabBase - JsonData.TabData.TabTop) / 2; var p1 = new Point3D { X = basePoint.X, Y = basePoint.Y }; var p2 = new Point3D { X = p1.X - JsonData.TabData.TabBase, Y = p1.Y + diffY }; var p3 = new Point3D { X = p2.X, Y = p2.Y + JsonData.TabData.TabTop }; var p4 = new Point3D { X = p1.X, Y = p1.Y + JsonData.TabData.TabBase }; tabList.AddRange(Utilities.CreateLines(new List <Point3D>() { p1, p2, p3, p4 })); baseLines[i].SplitBy(new List <Point3D> { p1, p4 }, out ICurve[] splitedCurves); HingEntities.Add(splitedCurves[0] as Entity); HingEntities.Add(splitedCurves[2] as Entity); } var tab1Line = HingEntities.First(line => ((Line)line).StartPoint == baseLines[0].StartPoint && ((Line)line).EndPoint == baseLines[0].EndPoint); var tab2Line = HingEntities.First(line => ((Line)line).StartPoint == baseLines[1].StartPoint && ((Line)line).EndPoint == baseLines[1].EndPoint); var tab3Line = HingEntities.First(line => ((Line)line).StartPoint == baseLines[2].StartPoint && ((Line)line).EndPoint == baseLines[2].EndPoint); HingEntities.Remove(tab1Line); HingEntities.Remove(tab2Line); HingEntities.Remove(tab3Line); HingEntities.AddRange(tabList); }
protected override void CreateLeftProfile() { var requiredDat = JsonData.HingeDataList.Where(item => item.ModifiedLengthTxt >= item.BendAllowance) .ToList(); RequiredHingeList.AddRange(requiredDat); Utilities.TranslateEntities(requiredDat); var leftEntities = requiredDat.Select(item => item.Line).ToList(); HingEntities.AddRange(leftEntities); }
protected override void CreateSlots() { double slotHeight = 20; double slotWidth = 2.5; double totalLength = Utilities.InputData.RevealHeight + Utilities.InputData.Architrave1; var slotPoints = GetSlotPoints(totalLength, JsonData.TabData.TabBase, slotHeight, slotWidth); foreach (var point in slotPoints) { var slotLines = DrawPocketLines(point, slotHeight, slotWidth); HingEntities.AddRange(slotLines); } }
protected override void CreateHinges() { double hingeFeatLength = 100.5; double hingeFeatWidth = 32.5; double totalLength = Utilities.InputData.RevealHeight + Utilities.InputData.Architrave1; var hingePoints = GetHingPoints(totalLength, hingeFeatLength, hingeFeatWidth); for (int i = 0; i < Utilities.InputData.HingeQty; i++) { var hingeLines = DrawPocketLines(hingePoints[i], hingeFeatWidth, hingeFeatLength); HingEntities.AddRange(hingeLines); } }
private void DrawLockProfile(double totalLength) { double L1 = 38.5; double H1 = Utilities.InputData.Rebate1 > 45 ? 11 : 9; double L2 = 70.5; double H2 = 29; double basePointX = totalLength - Utilities.InputData.StrikeHeight - (L1 / 2.0); double basePointY = (Utilities.InputData.Return1 - JsonData.HingeDataList[LineType.Return_1].BendAllowance) + (Utilities.InputData.Architrave1 - JsonData.HingeDataList[LineType.Architrave_1].BendAllowance) - 3.9; Point3D p1 = new Point3D { X = basePointX, Y = basePointY }; Point3D p2 = new Point3D { X = p1.X, Y = p1.Y + H1 }; Point3D p3 = new Point3D { X = p2.X - ((L2 - L1) / 2.0), Y = p2.Y }; Point3D p4 = new Point3D { X = p3.X, Y = p3.Y + H2 }; Point3D p5 = new Point3D { X = p4.X + L2, Y = p4.Y }; Point3D p6 = new Point3D { X = p5.X, Y = p3.Y }; Point3D p7 = new Point3D { X = p6.X - ((L2 - L1) / 2.0), Y = p2.Y }; Point3D p8 = new Point3D { X = p1.X + L1, Y = p1.Y }; var lockLines = Utilities.CreateLines(new List <Point3D>() { p1, p2, p3, p4, p5, p6, p7, p8 }, true); lockLines.Add(new Line(p2, p7)); HingEntities.AddRange(lockLines); }