@toolpath/dfm 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -488,7 +488,7 @@ var FEATURE_METRICS = [
488
488
  op: "gte",
489
489
  start: { mm: 500, inch: 508 },
490
490
  path: ["facts.wallLength.length", "facts.length"],
491
- kinds: ["Pocket", "Boss", "Wall", "Profile"],
491
+ kinds: ["Pocket", "Boss", "Wall", "CircularWall", "Profile"],
492
492
  hint: "How far a pass around its outline travels, with a tool of no width"
493
493
  }),
494
494
  define({
@@ -980,11 +980,11 @@ var GROUP_SUBJECTS = [
980
980
  { value: "pocket", label: "Pockets", group: "Groups", kinds: POCKET_KINDS },
981
981
  { value: "slot", label: "Slots", group: "Groups", kinds: UNDERCUT_KINDS },
982
982
  { value: "undercut", label: "Undercuts", group: "Groups", kinds: UNDERCUT_KINDS },
983
- { value: "boss", label: "Bosses", group: "Groups", kinds: ["Boss"] },
983
+ { value: "boss", label: "Bosses", group: "Groups", kinds: ["Boss", "CircularWall"] },
984
984
  { value: "countersink", label: "Countersinks", group: "Groups", kinds: ["Hole", "Chamfer"] },
985
985
  { value: "profile", label: "Profiles", group: "Groups", kinds: ["Profile"] },
986
986
  { value: "contour", label: "3D surfaces", group: "Groups", kinds: SURFACE_KINDS },
987
- { value: "wall", label: "Walls", group: "Groups", kinds: ["Wall"] },
987
+ { value: "wall", label: "Walls", group: "Groups", kinds: ["Wall", "CircularWall"] },
988
988
  { value: "face", label: "Faces", group: "Groups", kinds: ["Face", "Three"] },
989
989
  { value: "fillet", label: "Fillets", group: "Groups", kinds: SURFACE_KINDS },
990
990
  { value: "chamfer", label: "Chamfers", group: "Groups", kinds: ["Chamfer"] }
@@ -1007,6 +1007,7 @@ var TYPES = [
1007
1007
  ["filleted_open_pocket", "Filleted open pockets", POCKET_KINDS],
1008
1008
  ["boss", "Bosses", ["Boss"]],
1009
1009
  ["filleted_boss", "Filleted bosses", ["Boss"]],
1010
+ ["circular_wall", "Circular walls", ["CircularWall"]],
1010
1011
  ["wall", "Wall features", ["Wall"]],
1011
1012
  ["face", "Face features", ["Face"]],
1012
1013
  ["slanted_face", "Slanted faces", ["Face", "Three"]],
@@ -1339,6 +1340,7 @@ var howCut = (sheet) => {
1339
1340
  var featureIs = (subject, featureType, sheet) => {
1340
1341
  const type = featureType.toLowerCase();
1341
1342
  const kind = sheet?.kind?.toLowerCase() ?? "";
1343
+ const boss = sheet?.standsOnAFloor === true;
1342
1344
  if (subject.startsWith(TYPE_SUBJECT)) return type === subject.slice(TYPE_SUBJECT.length);
1343
1345
  switch (subject) {
1344
1346
  case "any":
@@ -1360,7 +1362,7 @@ var featureIs = (subject, featureType, sheet) => {
1360
1362
  case "contour":
1361
1363
  return type.includes("contour") || kind.includes("contour");
1362
1364
  case "wall":
1363
- return type.includes("wall") || kind === "wall";
1365
+ return !boss && (type.includes("wall") || kind === "wall");
1364
1366
  case "face":
1365
1367
  return type === "face" || kind === "face";
1366
1368
  case "fillet":
@@ -1368,7 +1370,7 @@ var featureIs = (subject, featureType, sheet) => {
1368
1370
  case "chamfer":
1369
1371
  return type.includes("chamfer") || kind === "chamfer";
1370
1372
  case "boss":
1371
- return type.includes("boss") || kind === "boss";
1373
+ return boss || type.includes("boss") || kind === "boss";
1372
1374
  case "countersink":
1373
1375
  return type === "sink";
1374
1376
  case "profile":
@@ -1725,6 +1727,7 @@ var featureSheet = (datasheet) => {
1725
1727
  fields.fitToolDiameter = asNumber2(toolFit.toolDiameter);
1726
1728
  fields.fitCornerRadius = asNumber2(toolFit.cornerRadius);
1727
1729
  const ballOnly = (facts.useOnlyBallToolsForFinish ?? recordOf2(facts.three).useOnlyBallToolsForFinish) === true;
1730
+ const standsOnAFloor = kind === "CircularWall" && facts.standsOnAFloor === true;
1728
1731
  const measured = Object.fromEntries(
1729
1732
  Object.entries(fields).filter(([, value]) => value !== void 0)
1730
1733
  );
@@ -1751,6 +1754,7 @@ var featureSheet = (datasheet) => {
1751
1754
  ...sharp ? { sharpCorners: pinchCentres(sheet.pinchPoints) } : {},
1752
1755
  ...cramped ? { noToolFits: true } : {},
1753
1756
  ...ballOnly ? { ballOnly: true } : {},
1757
+ ...standsOnAFloor ? { standsOnAFloor: true } : {},
1754
1758
  ...threading ? { threading } : {},
1755
1759
  ...undercut ? { undercut } : {}
1756
1760
  };
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ import {
63
63
  withOp,
64
64
  withSubject,
65
65
  withSurroundedFaces
66
- } from "./chunk-XHYPKN4E.js";
66
+ } from "./chunk-IB42AM6A.js";
67
67
  export {
68
68
  CRITICAL_COLOR,
69
69
  FILE_KIND,
@@ -123,6 +123,12 @@ interface FeatureSheet {
123
123
  toolFitPath?: string;
124
124
  /** For a contour surface: only a ball end mill can finish it, not a bull nose. */
125
125
  ballOnly?: true;
126
+ /**
127
+ * For a circular wall — the outside of a whole cylinder: it rises from a
128
+ * floor, so it is machined as a boss, as a stud or round boss is, rather than
129
+ * as a wall, as a turned part's outline is.
130
+ */
131
+ standsOnAFloor?: true;
126
132
  /**
127
133
  * The feature's minimum clearance: the smallest of its pinch discs
128
134
  * (`pinchPoints`), the tolerance taken out, leaving out the zero-wide ones
@@ -248,7 +254,7 @@ type DfmOp = 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'ne' | 'between';
248
254
  */
249
255
  type DfmQuantity = 'length' | 'area' | 'angle' | 'ratio' | 'count' | 'percent' | 'flag' | 'presence';
250
256
  /** A datasheet's `facts.kind`: which family of measurements the Engine took. */
251
- type FactsKind = 'Hole' | 'Pocket' | 'Boss' | 'Wall' | 'Face' | 'Three' | 'Chamfer' | 'Profile' | 'Dovetail' | 'Tslot';
257
+ type FactsKind = 'Hole' | 'Pocket' | 'Boss' | 'Wall' | 'CircularWall' | 'Face' | 'Three' | 'Chamfer' | 'Profile' | 'Dovetail' | 'Tslot';
252
258
  /** A datasheet's `facts.kind`, milled or turned. */
253
259
  type AnyFactsKind = FactsKind | TurnedFactsKind;
254
260
  interface DfmMetric {
@@ -63,7 +63,7 @@ import {
63
63
  withOp,
64
64
  withSubject,
65
65
  withSurroundedFaces
66
- } from "../chunk-XHYPKN4E.js";
66
+ } from "../chunk-IB42AM6A.js";
67
67
  export {
68
68
  CRITICAL_COLOR,
69
69
  FILE_KIND,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolpath/dfm",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Toolpath DFM rules: the rules, the part checker, and the rule-set file. Logic only; the views are in @toolpath/ui",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -47,7 +47,7 @@
47
47
  "tsup": "8.5.1",
48
48
  "typescript": "5.9.3",
49
49
  "vitest": "4.1.10",
50
- "@toolpath/api": "^0.9.0"
50
+ "@toolpath/api": "^0.10.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsup src/index.ts src/model/index.ts --format esm --dts --clean",