public override void BuildPart(Vector2 start) { base.BuildPart(start); BodiceMaker maker = new BodiceMaker(Start, Measurements, neckBezierLength, bodiceType); maker.CalcNeckDepth(curvinessFactor); Entities.AddRange(maker.Entities); PartEntityLine shoulderLine = AddLineEntity(Measurements.ShoulderLength, 270 + Measurements.ShoulderAngle); float bodiceSleeveCutoutHeightFromShoulderCircumference = Measurements.ShoulderCirc * 0.44f; PartEntityLine endScyeDepthCons1 = AddLineEntity(LineDirection.Down, bodiceSleeveCutoutHeightFromShoulderCircumference, EntityType.Construction); //1/4 of chest circ - measurement from start (CF) to shoulder end (start of scy depth line) float chest = (Measurements.ChestCirc * Utils.quarter) - (endScyeDepthCons1.End.X - start.X); PartEntityLine endScyeDepthCons2 = AddLineEntity(LineDirection.Right, chest, EntityType.Construction); BezierCalculator.CalcResult adjustmentsSleeve = BezierCalculator.Calc( sleeveBezierLength, shoulderLine.End, endScyeDepthCons2.End, BezierCalculator.BezierCalculatorControlPointDirection.Down, BezierCalculator.BezierCalculatorControlPointDirection.Left); if (!adjustmentsSleeve.SolutionFound) { throw new SolutionFailureException("Bodice " + bodiceType.ToString() + " solution failure, could not calculate sleeve line length to match sleeve"); } else { System.Diagnostics.Debug.WriteLine("Bodice " + bodiceType.ToString() + " Shoulder solution found, required length " + sleeveBezierLength + " foundLength =" + adjustmentsSleeve.FoundLength); } //arm PartEntityBezier armBezier = AddBezierEntity(shoulderLine.End, endScyeDepthCons2.End, adjustmentsSleeve.Firstpoint, adjustmentsSleeve.SecondPoint); PartEntityLine remainingLengthLine = AddLineEntity(endScyeDepthCons2.End, new Vector2(endScyeDepthCons2.End.X, start.Y)); PartEntityLine lastLine = AddLineEntity(remainingLengthLine.End, start); Vector2 textPos = start + Utils.Right(25) + Utils.Up(100); AddTextEntity(textPos, bodiceType.ToString()); AddPartEntityGrainLine( textPos + Utils.Up(50), textPos + Utils.Up(200), "Grain", false); //add seam and hem allowance entities float sa = Measurements.GarmentSeamAllowance; float ha = Measurements.GarmentHemAllowance; List <PartEntityOffset> offsetLines = new List <PartEntityOffset> { maker.GarmentLengthLine.CalcOffset(sa, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.SA), maker.NeckBezier.CalcOffset(sa, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.SA), shoulderLine.CalcOffset(sa, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.SA), armBezier.CalcOffset(sa, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.SA), remainingLengthLine.CalcOffset(sa, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.SA), lastLine.CalcOffset(ha, PerpendicularRotation.Clockwise, EntityType.PerpConstruction, EntityType.HA), }; PartEntityOffset.Intersect(offsetLines, EntityType.PerpConstruction); offsetLines.ForEach(x => AddLineEntities(x)); //List<PerpConstructionLines> consLines = AddDefaultSAConstructionLines(sa, PerpendicularRotation.Clockwise, EntityType.ConstructionSA); //consLines.ForEach(x => x.AddLinesToPattern(this)); //AddSALines(consLines); }
public override void BuildPart(Vector2 start) { base.BuildPart(start); float garmentHoodBaseStep = 50f;// (Measurements.GarmentBodiceFrontNeckDepth - Measurements.GarmentBodiceBackNeckDepth) * Utils.half; float hoodHeight = (Utils.half * Measurements.ShoulderToShoulderOverHead) + (Utils.twoThirds * (garmentHoodBaseStep)); float hoodHeightLessZipEdge = hoodHeight - Measurements.GarmentHoodZipEdge; float hoodInsertWidth = Measurements.GarmentHoodInsertWidth * Utils.half; float hoodWidth = Measurements.GarmentHoodLenghtFromTemple + (Utils.half * Measurements.CircTempleToTemple) - hoodInsertWidth; float hoodHeadCurveRadius = Measurements.HeadBackCurveRadius; float fullHoodWidth = hoodWidth + Measurements.GarmentHoodSetBackFromZip; float frontBaseLength = (fullHoodWidth + hoodInsertWidth) * Utils.threeFifths; float backBaseLength = fullHoodWidth - frontBaseLength; float backBezierVerticalPoint = Utils.twoThirds * garmentHoodBaseStep; PartEntityLine hoodZipEdge = AddLineEntity(LineDirection.Up, start, Measurements.GarmentHoodZipEdge); PartEntityLine hoodSetBackUp1 = AddLineEntity(LineDirection.Left, Measurements.GarmentHoodSetBackFromZip, EntityType.Construction); PartEntityLine hoodSetBackUp2 = AddLineEntity(LineDirection.Up, hoodHeightLessZipEdge * Utils.third, EntityType.Construction); //PartEntity zipBezier; //if (Measurements.GarmentHoodSetBackFromZip == 0) //{ // zipBezier = // AddLineEntity(hoodZipEdge.End, hoodSetBackUp2.End); //} //else //{ // zipBezier = // AddBezierEntity(hoodZipEdge.End, hoodSetBackUp2.End, // Measurements.GarmentHoodSetBackFromZip > 0 ? Utils.Left(40) : Utils.Left(0), // Measurements.GarmentHoodSetBackFromZip > 0 ? Utils.Down(80) : Utils.Left(0)); //} PartEntityBezier zipBezier = AddBezierEntity(hoodZipEdge.End, hoodSetBackUp2.End, Measurements.GarmentHoodSetBackFromZip > 0 ? Utils.Left(40) : Utils.Left(0), Measurements.GarmentHoodSetBackFromZip > 0 ? Utils.Down(80) : Utils.Left(0)); PartEntityLine hoodHeightLessZipEdgeLine = AddLineEntity(LineDirection.Up, zipBezier.End, hoodHeightLessZipEdge * Utils.twoThirds); PartEntityLine hoodTopToHeadCurveStart = AddLineEntity(LineDirection.Left, hoodWidth - hoodHeadCurveRadius); AddLineEntity(LineDirection.Left, hoodHeadCurveRadius, EntityType.Construction); PartEntityLine hoodTopToHeadCurveEnd = AddLineEntity(LineDirection.Down, hoodHeadCurveRadius, EntityType.Construction); PartEntityBezier headBezier = AddBezierEntity(hoodTopToHeadCurveStart.End, hoodTopToHeadCurveEnd.End, Utils.Left(100), Utils.Up(100)); PartEntityLine hoodToEndWidth = AddLineEntity(LineDirection.Down, hoodTopToHeadCurveEnd.End, (start.Y - hoodTopToHeadCurveEnd.End.Y) - garmentHoodBaseStep); AddLineEntity(LineDirection.Right, backBaseLength, EntityType.Construction); PartEntityLine baseNeckLineDown = AddLineEntity(LineDirection.Down, garmentHoodBaseStep, EntityType.Construction); AddLineEntity(LineDirection.Right, frontBaseLength, EntityType.Construction); PartEntityBezier neckBezierBack = AddBezierEntity(hoodToEndWidth.End, baseNeckLineDown.End + Utils.Up(backBezierVerticalPoint), Utils.Right(20), Utils.Left(20) + Utils.Up(20)); PartEntityBezier neckBezierFront = AddBezierEntity(neckBezierBack.End, start, Utils.Right(40) + Utils.Down(40), Utils.Left(50)); Vector2 textPos = start + Utils.Left(fullHoodWidth) + Utils.Right(25) + Utils.Up(75); AddTextEntity(textPos, "Hood"); AddPartEntityGrainLine( textPos + Utils.Up(0) + Utils.Right(75), textPos + Utils.Up(150) + Utils.Right(75), "Grain", false); HoodPathLengthForCutout += hoodTopToHeadCurveStart.Length(); HoodPathLengthForCutout += headBezier.Length;; HoodPathLengthForCutout += hoodToEndWidth.Length(); HoodNeckFrontLength = neckBezierFront.Length; HoodNeckBackLength = neckBezierBack.Length + hoodInsertWidth; //add seam and hem allowance entities float sa = Measurements.GarmentSeamAllowance; float ha = Measurements.GarmentHemAllowance; List <PartEntityOffset> offsetLines = new List <PartEntityOffset> { hoodZipEdge.CalcOffset(ha, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.HA), zipBezier.CalcOffset(ha, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.HA), hoodHeightLessZipEdgeLine.CalcOffset(ha, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.HA), hoodTopToHeadCurveStart.CalcOffset(sa, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.SA), headBezier.CalcOffset(sa, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.SA), hoodToEndWidth.CalcOffset(sa, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.SA), neckBezierBack.CalcOffset(sa, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.SA), neckBezierFront.CalcOffset(sa, PerpendicularRotation.AntiClockwise, EntityType.PerpConstruction, EntityType.SA), }; PartEntityOffset.Intersect(offsetLines, EntityType.PerpConstruction); offsetLines.ForEach(x => AddLineEntities(x)); }