private Amount<Length> iD = Amount.valueOf(0, SI.MILLIMETER);\r
private Amount<Length> slotWidth = Amount.valueOf(5, SI.MILLIMETER);\r
private Amount<Length> slotDepth = Amount.valueOf(15, SI.MILLIMETER);\r
- \r
+ private Amount<Length> slotOffset = Amount.valueOf(0, SI.MILLIMETER);\r
+\r
public CSlot(){\r
try {\r
setLength(Amount.valueOf(70, SI.MILLIMETER));\r
generateGeometry();\r
}\r
\r
+ public Amount<Length> getSlotOffset() {\r
+ return slotOffset;\r
+ }\r
\r
-\r
+ public void setSlotOffset(Amount<Length> slotOffset) {\r
+ this.slotOffset = slotOffset;\r
+ generateGeometry();\r
+ }\r
\r
private void generateGeometry() {\r
double odmm = oD.doubleValue(SI.MILLIMETER);\r
xsection.add(outside);\r
xsection.inhibit(outside);\r
\r
- double ymm = odmm/2.0 - wmm/2.0; //The Y position of the slot\r
- double xmm = odmm - dmm;\r
+ double offmm = slotOffset.doubleValue(SI.MILLIMETER);\r
+ \r
+ double ymm = odmm/2.0 - wmm/2.0 - offmm; //The Y position of the slot\r
+ double xmm = odmm - dmm; //X pos of slot\r
Rectangle2D.Double slot;\r
slot = new Rectangle2D.Double(xmm, ymm, dmm, wmm);\r
xsection.subtract(slot);\r
\r
double idmm = iD.doubleValue(SI.MILLIMETER);\r
- double idymm = odmm/2.0 - idmm/2.0;\r
- double idxmm = xmm - idmm/2.0;\r
+ double idymm = odmm/2.0 - idmm/2.0 - offmm; //y pos of id\r
+ double idxmm = xmm - idmm/2.0; //x pos of id\r
Ellipse2D.Double id = new Ellipse2D.Double(idxmm, idymm, idmm, idmm);\r
xsection.subtract(id);\r
\r