Skip to content

Commit

Permalink
Merge pull request #117 from aharwood2/release
Browse files Browse the repository at this point in the history
Release v1.6.1
  • Loading branch information
aharwood2 authored Aug 25, 2022
2 parents 618264a + 5792a95 commit 15c6377
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 49 deletions.
72 changes: 38 additions & 34 deletions src/aldrich/TrouserPattern.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ protected void defineRequiredMeasurements() throws Exception
{
measurements.addMeasurement(new Measurement("b_HipsFrontArc", "A31"));
measurements.addMeasurement(new Measurement("b_HipsBackArc", "A32"));
measurements.addMeasurement(new Measurement("c_WaistToHip", "A15"));
measurements.addMeasurement(new Measurement("c_WaistToSeat", "A34"));
measurements.addMeasurement(new Measurement("d_BodyRise", "A38"));
measurements.addMeasurement(new Measurement("g_HipCHeight", "A44"));
measurements.addMeasurement(new Measurement("g_SeatCHeight", "A45"));
measurements.addMeasurement(new Measurement("h_CrotchHeight", "A43"));

// Arbitrary measurement
measurements.addMeasurement(new Measurement("Arb_HemWidth", 22.0));
measurements.addMeasurement(new Measurement("Arb_FrontDartWidth", 2.0));
measurements.addMeasurement(new Measurement("Arb_FrontDartLength", 10.0));
measurements.addMeasurement(new Measurement("Arb_BackDartWidth", 2.0));
measurements.addMeasurement(new Measurement("Arb_BackDartLength1", 10.0));
measurements.addMeasurement(new Measurement("Arb_BackDartLength2", 12.0));
}

/**
Expand All @@ -47,13 +52,18 @@ public void createBlocks()

// Pull from store
var b_Hips = get("b_HipsFrontArc") + get("b_HipsBackArc");
var c_WaistToHip = get("c_WaistToHip");
var c_WaistToSeat = get("c_WaistToSeat");
var d_BodyRise = get("d_BodyRise");
var g_HipCHeight = get("g_HipCHeight");
var g_SeatCHeight = get("g_SeatCHeight");
var h_CrotchHeight = get("h_CrotchHeight");
var Arb_HemWidth = get("Arb_HemWidth");
var Arb_FrontDartWidth = get("Arb_FrontDartWidth");
var Arb_FrontDartLength = get("Arb_FrontDartLength");
var Arb_BackDartWidth = get("Arb_BackDartWidth");
var Arb_BackDartLength1 = get("Arb_BackDartLength1");
var Arb_BackDartLength2 = get("Arb_BackDartLength2");



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Front Half Block */
Expand All @@ -71,17 +81,17 @@ public void createBlocks()
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), -((Arb_HemWidth / 2.0) - 0.5 + 1.3)));

// Step 14
frontblock.addKeypoint(new Vector2D((c_WaistToHip + g_HipCHeight), -((Arb_HemWidth / 2.0) - 0.5)));
frontblock.addKeypoint(new Vector2D((c_WaistToSeat + g_SeatCHeight), -((Arb_HemWidth / 2.0) - 0.5)));

// Step 12
frontblock.addKeypoint(new Vector2D((c_WaistToHip + g_HipCHeight), ((Arb_HemWidth / 2.0) - 0.5)));
frontblock.addKeypoint(new Vector2D((c_WaistToSeat + g_SeatCHeight), ((Arb_HemWidth / 2.0) - 0.5)));

// Step 13
frontblock.addKeypoint(
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), ((Arb_HemWidth / 2.0) - 0.5 + 1.3)));

// Step 8
frontblock.addKeypoint(new Vector2D(c_WaistToHip, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)));
frontblock.addKeypoint(new Vector2D(c_WaistToSeat, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)));

// Step 11
frontblock.addKeypoint(new Vector2D(0.0, ((b_Hips / 4.0) + 1.0) - ((b_Hips / 12.0) + 2)));
Expand All @@ -90,7 +100,7 @@ public void createBlocks()
frontblock.addKeypoint(new Vector2D(0.0, (-((b_Hips / 12.0) + 2.0) + 1.0)));

// Step 6
frontblock.addKeypoint(new Vector2D((c_WaistToHip), -((b_Hips / 12.0) + 2.0)));
frontblock.addKeypoint(new Vector2D((c_WaistToSeat), -((b_Hips / 12.0) + 2.0)));

// Step 9 (back to beginning)
frontblock.addKeypoint(new Vector2D(d_BodyRise, -(((b_Hips / 12.0) + 2.0) + ((b_Hips / 16.0) + 1.0))));
Expand All @@ -99,8 +109,6 @@ public void createBlocks()
Vector2D startSegment = new Vector2D(0.0, ((b_Hips / 4.0) + 1.0) - ((b_Hips / 12.0) + 2));
Vector2D endSegment = new Vector2D(0.0, (-((b_Hips / 12.0) + 2.0) - 1.0));
double positionTopDart = 0.5;
Arb_FrontDartWidth = 2.0;
Arb_FrontDartLength = 10.0;
ArrayList<Vector2D> dartPoints = frontblock.addDart(startSegment,
endSegment,
positionTopDart,
Expand All @@ -121,35 +129,35 @@ public void createBlocks()
// Adding curve from Step 13 --> 8
frontblock.addCircularArc(
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), ((Arb_HemWidth / 2.0) - 0.5 + 1.3)),
new Vector2D(c_WaistToHip, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)),
new Vector2D(c_WaistToSeat, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)),
0.5,
true
);

// Adding curve from Step 8 --> 11
frontblock.addCircularArc(new Vector2D(c_WaistToHip, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)),
frontblock.addCircularArc(new Vector2D(c_WaistToSeat, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2)),
new Vector2D(0.0, ((b_Hips / 4.0) + 1.0) - ((b_Hips / 12.0) + 2)),
0.5,
true
);

// Adding curve from Step 6 --> 9
frontblock.addCircularArc(new Vector2D(c_WaistToHip, -((b_Hips / 12.0) + 2.0)),
frontblock.addCircularArc(new Vector2D(c_WaistToSeat, -((b_Hips / 12.0) + 2.0)),
new Vector2D(d_BodyRise, -(((b_Hips / 12.0) + 2.0) + ((b_Hips / 16.0) + 1.0))),
1.5,
false
);

// Add construction keypoints for Centre Fold
frontblock.addConstructionPoint(new Vector2D(0.0 - Arb_Con, 0.0),
new Vector2D((c_WaistToHip + g_HipCHeight) + Arb_Con, 0.0),
new Vector2D((c_WaistToSeat + g_SeatCHeight) + Arb_Con, 0.0),
"Centre Fold");

// Add construction keypoints for Crutch Depth
frontblock.addConstructionPoint(
new Vector2D(d_BodyRise, ((b_Hips / 4.0) + 0.5) - ((b_Hips / 12) + 2) + Arb_Con),
new Vector2D(d_BodyRise, -(((b_Hips / 12.0) + 2.0) + ((b_Hips / 16.0) + 1.0)) - Arb_Con),
"Crutch Depth");
"Crotch Depth");

// Add construction keypoints for Knee Line
frontblock.addConstructionPoint(new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)),
Expand All @@ -175,20 +183,20 @@ public void createBlocks()
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), -((Arb_HemWidth / 2.0) - 0.5 + 1.3) - 1.0));

// Adding Step 28
backblock.addKeypoint(new Vector2D((c_WaistToHip + g_HipCHeight), -((Arb_HemWidth / 2.0) - 0.5) - 1.0));
backblock.addKeypoint(new Vector2D((c_WaistToSeat + g_SeatCHeight), -((Arb_HemWidth / 2.0) - 0.5) - 1.0));

// Adding Step 28.1
backblock.addKeypoint(new Vector2D(((c_WaistToHip + g_HipCHeight) + 1.0), 0.0));
backblock.addKeypoint(new Vector2D(((c_WaistToSeat + g_SeatCHeight) + 1.0), 0.0));

// Adding Step 26
backblock.addKeypoint(new Vector2D((c_WaistToHip + g_HipCHeight), ((Arb_HemWidth / 2.0) - 0.5) + 1.0));
backblock.addKeypoint(new Vector2D((c_WaistToSeat + g_SeatCHeight), ((Arb_HemWidth / 2.0) - 0.5) + 1.0));

// Adding Step 27
backblock.addKeypoint(
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), ((Arb_HemWidth / 2.0) - 0.5 + 1.3) + 1.0));

// Adding Step 25
backblock.addKeypoint(new Vector2D(c_WaistToHip,
backblock.addKeypoint(new Vector2D(c_WaistToSeat,
(((b_Hips / 4.0) + 4.0) - ((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0))));

// Adding Step 22
Expand All @@ -211,13 +219,11 @@ public void createBlocks()
((b_Hips / 4.0) - ((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0)));
Vector2D endSegment2 = new Vector2D(-2.0, (-(((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0) - 2)));
double positionTopDart2 = 1.0 / 3.0;
Arb_FrontDartWidth = 2.0;
Arb_FrontDartLength = 10.0;
ArrayList<Vector2D> dartPoints2 = backblock.addDart(startSegment2,
endSegment2,
positionTopDart2,
Arb_FrontDartWidth,
Arb_FrontDartLength,
Arb_BackDartWidth,
Arb_BackDartLength1,
true,
false
);
Expand All @@ -226,13 +232,11 @@ public void createBlocks()
Vector2D startSegment3 = dartPoints2.get(2);
Vector2D endSegment3 = new Vector2D(-2.0, (-(((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0) - 2)));
double positionTopDart3 = 1.0 / 2.0;
Arb_FrontDartWidth = 2.0;
Arb_FrontDartLength = 12.0;
ArrayList<Vector2D> dartPoints3 = backblock.addDart(startSegment3,
endSegment3,
positionTopDart3,
Arb_FrontDartWidth,
Arb_FrontDartLength,
Arb_BackDartWidth,
Arb_BackDartLength2,
true,
false
);
Expand All @@ -247,30 +251,30 @@ public void createBlocks()
);

// Adding curve from Step 28 --> 28.1
backblock.addCircularArc(new Vector2D((c_WaistToHip + g_HipCHeight), -((Arb_HemWidth / 2.0) - 0.5) - 1.0),
new Vector2D(((c_WaistToHip + g_HipCHeight) + 1.0), 0.0),
backblock.addCircularArc(new Vector2D((c_WaistToSeat + g_SeatCHeight), -((Arb_HemWidth / 2.0) - 0.5) - 1.0),
new Vector2D(((c_WaistToSeat + g_SeatCHeight) + 1.0), 0.0),
0.25,
true
);

// Adding curve from Step 28.1 --> 26
backblock.addCircularArc(new Vector2D(((c_WaistToHip + g_HipCHeight) + 1.0), 0.0),
new Vector2D((c_WaistToHip + g_HipCHeight), ((Arb_HemWidth / 2.0) - 0.5) + 1.0),
backblock.addCircularArc(new Vector2D(((c_WaistToSeat + g_SeatCHeight) + 1.0), 0.0),
new Vector2D((c_WaistToSeat + g_SeatCHeight), ((Arb_HemWidth / 2.0) - 0.5) + 1.0),
0.25,
true
);

// Adding curve from Step 27 --> 25
backblock.addCircularArc(
new Vector2D((d_BodyRise + ((h_CrotchHeight / 2.0) - 5.0)), ((Arb_HemWidth / 2.0) - 0.5 + 1.3) + 1.0),
new Vector2D(c_WaistToHip,
new Vector2D(c_WaistToSeat,
(((b_Hips / 4.0) + 4.0) - ((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0))),
0.5,
true
);

// Adding curve from Step 25 --> 22
backblock.addCircularArc(new Vector2D(c_WaistToHip,
backblock.addCircularArc(new Vector2D(c_WaistToSeat,
(((b_Hips / 4.0) + 4.0) - ((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0))),
new Vector2D(0.0,
((b_Hips / 4.0) - ((b_Hips / 12.0) + 2.0) - (((b_Hips / 12.0) + 2.0) / 4.0))),
Expand All @@ -289,7 +293,7 @@ public void createBlocks()

// Add construction keypoints for Centre Fold
backblock.addConstructionPoint(new Vector2D(0.0 - (6.0 * Arb_Con), 0.0),
new Vector2D(((c_WaistToHip + g_HipCHeight) + 1.0) + Arb_Con, 0.0),
new Vector2D(((c_WaistToSeat + g_SeatCHeight) + 1.0) + Arb_Con, 0.0),
"Centre Fold");

// Add construction keypoints for Crutch Depth
Expand Down
88 changes: 88 additions & 0 deletions src/gill/NeckAndShoulderPattern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package gill;

import jblockenums.EPattern;
import jblockmain.*;
import mathcontainers.Vector2D;

import static java.lang.Math.abs;

public class NeckAndShoulderPattern extends Pattern
{
public NeckAndShoulderPattern(String userName, InputFileData dataStore, MeasurementSet template)
{
super(userName, dataStore, template);
}

@Override
protected EPattern assignPattern()
{
return EPattern.GILL_NECK_SHOULDER;
}

@Override
protected void defineRequiredMeasurements() throws Exception
{
measurements.addMeasurement(new Measurement("shoulderLengthRight", "A11"));
measurements.addMeasurement(new Measurement("frontNeckDiagonal", "A73"));
measurements.addMeasurement(new Measurement("backNeckDiagonal", "A74"));
measurements.addMeasurement(new Measurement("neckBaseWidth", "A93"));
measurements.addMeasurement(new Measurement("shoulderLengthLeft", "A94"));
measurements.addMeasurement(new Measurement("leftShoulderPointZ", "A95"));
measurements.addMeasurement(new Measurement("rightShoulderPointZ", "A96"));
measurements.addMeasurement(new Measurement("leftSideNeckPointZ", "A97"));
measurements.addMeasurement(new Measurement("rightSideNeckPointZ", "A98"));
}

@Override
public void createBlocks()
{
// Pull from store
var shoulderLengthRight = get("shoulderLengthRight");
var frontNeckDiagonal = get("frontNeckDiagonal");
var backNeckDiagonal = get("backNeckDiagonal");
var neckBaseWidth = get("neckBaseWidth");
var shoulderLengthLeft = get("shoulderLengthLeft");
var leftShoulderPointZ = get("leftShoulderPointZ");
var rightShoulderPointZ = get("rightShoulderPointZ");
var leftSideNeckPointZ = get("leftSideNeckPointZ");
var rightSideNeckPointZ = get("rightSideNeckPointZ");

// Build block
Block fullBlock = new Block(userName + "_Gill_NeckShoulder");
blocks.add(fullBlock);

// Define side point as either positive or negative
double sidePointRight = ((rightSideNeckPointZ < 0 && rightShoulderPointZ < 0) || (rightSideNeckPointZ > 0 && rightShoulderPointZ < 0)) ? abs(rightSideNeckPointZ - rightShoulderPointZ) : -abs(rightSideNeckPointZ - rightShoulderPointZ);
double sidePointLeft = ((leftSideNeckPointZ < 0 && leftShoulderPointZ < 0) || (leftSideNeckPointZ > 0 && leftShoulderPointZ < 0)) ? abs(leftSideNeckPointZ - leftShoulderPointZ) : -abs(leftSideNeckPointZ - leftShoulderPointZ);

// Defining each point
var point1 = new Vector2D(0, backNeckDiagonal);
var point2 = new Vector2D(0, -frontNeckDiagonal);
var point3 = new Vector2D(-(neckBaseWidth * 0.5), 0);
var point4 = new Vector2D(-(neckBaseWidth * 0.5 + shoulderLengthRight), sidePointRight);
var point5 = new Vector2D(neckBaseWidth * 0.5, 0);
var point6 = new Vector2D(neckBaseWidth * 0.5 + shoulderLengthLeft, sidePointLeft);

// All the keypoints/vectors added
fullBlock.addKeypoint(point1);
fullBlock.addCircularArc(point1, point3, 0.9, true);
fullBlock.addKeypoint(point3);
fullBlock.addCircularArc(point3, point2, 1.5, true);
fullBlock.addKeypoint(point2);
fullBlock.addCircularArc(point2, point5, 1.5, true);
fullBlock.addKeypoint(point5);
fullBlock.addCircularArc(point5, point1, 0.9, true);
fullBlock.addKeypoint(point1);
fullBlock.addKeypoint(point4);
fullBlock.addKeypoint(point2);
fullBlock.addKeypoint(point6);
fullBlock.addKeypoint(point5);
fullBlock.addKeypoint(point3);
fullBlock.addKeypoint(point4);
fullBlock.addKeypoint(point1);
fullBlock.addKeypoint(point2);
fullBlock.addKeypoint(point1);
fullBlock.addKeypoint(point6);

}
}
20 changes: 16 additions & 4 deletions src/gill/TrouserPatternThree.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ public void createBlocks()
frontBlock.addKeypoint(new Vector2D(kneeCircumR * arbFrontLegPercent, kneeLevel)); // Point 18
frontBlock.addKeypoint(new Vector2D(midThighCircumR * arbFrontLegPercent, midThighLevel)); // Point 19
frontBlock.addKeypoint(new Vector2D(thighCircumR * arbFrontLegPercent, upperThighLevel)); // Point 20
frontBlock.addKeypoint(new Vector2D(point1X, crotchLevel)); // Point 21
frontBlock.addKeypoint(new Vector2D(point22X, crotchLevel)); // Point 22
if (point22X > point1X)
{
frontBlock.addKeypoint(new Vector2D(point22X, crotchLevel)); // Point 22
}
else
{
frontBlock.addKeypoint(new Vector2D(point1X, crotchLevel)); // Point 21
}

// Add construction lines
var xMin = frontBlock.getMinimumX() - Arb_Con;
Expand Down Expand Up @@ -180,8 +186,14 @@ public void createBlocks()
backBlock.addKeypoint(new Vector2D(-kneeCircumR * arbBackLegPercent, kneeLevel)); // Point 18
backBlock.addKeypoint(new Vector2D(-midThighCircumR * arbBackLegPercent, midThighLevel)); // Point 19
backBlock.addKeypoint(new Vector2D(-thighCircumR * arbBackLegPercent, upperThighLevel)); // Point 20
backBlock.addKeypoint(new Vector2D(-point1X, crotchLevel)); // Point 21
backBlock.addKeypoint(new Vector2D(-point22X, crotchLevel)); // Point 22
if (point22X > point1X)
{
backBlock.addKeypoint(new Vector2D(-point22X, crotchLevel)); // Point 22
}
else
{
backBlock.addKeypoint(new Vector2D(-point1X, crotchLevel)); // Point 21
}

// Add construction lines
xMin = backBlock.getMinimumX() - Arb_Con;
Expand Down
3 changes: 2 additions & 1 deletion src/jblockenums/EPattern.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public enum EPattern
GILL_SWEATSHIRT("Gill Sweatshirt"),
GILL_TROUSER("Gill Trouser"),
GILL_TROUSER2("Gill Trouser 2"),
GILL_TROUSER3("Gill Trouser 3");
GILL_TROUSER3("Gill Trouser 3"),
GILL_NECK_SHOULDER("Gill Neck and Shoulder");

EPattern(String s)
{
Expand Down
2 changes: 1 addition & 1 deletion src/jblockmain/JBlockCreatorApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void start(Stage stage) throws IOException

// Display the scene
var bundle = ResourceBundle.getBundle("settings");
var title = bundle.getString("app_name") + " - v" + bundle.getString("maj_ver") + "." + bundle.getString("min_ver");
var title = bundle.getString("app_name") + " - v" + bundle.getString("maj_ver") + "." + bundle.getString("min_ver") + "." + bundle.getString("pat_ver");
Scene scene = new Scene(root,
Double.parseDouble(bundle.getString("prefWidth")),
Double.parseDouble(bundle.getString("prefHeight")));
Expand Down
1 change: 1 addition & 0 deletions src/jblockmain/PatternFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static Pattern Create(EPattern type, String userName, InputFileData data,
case GILL_TROUSER -> { return new gill.TrouserPattern(userName, data, template); }
case GILL_TROUSER2 -> { return new gill.TrouserPatternTwo(userName, data, template); }
case GILL_TROUSER3 -> { return new gill.TrouserPatternThree(userName, data, template); }
case GILL_NECK_SHOULDER -> { return new gill.NeckAndShoulderPattern(userName, data, template); }
}
return null;
}
Expand Down
Loading

0 comments on commit 15c6377

Please sign in to comment.