Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
9 years ago
Diff never expires
Clear
Export
Share
Explain
21 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
357 lines
Copy
56 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
386 lines
Copy
/*
/*
T-Slot Joint
T-Slot Joint
This custom feature adds a bolted T-slot connection between two planar parts.
This custom feature adds a bolted T-slot connection between two planar parts.
Version 1.0 - July 6, 2016 - Arul Suresh - Initial development and validation.
Version 1.0 - July 6, 2016 - Arul Suresh - Initial development and validation.
Version 2.0 - July 20, 2016 - Arul Suresh - Added some utility functions, lookup tables.
Version 2.0 - July 20, 2016 - Arul Suresh - Added some utility functions, lookup tables.
Initial forum release.
Initial forum release.
Version 2.1 - Sept 18, 2016 - Arul Suresh - Update to newest FS, published release.
Version 2.1 - Sept 18, 2016 - Arul Suresh - Update to newest FS, published release.
Version 2.1.1 - Sept 18, 2016 - Arul Suresh - Document description.
Version 2.1.1 - Sept 18, 2016 - Arul Suresh - Document description.
Copy
Copied
Copy
Copied
Version 2.2 - April 7, 2017 - Eric Miller - Added single-hole centered spacing and multiple plane selection, and fixed handling of angled surfaces.
*/
*/
FeatureScript 422;
FeatureScript 422;
import(path : "onshape/std/geometry.fs", version : "422.0");
import(path : "onshape/std/geometry.fs", version : "422.0");
Copy
Copied
Copy
Copied
import(path : "
4dfdd9c6856db10dd896e29b
", version : "
c92857bc5898d90ad6f21cc3
");
import(path : "
5695a84e0bdf321f1d91df84
", version : "
90245e5cbffb04b2d7c533ad
");
import(path : "f4e7238da5afaf5a3f1498c0/962c2d4fc4ca0f12fa54d8f4/22d17eb94c85900576fbf53e", version : "130b19167f35ae1dc291873b");
import(path : "f4e7238da5afaf5a3f1498c0/962c2d4fc4ca0f12fa54d8f4/22d17eb94c85900576fbf53e", version : "130b19167f35ae1dc291873b");
annotation { "Feature Type Name" : "T-Slot Joint", "Editing Logic Function" : "tsEditLogic" }
annotation { "Feature Type Name" : "T-Slot Joint", "Editing Logic Function" : "tsEditLogic" }
export const tSlotJoint = defineFeature(function(context is Context, id is Id, definition is map)
export const tSlotJoint = defineFeature(function(context is Context, id is Id, definition is map)
precondition
precondition
{
{
Copy
Copied
Copy
Copied
annotation { "Name" : "Choose edge face", "Filter" : EntityType.FACE && SketchObject.NO
, "MaxNumberOfPicks" : 1
}
annotation { "Name" : "Choose edge face", "Filter" : EntityType.FACE && SketchObject.NO
}
definition.base is Query;
definition.base is Query;
annotation { "Name" : "Standard", "Lookup Table" : tSlotTable, "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Standard", "Lookup Table" : tSlotTable, "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
definition.connectorStandard is LookupTablePath;
definition.connectorStandard is LookupTablePath;
annotation { "Name" : "Clearance diameter", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Clearance diameter", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.holeD, TSLOT_DIAMETER_LENGTH_BOUNDS);
isLength(definition.holeD, TSLOT_DIAMETER_LENGTH_BOUNDS);
annotation { "Name" : "Nut width", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Nut width", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.nutW, TSLOT_NUT_W_LENGTH_BOUNDS);
isLength(definition.nutW, TSLOT_NUT_W_LENGTH_BOUNDS);
annotation { "Name" : "Nut thickness", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Nut thickness", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.nutT, TSLOT_NUT_T_LENGTH_BOUNDS);
isLength(definition.nutT, TSLOT_NUT_T_LENGTH_BOUNDS);
annotation { "Name" : "Show nut allowance", "UIHint" : "ALWAYS_HIDDEN" }
annotation { "Name" : "Show nut allowance", "UIHint" : "ALWAYS_HIDDEN" }
definition.showNutA is boolean;
definition.showNutA is boolean;
if (definition.showNutA)
if (definition.showNutA)
{
{
annotation { "Name" : "Nut allowance" }
annotation { "Name" : "Nut allowance" }
isLength(definition.nutA, LENGTH_BOUNDS);
isLength(definition.nutA, LENGTH_BOUNDS);
}
}
annotation { "Name" : "Screw length", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Screw length", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.screwLen, TSLOT_SCREWLEN_LENGTH_BOUNDS);
isLength(definition.screwLen, TSLOT_SCREWLEN_LENGTH_BOUNDS);
annotation { "Name" : "Hole termination face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
annotation { "Name" : "Hole termination face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
definition.terminationFace is Query;
definition.terminationFace is Query;
annotation { "Name" : "Switch start side" }
annotation { "Name" : "Switch start side" }
definition.switchStart is boolean;
definition.switchStart is boolean;
annotation { "Name" : "Space from edge", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Space from edge", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.edgeSpace, TSLOT_EDGE_LENGTH_BOUNDS);
isLength(definition.edgeSpace, TSLOT_EDGE_LENGTH_BOUNDS);
annotation { "Name" : "# of connectors" }
annotation { "Name" : "# of connectors" }
isInteger(definition.numConnectors, NUM_CONN_BOUNDS);
isInteger(definition.numConnectors, NUM_CONN_BOUNDS);
Copy
Copied
Copy
Copied
annotation { "Name" : "Equal spacing"
}
annotation { "Name" : "Equal spacing"
, "Default": true
}
definition.equalSpacing is boolean;
definition.equalSpacing is boolean;
if (!definition.equalSpacing)
if (!definition.equalSpacing)
{
{
annotation { "Name" : "Spacing", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
annotation { "Name" : "Spacing", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
isLength(definition.spacing, TSLOT_SPACING_LENGTH_BOUNDS);
isLength(definition.spacing, TSLOT_SPACING_LENGTH_BOUNDS);
annotation { "Name" : "Symmetric" }
annotation { "Name" : "Symmetric" }
definition.symmetric is boolean;
definition.symmetric is boolean;
}
}
}
}
{
{
Copy
Copied
Copy
Copied
var
faceInfo
=
getFaceInfo
(context, definition
);
var
bases
=
evaluateQuery
(context, definition
.base
);
var
faceInfo
;
var
connectionPoints is array = getConnectionPoints(context, definition,
faceInfo
);
var
i
= 0;
for (var
base
in
bases
)
var
connectionCount
= 0;
for (var
connPoint
in
connectionPoints
)
{
{
Copy
Copied
Copy
Copied
connectionCount += 1;
i += 1;
createTSlotJoint(context, id + ("tsj" ~
connectionCount), definition, connPoint
);
faceInfo = getFaceInfo(context, definition, base);
var connectionPoints is array = getConnectionPoints(context, definition, faceInfo);
var connectionCount = 0;
for (var connPoint in connectionPoints)
{
connectionCount += 1;
createTSlotJoint(context, id + ("tsj" ~
i ~
connectionCount), definition, connPoint
, base);
}
}
}
});
});
/*
/*
* Creates geometry for a single T-Slot at the provided coordinate frame.
* Creates geometry for a single T-Slot at the provided coordinate frame.
*/
*/
Copy
Copied
Copy
Copied
function createTSlotJoint(context is Context, id is Id, definition is map, csys is CoordSystem
)
function createTSlotJoint(context is Context, id is Id, definition is map, csys is CoordSystem
, base is Query
)
{
{
var endClearance = 0.25 * definition.holeD;
var endClearance = 0.25 * definition.holeD;
// hole through continuous material
// hole through continuous material
var holeSketchPlane = plane(csys.origin, csys.zAxis, csys.xAxis);
var holeSketchPlane = plane(csys.origin, csys.zAxis, csys.xAxis);
var depth = undefined;
var depth = undefined;
if (evaluateQuery(context, definition.terminationFace) != [])
if (evaluateQuery(context, definition.terminationFace) != [])
{
{
var faceCoords = evPlane(context, {
var faceCoords = evPlane(context, {
"face" : definition.terminationFace
"face" : definition.terminationFace
}).origin;
}).origin;
depth = fromWorld(csys, faceCoords)[2];
depth = fromWorld(csys, faceCoords)[2];
}
}
else
else
{
{
depth = getContinuousDepth(context, id + "cd", {
depth = getContinuousDepth(context, id + "cd", {
"csys" : csys,
"csys" : csys,
"D" : definition.holeD
"D" : definition.holeD
});
});
}
}
if (definition.screwLen - depth - definition.nutT - endClearance < 0)
if (definition.screwLen - depth - definition.nutT - endClearance < 0)
{
{
throw regenError("Screw length is too short for desired connection.", ["screwLen"]);
throw regenError("Screw length is too short for desired connection.", ["screwLen"]);
}
}
var sketch = newSketchOnPlane(context, id + "holeSketch", {
var sketch = newSketchOnPlane(context, id + "holeSketch", {
"sketchPlane" : holeSketchPlane
"sketchPlane" : holeSketchPlane
});
});
skCircle(sketch, "clearanceHole", {
skCircle(sketch, "clearanceHole", {
"center" : vector(0, 0) * inch,
"center" : vector(0, 0) * inch,
"radius" : 0.5 * definition.holeD
"radius" : 0.5 * definition.holeD
});
});
skSolve(sketch);
skSolve(sketch);
if (tolerantEquals(depth, 0 * meter))
if (tolerantEquals(depth, 0 * meter))
{
{
throw regenError("Edge connection does not intersect any clamped parts.", qCreatedBy(id + "holeSketch", EntityType.EDGE));
throw regenError("Edge connection does not intersect any clamped parts.", qCreatedBy(id + "holeSketch", EntityType.EDGE));
}
}
extrude(context, id + "cutHole", {
extrude(context, id + "cutHole", {
"entities" : qSketchRegion(id + "holeSketch"),
"entities" : qSketchRegion(id + "holeSketch"),
"endBound" : BoundingType.BLIND,
"endBound" : BoundingType.BLIND,
"depth" : depth,
"depth" : depth,
"operationType" : NewBodyOperationType.REMOVE
"operationType" : NewBodyOperationType.REMOVE
});
});
opDeleteBodies(context, id + "deleteHoleSketch", {
opDeleteBodies(context, id + "deleteHoleSketch", {
"entities" : qCreatedBy(id + "holeSketch", EntityType.BODY)
"entities" : qCreatedBy(id + "holeSketch", EntityType.BODY)
});
});
// At this point, hole is cut, and depth stores how much of the bolt is in clamped material
// At this point, hole is cut, and depth stores how much of the bolt is in clamped material
// Generate a sketch and cut out the slot for the thread/nut
// Generate a sketch and cut out the slot for the thread/nut
var threadSketchPlane = plane(csys.origin, yAxis(csys), csys.xAxis);
var threadSketchPlane = plane(csys.origin, yAxis(csys), csys.xAxis);
var threadSketch = newSketchOnPlane(context, id + "threadsketch", {
var threadSketch = newSketchOnPlane(context, id + "threadsketch", {
"sketchPlane" : threadSketchPlane
"sketchPlane" : threadSketchPlane
});
});
skRectangle(threadSketch, "screwPocket", {
skRectangle(threadSketch, "screwPocket", {
"firstCorner" : vector(-0.5 * definition.holeD, 0 * meter),
"firstCorner" : vector(-0.5 * definition.holeD, 0 * meter),
"secondCorner" : vector(0.5 * definition.holeD, (definition.screwLen + 2 * definition.nutA) - depth)
"secondCorner" : vector(0.5 * definition.holeD, (definition.screwLen + 2 * definition.nutA) - depth)
});
});
skRectangle(threadSketch, "nutPocket", {
skRectangle(threadSketch, "nutPocket", {
"firstCorner" : vector(-0.5 * definition.nutW - definition.nutA, definition.screwLen - depth - endClearance - (definition.nutT + 2 * definition.nutA)),
"firstCorner" : vector(-0.5 * definition.nutW - definition.nutA, definition.screwLen - depth - endClearance - (definition.nutT + 2 * definition.nutA)),
"secondCorner" : vector(0.5 * definition.nutW + definition.nutA, definition.screwLen - depth - endClearance)
"secondCorner" : vector(0.5 * definition.nutW + definition.nutA, definition.screwLen - depth - endClearance)
});
});
skSolve(threadSketch);
skSolve(threadSketch);
extrude(context, id + "threadExtrude", {
extrude(context, id + "threadExtrude", {
"entities" : qSketchRegion(id + "threadsketch"),
"entities" : qSketchRegion(id + "threadsketch"),
"endBound" : BoundingType.THROUGH_ALL,
"endBound" : BoundingType.THROUGH_ALL,
"hasSecondDirection" : true,
"hasSecondDirection" : true,
"secondDirectionBound" : SecondDirectionBoundingType.THROUGH_ALL,
"secondDirectionBound" : SecondDirectionBoundingType.THROUGH_ALL,
"operationType" : NewBodyOperationType.REMOVE,
"operationType" : NewBodyOperationType.REMOVE,
"defaultScope" : false,
"defaultScope" : false,
Copy
Copied
Copy
Copied
"booleanScope" : qOwnerBody(
definition.
base)
"booleanScope" : qOwnerBody(
base)
});
});
opDeleteBodies(context, id + "deleteThreadSketch", {
opDeleteBodies(context, id + "deleteThreadSketch", {
"entities" : qCreatedBy(id + "threadsketch", EntityType.BODY)
"entities" : qCreatedBy(id + "threadsketch", EntityType.BODY)
});
});
}
}
/*
/*
* Returns a coordinate system and bounding box for the provided face
* Returns a coordinate system and bounding box for the provided face
*/
*/
Copy
Copied
Copy
Copied
function getFaceInfo(context is Context, definition is map
) returns map
function getFaceInfo(context is Context, definition is map
, base is Query
) returns map
{
{
Copy
Copied
Copy
Copied
if (size(evaluateQuery(context,
definition.
base)) != 1)
if (size(evaluateQuery(context,
base)) != 1)
{
{
throw regenError("Cannot generate without edge face selection", ["base"]);
throw regenError("Cannot generate without edge face selection", ["base"]);
}
}
var facePlane = evPlane(context, {
var facePlane = evPlane(context, {
Copy
Copied
Copy
Copied
"face" :
definition.
base
"face" :
base
});
});
Copy
Copied
Copy
Copied
var defaultCSys = planeToCSys(facePlane)
;
var defaultCSys = planeToCSys(facePlane)
as CoordSystem;
try
{
var longEdge = qNthElement(qLargest(qGeometry(qEdgeAdjacent(base, EntityType.EDGE), GeometryType.LINE)), 0);
var axis = evAxis(context, {
"axis" : longEdge
}) as Line;
defaultCSys.xAxis = axis.direction;
}
var bbox = evBox3d(context, {
var bbox = evBox3d(context, {
Copy
Copied
Copy
Copied
"topology" :
definition.
base,
"topology" :
base,
"cSys" : defaultCSys
"cSys" : defaultCSys
});
});
var xrange = bbox.maxCorner[0] - bbox.minCorner[0];
var xrange = bbox.maxCorner[0] - bbox.minCorner[0];
var yrange = bbox.maxCorner[1] - bbox.minCorner[1];
var yrange = bbox.maxCorner[1] - bbox.minCorner[1];
Copy
Copied
Copy
Copied
// generate a coordinate system such that x is along the long dimension of the face
// generate a coordinate system such that x is along the long dimension of the face
var csys is CoordSystem = coordSystem(facePlane.origin,
var csys is CoordSystem = coordSystem(facePlane.origin,
(xrange > yrange) ? defaultCSys.xAxis : yAxis(defaultCSys),
(xrange > yrange) ? defaultCSys.xAxis : yAxis(defaultCSys),
facePlane.normal);
facePlane.normal);
bbox = evBox3d(context, {
bbox = evBox3d(context, {
Copy
Copied
Copy
Copied
"topology" :
definition.
base,
"topology" :
base,
"cSys" : csys
"cSys" : csys
});
});
return { "csys" : csys, "bbox" : bbox };
return { "csys" : csys, "bbox" : bbox };
}
}
/*
/*
* Given feature parameters and face selection, generates array of points at which T-Slots will be created
* Given feature parameters and face selection, generates array of points at which T-Slots will be created
*/
*/
function getConnectionPoints(context is Context, definition is map, faceInfo is map) returns array
function getConnectionPoints(context is Context, definition is map, faceInfo is map) returns array
{
{
if (definition.equalSpacing)
if (definition.equalSpacing)
{
{
definition.symmetric = false;
definition.symmetric = false;
var length = faceInfo.bbox.maxCorner[0] - faceInfo.bbox.minCorner[0];
var length = faceInfo.bbox.maxCorner[0] - faceInfo.bbox.minCorner[0];
Copy
Copied
Copy
Copied
definition.spacing = (length - 2 * definition.edgeSpace) / (definition.numConnectors - 1);
if (definition.numConnectors > 1)
{
definition.spacing = (length - 2 * definition.edgeSpace) / (definition.numConnectors - 1);
}
else
{
definition.edgeSpace = length / 2;
}
}
}
var coordList = makeCoordArray(context, definition, faceInfo);
var coordList = makeCoordArray(context, definition, faceInfo);
if (definition.symmetric)
if (definition.symmetric)
{
{
var localDefinition = definition;
var localDefinition = definition;
localDefinition.switchStart = !localDefinition.switchStart;
localDefinition.switchStart = !localDefinition.switchStart;
var symmetricCoordList = makeCoordArray(context, localDefinition, faceInfo);
var symmetricCoordList = makeCoordArray(context, localDefinition, faceInfo);
coordList = concatenateArrays([coordList, symmetricCoordList]);
coordList = concatenateArrays([coordList, symmetricCoordList]);
}
}
return coordList;
return coordList;
}
}
function makeCoordArray(context is Context, definition is map, faceInfo is map) returns array
function makeCoordArray(context is Context, definition is map, faceInfo is map) returns array
{
{
var coordArray is array = makeArray(definition.numConnectors);
var coordArray is array = makeArray(definition.numConnectors);
var sense = (definition.switchStart) ? -1 : 1;
var sense = (definition.switchStart) ? -1 : 1;
var startx = ((definition.switchStart) ? faceInfo.bbox.maxCorner[0] : faceInfo.bbox.minCorner[0]) + sense * definition.edgeSpace;
var startx = ((definition.switchStart) ? faceInfo.bbox.maxCorner[0] : faceInfo.bbox.minCorner[0]) + sense * definition.edgeSpace;
var dir = faceInfo.csys.xAxis;
var dir = faceInfo.csys.xAxis;
var startOrigin = faceInfo.csys.origin + startx * dir;
var startOrigin = faceInfo.csys.origin + startx * dir;
for (var i = 0; i < definition.numConnectors; i += 1)
for (var i = 0; i < definition.numConnectors; i += 1)
{
{
coordArray[i] = coordSystem(startOrigin + sense * definition.spacing * dir * i, dir, faceInfo.csys.zAxis);
coordArray[i] = coordSystem(startOrigin + sense * definition.spacing * dir * i, dir, faceInfo.csys.zAxis);
}
}
return coordArray;
return coordArray;
}
}
export function tsEditLogic(context is Context, id is Id, oldDefinition is map, definition is map,
export function tsEditLogic(context is Context, id is Id, oldDefinition is map, definition is map,
isCreating is boolean, specifiedParameters is map, hiddenBodies is Query) returns map
isCreating is boolean, specifiedParameters is map, hiddenBodies is Query) returns map
{
{
if (oldDefinition.connectorStandard != definition.connectorStandard)
if (oldDefinition.connectorStandard != definition.connectorStandard)
{
{
definition = updateTSDefinitionWithStandard(oldDefinition, definition);
definition = updateTSDefinitionWithStandard(oldDefinition, definition);
}
}
definition = setToCustomIfStandardViolated(definition);
definition = setToCustomIfStandardViolated(definition);
Copy
Copied
Copy
Copied
if (definition.equalSpacing)
//
if (definition.equalSpacing)
{
//
{
definition.numConnectors = max(2, definition.numConnectors);
//
definition.numConnectors = max(2, definition.numConnectors);
}
//
}
return definition;
return definition;
}
}
export function updateTSDefinitionWithStandard(oldDefinition is map, definition is map) returns map
export function updateTSDefinitionWithStandard(oldDefinition is map, definition is map) returns map
{
{
var table = getLookupTable(tSlotTable, definition.connectorStandard);
var table = getLookupTable(tSlotTable, definition.connectorStandard);
definition.showNutA = false;
definition.showNutA = false;
for (var entry in table)
for (var entry in table)
{
{
definition[entry.key] = lookupTableFixExpression(entry.value);
definition[entry.key] = lookupTableFixExpression(entry.value);
}
}
return definition;
return definition;
}
}
function setToCustomIfStandardViolated(definition is map) returns map
function setToCustomIfStandardViolated(definition is map) returns map
{
{
var table = getLookupTable(tSlotTable, definition.connectorStandard);
var table = getLookupTable(tSlotTable, definition.connectorStandard);
if (isLookupTableViolated(definition, table))
if (isLookupTableViolated(definition, table))
{
{
definition.connectorStandard = lookupTablePath({ "standard" : "Custom" });
definition.connectorStandard = lookupTablePath({ "standard" : "Custom" });
definition.showNutA = true;
definition.showNutA = true;
}
}
return definition;
return definition;
}
}
export const NUM_CONN_BOUNDS =
export const NUM_CONN_BOUNDS =
{
{
"min" : 1,
"min" : 1,
"max" : 500,
"max" : 500,
(unitless) : [1, 1, 500]
(unitless) : [1, 1, 500]
} as IntegerBoundSpec;
} as IntegerBoundSpec;
export const TSLOT_DIAMETER_LENGTH_BOUNDS =
export const TSLOT_DIAMETER_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.1285, 19685]
(inch) : [1e-4, 0.1285, 19685]
} as LengthBoundSpec;
} as LengthBoundSpec;
export const TSLOT_NUT_W_LENGTH_BOUNDS =
export const TSLOT_NUT_W_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.25, 19685]
(inch) : [1e-4, 0.25, 19685]
} as LengthBoundSpec;
} as LengthBoundSpec;
export const TSLOT_NUT_T_LENGTH_BOUNDS =
export const TSLOT_NUT_T_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.09375, 19685]
(inch) : [1e-4, 0.09375, 19685]
} as LengthBoundSpec;
} as LengthBoundSpec;
export const TSLOT_SCREWLEN_LENGTH_BOUNDS =
export const TSLOT_SCREWLEN_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.625, 19685],
(inch) : [1e-4, 0.625, 19685],
(millimeter) : 15,
(millimeter) : 15,
(centimeter) : 1.5
(centimeter) : 1.5
} as LengthBoundSpec;
} as LengthBoundSpec;
export const TSLOT_EDGE_LENGTH_BOUNDS =
export const TSLOT_EDGE_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.5, 19685],
(inch) : [1e-4, 0.5, 19685],
(millimeter) : 10,
(millimeter) : 10,
(centimeter) : 1
(centimeter) : 1
} as LengthBoundSpec;
} as LengthBoundSpec;
export const TSLOT_SPACING_LENGTH_BOUNDS =
export const TSLOT_SPACING_LENGTH_BOUNDS =
{
{
"min" : -TOLERANCE.zeroLength * meter,
"min" : -TOLERANCE.zeroLength * meter,
"max" : 500 * meter,
"max" : 500 * meter,
(inch) : [1e-4, 0.375, 19685],
(inch) : [1e-4, 0.375, 19685],
(millimeter) : 10,
(millimeter) : 10,
(centimeter) : 1
(centimeter) : 1
} as LengthBoundSpec;
} as LengthBoundSpec;
Saved diffs
Original text
Open file
/* T-Slot Joint This custom feature adds a bolted T-slot connection between two planar parts. Version 1.0 - July 6, 2016 - Arul Suresh - Initial development and validation. Version 2.0 - July 20, 2016 - Arul Suresh - Added some utility functions, lookup tables. Initial forum release. Version 2.1 - Sept 18, 2016 - Arul Suresh - Update to newest FS, published release. Version 2.1.1 - Sept 18, 2016 - Arul Suresh - Document description. */ FeatureScript 422; import(path : "onshape/std/geometry.fs", version : "422.0"); import(path : "4dfdd9c6856db10dd896e29b", version : "c92857bc5898d90ad6f21cc3"); import(path : "f4e7238da5afaf5a3f1498c0/962c2d4fc4ca0f12fa54d8f4/22d17eb94c85900576fbf53e", version : "130b19167f35ae1dc291873b"); annotation { "Feature Type Name" : "T-Slot Joint", "Editing Logic Function" : "tsEditLogic" } export const tSlotJoint = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Choose edge face", "Filter" : EntityType.FACE && SketchObject.NO, "MaxNumberOfPicks" : 1 } definition.base is Query; annotation { "Name" : "Standard", "Lookup Table" : tSlotTable, "UIHint" : "REMEMBER_PREVIOUS_VALUE" } definition.connectorStandard is LookupTablePath; annotation { "Name" : "Clearance diameter", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.holeD, TSLOT_DIAMETER_LENGTH_BOUNDS); annotation { "Name" : "Nut width", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.nutW, TSLOT_NUT_W_LENGTH_BOUNDS); annotation { "Name" : "Nut thickness", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.nutT, TSLOT_NUT_T_LENGTH_BOUNDS); annotation { "Name" : "Show nut allowance", "UIHint" : "ALWAYS_HIDDEN" } definition.showNutA is boolean; if (definition.showNutA) { annotation { "Name" : "Nut allowance" } isLength(definition.nutA, LENGTH_BOUNDS); } annotation { "Name" : "Screw length", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.screwLen, TSLOT_SCREWLEN_LENGTH_BOUNDS); annotation { "Name" : "Hole termination face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 } definition.terminationFace is Query; annotation { "Name" : "Switch start side" } definition.switchStart is boolean; annotation { "Name" : "Space from edge", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.edgeSpace, TSLOT_EDGE_LENGTH_BOUNDS); annotation { "Name" : "# of connectors" } isInteger(definition.numConnectors, NUM_CONN_BOUNDS); annotation { "Name" : "Equal spacing" } definition.equalSpacing is boolean; if (!definition.equalSpacing) { annotation { "Name" : "Spacing", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.spacing, TSLOT_SPACING_LENGTH_BOUNDS); annotation { "Name" : "Symmetric" } definition.symmetric is boolean; } } { var faceInfo = getFaceInfo(context, definition); var connectionPoints is array = getConnectionPoints(context, definition, faceInfo); var connectionCount = 0; for (var connPoint in connectionPoints) { connectionCount += 1; createTSlotJoint(context, id + ("tsj" ~ connectionCount), definition, connPoint); } }); /* * Creates geometry for a single T-Slot at the provided coordinate frame. */ function createTSlotJoint(context is Context, id is Id, definition is map, csys is CoordSystem) { var endClearance = 0.25 * definition.holeD; // hole through continuous material var holeSketchPlane = plane(csys.origin, csys.zAxis, csys.xAxis); var depth = undefined; if (evaluateQuery(context, definition.terminationFace) != []) { var faceCoords = evPlane(context, { "face" : definition.terminationFace }).origin; depth = fromWorld(csys, faceCoords)[2]; } else { depth = getContinuousDepth(context, id + "cd", { "csys" : csys, "D" : definition.holeD }); } if (definition.screwLen - depth - definition.nutT - endClearance < 0) { throw regenError("Screw length is too short for desired connection.", ["screwLen"]); } var sketch = newSketchOnPlane(context, id + "holeSketch", { "sketchPlane" : holeSketchPlane }); skCircle(sketch, "clearanceHole", { "center" : vector(0, 0) * inch, "radius" : 0.5 * definition.holeD }); skSolve(sketch); if (tolerantEquals(depth, 0 * meter)) { throw regenError("Edge connection does not intersect any clamped parts.", qCreatedBy(id + "holeSketch", EntityType.EDGE)); } extrude(context, id + "cutHole", { "entities" : qSketchRegion(id + "holeSketch"), "endBound" : BoundingType.BLIND, "depth" : depth, "operationType" : NewBodyOperationType.REMOVE }); opDeleteBodies(context, id + "deleteHoleSketch", { "entities" : qCreatedBy(id + "holeSketch", EntityType.BODY) }); // At this point, hole is cut, and depth stores how much of the bolt is in clamped material // Generate a sketch and cut out the slot for the thread/nut var threadSketchPlane = plane(csys.origin, yAxis(csys), csys.xAxis); var threadSketch = newSketchOnPlane(context, id + "threadsketch", { "sketchPlane" : threadSketchPlane }); skRectangle(threadSketch, "screwPocket", { "firstCorner" : vector(-0.5 * definition.holeD, 0 * meter), "secondCorner" : vector(0.5 * definition.holeD, (definition.screwLen + 2 * definition.nutA) - depth) }); skRectangle(threadSketch, "nutPocket", { "firstCorner" : vector(-0.5 * definition.nutW - definition.nutA, definition.screwLen - depth - endClearance - (definition.nutT + 2 * definition.nutA)), "secondCorner" : vector(0.5 * definition.nutW + definition.nutA, definition.screwLen - depth - endClearance) }); skSolve(threadSketch); extrude(context, id + "threadExtrude", { "entities" : qSketchRegion(id + "threadsketch"), "endBound" : BoundingType.THROUGH_ALL, "hasSecondDirection" : true, "secondDirectionBound" : SecondDirectionBoundingType.THROUGH_ALL, "operationType" : NewBodyOperationType.REMOVE, "defaultScope" : false, "booleanScope" : qOwnerBody(definition.base) }); opDeleteBodies(context, id + "deleteThreadSketch", { "entities" : qCreatedBy(id + "threadsketch", EntityType.BODY) }); } /* * Returns a coordinate system and bounding box for the provided face */ function getFaceInfo(context is Context, definition is map) returns map { if (size(evaluateQuery(context, definition.base)) != 1) { throw regenError("Cannot generate without edge face selection", ["base"]); } var facePlane = evPlane(context, { "face" : definition.base }); var defaultCSys = planeToCSys(facePlane); var bbox = evBox3d(context, { "topology" : definition.base, "cSys" : defaultCSys }); var xrange = bbox.maxCorner[0] - bbox.minCorner[0]; var yrange = bbox.maxCorner[1] - bbox.minCorner[1]; // generate a coordinate system such that x is along the long dimension of the face var csys is CoordSystem = coordSystem(facePlane.origin, (xrange > yrange) ? defaultCSys.xAxis : yAxis(defaultCSys), facePlane.normal); bbox = evBox3d(context, { "topology" : definition.base, "cSys" : csys }); return { "csys" : csys, "bbox" : bbox }; } /* * Given feature parameters and face selection, generates array of points at which T-Slots will be created */ function getConnectionPoints(context is Context, definition is map, faceInfo is map) returns array { if (definition.equalSpacing) { definition.symmetric = false; var length = faceInfo.bbox.maxCorner[0] - faceInfo.bbox.minCorner[0]; definition.spacing = (length - 2 * definition.edgeSpace) / (definition.numConnectors - 1); } var coordList = makeCoordArray(context, definition, faceInfo); if (definition.symmetric) { var localDefinition = definition; localDefinition.switchStart = !localDefinition.switchStart; var symmetricCoordList = makeCoordArray(context, localDefinition, faceInfo); coordList = concatenateArrays([coordList, symmetricCoordList]); } return coordList; } function makeCoordArray(context is Context, definition is map, faceInfo is map) returns array { var coordArray is array = makeArray(definition.numConnectors); var sense = (definition.switchStart) ? -1 : 1; var startx = ((definition.switchStart) ? faceInfo.bbox.maxCorner[0] : faceInfo.bbox.minCorner[0]) + sense * definition.edgeSpace; var dir = faceInfo.csys.xAxis; var startOrigin = faceInfo.csys.origin + startx * dir; for (var i = 0; i < definition.numConnectors; i += 1) { coordArray[i] = coordSystem(startOrigin + sense * definition.spacing * dir * i, dir, faceInfo.csys.zAxis); } return coordArray; } export function tsEditLogic(context is Context, id is Id, oldDefinition is map, definition is map, isCreating is boolean, specifiedParameters is map, hiddenBodies is Query) returns map { if (oldDefinition.connectorStandard != definition.connectorStandard) { definition = updateTSDefinitionWithStandard(oldDefinition, definition); } definition = setToCustomIfStandardViolated(definition); if (definition.equalSpacing) { definition.numConnectors = max(2, definition.numConnectors); } return definition; } export function updateTSDefinitionWithStandard(oldDefinition is map, definition is map) returns map { var table = getLookupTable(tSlotTable, definition.connectorStandard); definition.showNutA = false; for (var entry in table) { definition[entry.key] = lookupTableFixExpression(entry.value); } return definition; } function setToCustomIfStandardViolated(definition is map) returns map { var table = getLookupTable(tSlotTable, definition.connectorStandard); if (isLookupTableViolated(definition, table)) { definition.connectorStandard = lookupTablePath({ "standard" : "Custom" }); definition.showNutA = true; } return definition; } export const NUM_CONN_BOUNDS = { "min" : 1, "max" : 500, (unitless) : [1, 1, 500] } as IntegerBoundSpec; export const TSLOT_DIAMETER_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.1285, 19685] } as LengthBoundSpec; export const TSLOT_NUT_W_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.25, 19685] } as LengthBoundSpec; export const TSLOT_NUT_T_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.09375, 19685] } as LengthBoundSpec; export const TSLOT_SCREWLEN_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.625, 19685], (millimeter) : 15, (centimeter) : 1.5 } as LengthBoundSpec; export const TSLOT_EDGE_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.5, 19685], (millimeter) : 10, (centimeter) : 1 } as LengthBoundSpec; export const TSLOT_SPACING_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.375, 19685], (millimeter) : 10, (centimeter) : 1 } as LengthBoundSpec;
Changed text
Open file
/* T-Slot Joint This custom feature adds a bolted T-slot connection between two planar parts. Version 1.0 - July 6, 2016 - Arul Suresh - Initial development and validation. Version 2.0 - July 20, 2016 - Arul Suresh - Added some utility functions, lookup tables. Initial forum release. Version 2.1 - Sept 18, 2016 - Arul Suresh - Update to newest FS, published release. Version 2.1.1 - Sept 18, 2016 - Arul Suresh - Document description. Version 2.2 - April 7, 2017 - Eric Miller - Added single-hole centered spacing and multiple plane selection, and fixed handling of angled surfaces. */ FeatureScript 422; import(path : "onshape/std/geometry.fs", version : "422.0"); import(path : "5695a84e0bdf321f1d91df84", version : "90245e5cbffb04b2d7c533ad"); import(path : "f4e7238da5afaf5a3f1498c0/962c2d4fc4ca0f12fa54d8f4/22d17eb94c85900576fbf53e", version : "130b19167f35ae1dc291873b"); annotation { "Feature Type Name" : "T-Slot Joint", "Editing Logic Function" : "tsEditLogic" } export const tSlotJoint = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Choose edge face", "Filter" : EntityType.FACE && SketchObject.NO } definition.base is Query; annotation { "Name" : "Standard", "Lookup Table" : tSlotTable, "UIHint" : "REMEMBER_PREVIOUS_VALUE" } definition.connectorStandard is LookupTablePath; annotation { "Name" : "Clearance diameter", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.holeD, TSLOT_DIAMETER_LENGTH_BOUNDS); annotation { "Name" : "Nut width", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.nutW, TSLOT_NUT_W_LENGTH_BOUNDS); annotation { "Name" : "Nut thickness", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.nutT, TSLOT_NUT_T_LENGTH_BOUNDS); annotation { "Name" : "Show nut allowance", "UIHint" : "ALWAYS_HIDDEN" } definition.showNutA is boolean; if (definition.showNutA) { annotation { "Name" : "Nut allowance" } isLength(definition.nutA, LENGTH_BOUNDS); } annotation { "Name" : "Screw length", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.screwLen, TSLOT_SCREWLEN_LENGTH_BOUNDS); annotation { "Name" : "Hole termination face", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 } definition.terminationFace is Query; annotation { "Name" : "Switch start side" } definition.switchStart is boolean; annotation { "Name" : "Space from edge", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.edgeSpace, TSLOT_EDGE_LENGTH_BOUNDS); annotation { "Name" : "# of connectors" } isInteger(definition.numConnectors, NUM_CONN_BOUNDS); annotation { "Name" : "Equal spacing", "Default": true } definition.equalSpacing is boolean; if (!definition.equalSpacing) { annotation { "Name" : "Spacing", "UIHint" : "REMEMBER_PREVIOUS_VALUE" } isLength(definition.spacing, TSLOT_SPACING_LENGTH_BOUNDS); annotation { "Name" : "Symmetric" } definition.symmetric is boolean; } } { var bases = evaluateQuery(context, definition.base); var faceInfo; var i = 0; for (var base in bases) { i += 1; faceInfo = getFaceInfo(context, definition, base); var connectionPoints is array = getConnectionPoints(context, definition, faceInfo); var connectionCount = 0; for (var connPoint in connectionPoints) { connectionCount += 1; createTSlotJoint(context, id + ("tsj" ~ i ~ connectionCount), definition, connPoint, base); } } }); /* * Creates geometry for a single T-Slot at the provided coordinate frame. */ function createTSlotJoint(context is Context, id is Id, definition is map, csys is CoordSystem, base is Query) { var endClearance = 0.25 * definition.holeD; // hole through continuous material var holeSketchPlane = plane(csys.origin, csys.zAxis, csys.xAxis); var depth = undefined; if (evaluateQuery(context, definition.terminationFace) != []) { var faceCoords = evPlane(context, { "face" : definition.terminationFace }).origin; depth = fromWorld(csys, faceCoords)[2]; } else { depth = getContinuousDepth(context, id + "cd", { "csys" : csys, "D" : definition.holeD }); } if (definition.screwLen - depth - definition.nutT - endClearance < 0) { throw regenError("Screw length is too short for desired connection.", ["screwLen"]); } var sketch = newSketchOnPlane(context, id + "holeSketch", { "sketchPlane" : holeSketchPlane }); skCircle(sketch, "clearanceHole", { "center" : vector(0, 0) * inch, "radius" : 0.5 * definition.holeD }); skSolve(sketch); if (tolerantEquals(depth, 0 * meter)) { throw regenError("Edge connection does not intersect any clamped parts.", qCreatedBy(id + "holeSketch", EntityType.EDGE)); } extrude(context, id + "cutHole", { "entities" : qSketchRegion(id + "holeSketch"), "endBound" : BoundingType.BLIND, "depth" : depth, "operationType" : NewBodyOperationType.REMOVE }); opDeleteBodies(context, id + "deleteHoleSketch", { "entities" : qCreatedBy(id + "holeSketch", EntityType.BODY) }); // At this point, hole is cut, and depth stores how much of the bolt is in clamped material // Generate a sketch and cut out the slot for the thread/nut var threadSketchPlane = plane(csys.origin, yAxis(csys), csys.xAxis); var threadSketch = newSketchOnPlane(context, id + "threadsketch", { "sketchPlane" : threadSketchPlane }); skRectangle(threadSketch, "screwPocket", { "firstCorner" : vector(-0.5 * definition.holeD, 0 * meter), "secondCorner" : vector(0.5 * definition.holeD, (definition.screwLen + 2 * definition.nutA) - depth) }); skRectangle(threadSketch, "nutPocket", { "firstCorner" : vector(-0.5 * definition.nutW - definition.nutA, definition.screwLen - depth - endClearance - (definition.nutT + 2 * definition.nutA)), "secondCorner" : vector(0.5 * definition.nutW + definition.nutA, definition.screwLen - depth - endClearance) }); skSolve(threadSketch); extrude(context, id + "threadExtrude", { "entities" : qSketchRegion(id + "threadsketch"), "endBound" : BoundingType.THROUGH_ALL, "hasSecondDirection" : true, "secondDirectionBound" : SecondDirectionBoundingType.THROUGH_ALL, "operationType" : NewBodyOperationType.REMOVE, "defaultScope" : false, "booleanScope" : qOwnerBody(base) }); opDeleteBodies(context, id + "deleteThreadSketch", { "entities" : qCreatedBy(id + "threadsketch", EntityType.BODY) }); } /* * Returns a coordinate system and bounding box for the provided face */ function getFaceInfo(context is Context, definition is map, base is Query) returns map { if (size(evaluateQuery(context, base)) != 1) { throw regenError("Cannot generate without edge face selection", ["base"]); } var facePlane = evPlane(context, { "face" : base }); var defaultCSys = planeToCSys(facePlane) as CoordSystem; try { var longEdge = qNthElement(qLargest(qGeometry(qEdgeAdjacent(base, EntityType.EDGE), GeometryType.LINE)), 0); var axis = evAxis(context, { "axis" : longEdge }) as Line; defaultCSys.xAxis = axis.direction; } var bbox = evBox3d(context, { "topology" : base, "cSys" : defaultCSys }); var xrange = bbox.maxCorner[0] - bbox.minCorner[0]; var yrange = bbox.maxCorner[1] - bbox.minCorner[1]; // generate a coordinate system such that x is along the long dimension of the face var csys is CoordSystem = coordSystem(facePlane.origin, (xrange > yrange) ? defaultCSys.xAxis : yAxis(defaultCSys), facePlane.normal); bbox = evBox3d(context, { "topology" : base, "cSys" : csys }); return { "csys" : csys, "bbox" : bbox }; } /* * Given feature parameters and face selection, generates array of points at which T-Slots will be created */ function getConnectionPoints(context is Context, definition is map, faceInfo is map) returns array { if (definition.equalSpacing) { definition.symmetric = false; var length = faceInfo.bbox.maxCorner[0] - faceInfo.bbox.minCorner[0]; if (definition.numConnectors > 1) { definition.spacing = (length - 2 * definition.edgeSpace) / (definition.numConnectors - 1); } else { definition.edgeSpace = length / 2; } } var coordList = makeCoordArray(context, definition, faceInfo); if (definition.symmetric) { var localDefinition = definition; localDefinition.switchStart = !localDefinition.switchStart; var symmetricCoordList = makeCoordArray(context, localDefinition, faceInfo); coordList = concatenateArrays([coordList, symmetricCoordList]); } return coordList; } function makeCoordArray(context is Context, definition is map, faceInfo is map) returns array { var coordArray is array = makeArray(definition.numConnectors); var sense = (definition.switchStart) ? -1 : 1; var startx = ((definition.switchStart) ? faceInfo.bbox.maxCorner[0] : faceInfo.bbox.minCorner[0]) + sense * definition.edgeSpace; var dir = faceInfo.csys.xAxis; var startOrigin = faceInfo.csys.origin + startx * dir; for (var i = 0; i < definition.numConnectors; i += 1) { coordArray[i] = coordSystem(startOrigin + sense * definition.spacing * dir * i, dir, faceInfo.csys.zAxis); } return coordArray; } export function tsEditLogic(context is Context, id is Id, oldDefinition is map, definition is map, isCreating is boolean, specifiedParameters is map, hiddenBodies is Query) returns map { if (oldDefinition.connectorStandard != definition.connectorStandard) { definition = updateTSDefinitionWithStandard(oldDefinition, definition); } definition = setToCustomIfStandardViolated(definition); // if (definition.equalSpacing) // { // definition.numConnectors = max(2, definition.numConnectors); // } return definition; } export function updateTSDefinitionWithStandard(oldDefinition is map, definition is map) returns map { var table = getLookupTable(tSlotTable, definition.connectorStandard); definition.showNutA = false; for (var entry in table) { definition[entry.key] = lookupTableFixExpression(entry.value); } return definition; } function setToCustomIfStandardViolated(definition is map) returns map { var table = getLookupTable(tSlotTable, definition.connectorStandard); if (isLookupTableViolated(definition, table)) { definition.connectorStandard = lookupTablePath({ "standard" : "Custom" }); definition.showNutA = true; } return definition; } export const NUM_CONN_BOUNDS = { "min" : 1, "max" : 500, (unitless) : [1, 1, 500] } as IntegerBoundSpec; export const TSLOT_DIAMETER_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.1285, 19685] } as LengthBoundSpec; export const TSLOT_NUT_W_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.25, 19685] } as LengthBoundSpec; export const TSLOT_NUT_T_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.09375, 19685] } as LengthBoundSpec; export const TSLOT_SCREWLEN_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.625, 19685], (millimeter) : 15, (centimeter) : 1.5 } as LengthBoundSpec; export const TSLOT_EDGE_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.5, 19685], (millimeter) : 10, (centimeter) : 1 } as LengthBoundSpec; export const TSLOT_SPACING_LENGTH_BOUNDS = { "min" : -TOLERANCE.zeroLength * meter, "max" : 500 * meter, (inch) : [1e-4, 0.375, 19685], (millimeter) : 10, (centimeter) : 1 } as LengthBoundSpec;
Find difference