@design-core/core 0.0.7 → 51.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.
Files changed (117) hide show
  1. package/.github/workflows/DesignCoreQA.yml +3 -0
  2. package/core/designCore.js +1 -1
  3. package/core/dimensions/alignedDimension.js +7 -7
  4. package/core/dimensions/angularDimension.js +32 -32
  5. package/core/dimensions/{baseCircularDimension.js → circularDimensionBase.js} +19 -19
  6. package/core/dimensions/diametricDimension.js +10 -10
  7. package/core/dimensions/dimension.js +42 -42
  8. package/core/dimensions/{baseDimension.js → dimensionBase.js} +17 -17
  9. package/core/dimensions/{baseLinearDimension.js → linearDimensionBase.js} +9 -9
  10. package/core/dimensions/radialDimension.js +8 -8
  11. package/core/dimensions/rotatedDimension.js +8 -8
  12. package/core/entities/arc.js +22 -22
  13. package/core/entities/arctext.js +13 -13
  14. package/core/entities/circle.js +7 -7
  15. package/core/entities/hatch.js +210 -40
  16. package/core/entities/insert.js +11 -6
  17. package/core/entities/point.js +19 -19
  18. package/core/entities/polyline.js +3 -3
  19. package/core/entities/{basePolyline.js → polylineBase.js} +18 -18
  20. package/core/entities/text.js +4 -4
  21. package/core/lib/boundingBox.js +11 -11
  22. package/core/lib/canvas.js +13 -6
  23. package/core/lib/clipboard.js +2 -2
  24. package/core/lib/dxf/dxf.js +11 -11
  25. package/core/lib/dxf/dxfIterator.js +2 -2
  26. package/core/lib/entityManager.js +19 -19
  27. package/core/lib/inputManager.js +1 -1
  28. package/core/lib/matrix.js +1 -1
  29. package/core/lib/patterns.js +1 -1
  30. package/core/lib/polylineUtils.js +9 -9
  31. package/core/lib/renderers/cairoRenderer.js +5 -5
  32. package/core/lib/renderers/canvasRenderer.js +4 -4
  33. package/core/lib/renderers/pdfRenderer.js +7 -7
  34. package/core/lib/renderers/rendererBase.js +1 -1
  35. package/core/lib/scene.js +1 -1
  36. package/core/lib/selectionManager.js +18 -18
  37. package/core/lib/utils.js +5 -5
  38. package/core/properties/entityProperties.js +2 -1
  39. package/core/properties/flags.js +12 -0
  40. package/core/properties/property.js +8 -3
  41. package/core/properties/propertyManager.js +52 -37
  42. package/core/tables/block.js +50 -46
  43. package/core/tables/dimStyle.js +5 -5
  44. package/core/tables/ltypeManager.js +1 -1
  45. package/core/tables/vport.js +2 -2
  46. package/core/tools/chamfer.js +6 -6
  47. package/core/tools/chamferFilletBase.js +4 -4
  48. package/core/tools/copy.js +8 -8
  49. package/core/tools/copybase.js +3 -3
  50. package/core/tools/copyclip.js +3 -3
  51. package/core/tools/cornerEntity.js +2 -2
  52. package/core/tools/cutclip.js +3 -3
  53. package/core/tools/explode.js +6 -6
  54. package/core/tools/extend.js +13 -13
  55. package/core/tools/fillet.js +6 -6
  56. package/core/tools/matchProp.js +1 -1
  57. package/core/tools/mirror.js +11 -11
  58. package/core/tools/move.js +5 -5
  59. package/core/tools/offset.js +29 -29
  60. package/core/tools/purge.js +10 -10
  61. package/core/tools/rotate.js +16 -16
  62. package/core/tools/scale.js +6 -6
  63. package/core/tools/trim.js +15 -15
  64. package/cspell.json +323 -0
  65. package/package.json +1 -1
  66. package/test/dimensions/alignedDimension.test.js +3 -3
  67. package/test/dimensions/angularDimension.test.js +7 -7
  68. package/test/dimensions/diametricDimension.test.js +9 -9
  69. package/test/dimensions/dimension.test.js +12 -12
  70. package/test/dimensions/{baseDimension.test.js → dimensionBase.test.js} +12 -12
  71. package/test/dimensions/{baseLinearDimension.test.js → linearDimensionBase.test.js} +7 -7
  72. package/test/dimensions/radialDimension.test.js +9 -9
  73. package/test/dimensions/rotatedDimension.test.js +4 -4
  74. package/test/entities/arc.test.js +10 -10
  75. package/test/entities/arctext.test.js +6 -6
  76. package/test/entities/circle.test.js +18 -18
  77. package/test/entities/hatch.test.js +362 -39
  78. package/test/entities/insert.test.js +9 -9
  79. package/test/entities/point.test.js +3 -3
  80. package/test/entities/{basePolyline.test.js → polylineBase.test.js} +131 -62
  81. package/test/entities/text.test.js +19 -19
  82. package/test/integration/exportIntegration.test.js +3 -3
  83. package/test/integration/userInputIntegration.test.js +5 -5
  84. package/test/lib/boundingBox.test.js +3 -3
  85. package/test/lib/canvas.test.js +9 -9
  86. package/test/lib/clipboard.test.js +73 -0
  87. package/test/lib/inputManager.test.js +4 -4
  88. package/test/lib/scene.test.js +9 -9
  89. package/test/lib/selectionManager.test.js +3 -3
  90. package/test/lib/snapping.test.js +1 -1
  91. package/test/properties/flags.test.js +24 -0
  92. package/test/properties/propertyManager.test.js +93 -22
  93. package/test/renderers/pdfRenderer.test.js +2 -2
  94. package/test/tables/block.test.js +63 -14
  95. package/test/tables/layerManager.test.js +2 -2
  96. package/test/test-helpers/hatchGridRenderer.js +3 -3
  97. package/test/test-helpers/test-helpers.js +6 -6
  98. package/test/tools/chamfer.test.js +60 -60
  99. package/test/tools/chamferFilletBase.test.js +36 -36
  100. package/test/tools/copy.test.js +6 -6
  101. package/test/tools/copybase.test.js +2 -2
  102. package/test/tools/copyclip.test.js +2 -2
  103. package/test/tools/cornerEntity.test.js +8 -8
  104. package/test/tools/cutclip.test.js +2 -2
  105. package/test/tools/erase.test.js +6 -6
  106. package/test/tools/explode.test.js +2 -2
  107. package/test/tools/extend.test.js +84 -84
  108. package/test/tools/fillet.test.js +62 -62
  109. package/test/tools/matchProp.test.js +6 -6
  110. package/test/tools/mirror.test.js +26 -26
  111. package/test/tools/move.test.js +7 -7
  112. package/test/tools/offset.test.js +65 -65
  113. package/test/tools/purge.test.js +4 -4
  114. package/test/tools/rotate.test.js +10 -10
  115. package/test/tools/scale.test.js +28 -28
  116. package/test/tools/trim.test.js +109 -109
  117. package/test/tools/zoom.test.js +15 -17
@@ -1,5 +1,5 @@
1
1
  import { AlignedDimension } from '../../core/dimensions/alignedDimension.js';
2
- import { BaseLinearDimension } from '../../core/dimensions/baseLinearDimension.js';
2
+ import { LinearDimensionBase } from '../../core/dimensions/linearDimensionBase.js';
3
3
  import { Point } from '../../core/entities/point.js';
4
4
  import { DesignCore } from '../../core/designCore.js';
5
5
  import { Core } from '../../core/core/core.js';
@@ -9,16 +9,16 @@ new Core();
9
9
 
10
10
  // ─── constructor ─────────────────────────────────────────────────────────────
11
11
 
12
- test('BaseLinearDimension can be instantiated', () => {
13
- const dim = new BaseLinearDimension();
14
- expect(dim).toBeInstanceOf(BaseLinearDimension);
12
+ test('LinearDimensionBase can be instantiated', () => {
13
+ const dim = new LinearDimensionBase();
14
+ expect(dim).toBeInstanceOf(LinearDimensionBase);
15
15
  expect(dim.points).toBeDefined();
16
16
  expect(Array.isArray(dim.points)).toBe(true);
17
17
  });
18
18
 
19
19
  // ─── preview ─────────────────────────────────────────────────────────────────
20
20
 
21
- test('BaseLinearDimension.preview - 0 points does nothing', () => {
21
+ test('LinearDimensionBase.preview - 0 points does nothing', () => {
22
22
  const dim = new AlignedDimension();
23
23
  DesignCore.Scene.auxiliaryEntities.clear();
24
24
  DesignCore.Scene.previewEntities.clear();
@@ -28,7 +28,7 @@ test('BaseLinearDimension.preview - 0 points does nothing', () => {
28
28
  expect(DesignCore.Scene.previewEntities.count()).toBe(0);
29
29
  });
30
30
 
31
- test('BaseLinearDimension.preview - 1 point adds RubberBand to auxiliaryEntities', () => {
31
+ test('LinearDimensionBase.preview - 1 point adds RubberBand to auxiliaryEntities', () => {
32
32
  const dim = new AlignedDimension();
33
33
  dim.points = [new Point(0, 0)];
34
34
 
@@ -44,7 +44,7 @@ test('BaseLinearDimension.preview - 1 point adds RubberBand to auxiliaryEntities
44
44
  DesignCore.Scene.auxiliaryEntities.add = origAdd;
45
45
  });
46
46
 
47
- test('BaseLinearDimension.preview - >1 points creates temp entity', () => {
47
+ test('LinearDimensionBase.preview - >1 points creates temp entity', () => {
48
48
  const dim = new AlignedDimension();
49
49
  dim.points = [new Point(0, 0), new Point(10, 0)];
50
50
 
@@ -17,28 +17,28 @@ const scenarios = [
17
17
 
18
18
  { desc: 'Radial dimension from circle selection - Text outside circle',
19
19
  input: [new SingleSelection(0, new Point()), new Point(20, 0)],
20
- selectedItems: [new Circle({ points: [new Point(0, 0), new Point(10, 0)] })],
20
+ selectedEntities: [new Circle({ points: [new Point(0, 0), new Point(10, 0)] })],
21
21
  expectedDimType: 4,
22
22
  dimensionValue: 10,
23
23
  dimensionEntities: 6,
24
24
  },
25
25
  { desc: 'Radial dimension from circle selection - Text inside circle',
26
26
  input: [new SingleSelection(0, new Point()), new Point(0, 0)],
27
- selectedItems: [new Circle({ points: [new Point(0, 0), new Point(10, 0)] })],
27
+ selectedEntities: [new Circle({ points: [new Point(0, 0), new Point(10, 0)] })],
28
28
  expectedDimType: 4,
29
29
  dimensionValue: 10,
30
30
  dimensionEntities: 5,
31
31
  },
32
32
  { desc: 'Radial dimension from arc selection',
33
33
  input: [new SingleSelection(0, new Point()), new Point(20, 10)],
34
- selectedItems: [new Arc({ points: [new Point(0, 0), new Point(20, 0), new Point(20, 20)] })],
34
+ selectedEntities: [new Arc({ points: [new Point(0, 0), new Point(20, 0), new Point(20, 20)] })],
35
35
  expectedDimType: 4,
36
36
  dimensionValue: 20,
37
37
  dimensionEntities: 6,
38
38
  },
39
39
  { desc: 'Radial dimension from polyline selection',
40
40
  input: [new SingleSelection(0, new Point(30, 10)), new Point(30, 10)],
41
- selectedItems: [new Polyline({ points: [new Point(0, 0), new Point(20, 0, 1), new Point(20, 20)] })],
41
+ selectedEntities: [new Polyline({ points: [new Point(0, 0), new Point(20, 0, 1), new Point(20, 20)] })],
42
42
  expectedDimType: 4,
43
43
  dimensionValue: 10,
44
44
  dimensionEntities: 6,
@@ -46,7 +46,7 @@ const scenarios = [
46
46
  ];
47
47
 
48
48
  test.each(scenarios)('RadialDimension.execute handles $desc', async (scenario) => {
49
- const { input, selectedItems, expectedDimType, dimensionValue, dimensionEntities } = scenario;
49
+ const { input, selectedEntities, expectedDimType, dimensionValue, dimensionEntities } = scenario;
50
50
 
51
51
  await withMockInput(DesignCore.Scene, input, async () => {
52
52
  const dim = new RadialDimension();
@@ -66,7 +66,7 @@ test.each(scenarios)('RadialDimension.execute handles $desc', async (scenario) =
66
66
  expect(entity.getProperty('string')).toContain('R');
67
67
  }
68
68
  }
69
- }, { selectedItems });
69
+ }, { selectedEntities });
70
70
  });
71
71
 
72
72
  test('constructor sets default properties', () => {
@@ -77,14 +77,14 @@ test('constructor sets default properties', () => {
77
77
 
78
78
 
79
79
  test('getPointsFromSelection returns correct sequenced points', () => {
80
- const center = new Point(0, 0);
80
+ const centre = new Point(0, 0);
81
81
  const textPos = new Point(10, 0);
82
82
  // Mock item with getRadius
83
- const item = { points: [center], getRadius: () => 10 };
83
+ const item = { points: [centre], getRadius: () => 10 };
84
84
  const result = RadialDimension.getPointsFromSelection([item], textPos);
85
85
  expect(Array.isArray(result)).toBe(true);
86
86
  expect(result.length).toBe(3);
87
- expect(result[0].sequence).toBe(10); // center
87
+ expect(result[0].sequence).toBe(10); // centre
88
88
  expect(result[1].sequence).toBe(15); // radius point
89
89
  expect(result[2].sequence).toBe(11); // text position
90
90
  });
@@ -13,20 +13,20 @@ const scenarios = [
13
13
 
14
14
  { desc: 'Rotated dimension from point selection (angle 0)',
15
15
  input: [0, new Point(), new Point(10, 0), new Point(5, 5)],
16
- selectedItems: [],
16
+ selectedEntities: [],
17
17
  expectedDimType: 0,
18
18
  dimensionValue: 10,
19
19
  },
20
20
  { desc: 'Rotated dimension from point selection (angle 90)',
21
21
  input: [90, new Point(), new Point(0, 10), new Point(5, 5)],
22
- selectedItems: [],
22
+ selectedEntities: [],
23
23
  expectedDimType: 0,
24
24
  dimensionValue: 10,
25
25
  },
26
26
  ];
27
27
 
28
28
  test.each(scenarios)('Dimension.execute handles $desc', async (scenario) => {
29
- const { input, selectedItems, expectedDimType, dimensionValue } = scenario;
29
+ const { input, selectedEntities, expectedDimType, dimensionValue } = scenario;
30
30
 
31
31
  await withMockInput(DesignCore.Scene, input, async () => {
32
32
  const dim = new RotatedDimension();
@@ -43,7 +43,7 @@ test.each(scenarios)('Dimension.execute handles $desc', async (scenario) => {
43
43
  expect(Number(entity.getProperty('string'))).toBeCloseTo(dimensionValue);
44
44
  }
45
45
  }
46
- }, { selectedItems });
46
+ }, { selectedEntities });
47
47
  });
48
48
 
49
49
  test('constructor sets default properties', () => {
@@ -58,7 +58,7 @@ describe('Arc.execute input validation and notifications', () => {
58
58
  test('Notifies on invalid point input (duplicate)', async () => {
59
59
  const input1 = new Point(0, 0);
60
60
  const input2 = new Point(10, 0);
61
- const input3 = new Point(0, 0); // Same as center
61
+ const input3 = new Point(0, 0); // Same as centre
62
62
  await withMockInput(DesignCore.Scene, [input1, input2, input3, new Point(10, 10)], async () => {
63
63
  const arc = new Arc({});
64
64
  await arc.execute();
@@ -450,8 +450,8 @@ test('Arc.fromPolylinePoints precision drift is negligible', () => {
450
450
  const polyPts = arc.toPolylinePoints();
451
451
  const rebuilt = new Arc({});
452
452
  rebuilt.fromPolylinePoints(polyPts);
453
- const centerDrift = Math.hypot(rebuilt.points[0].x - arc.points[0].x, rebuilt.points[0].y - arc.points[0].y);
454
- expect(centerDrift).toBeLessThan(1e-10);
453
+ const centreDrift = Math.hypot(rebuilt.points[0].x - arc.points[0].x, rebuilt.points[0].y - arc.points[0].y);
454
+ expect(centreDrift).toBeLessThan(1e-10);
455
455
  expect(Math.abs(rebuilt.getProperty('radius') - arc.getProperty('radius'))).toBeLessThan(1e-10);
456
456
  });
457
457
 
@@ -489,10 +489,10 @@ test('Arc.snaps returns no tangent when fromPoint is inside the arc radius', ()
489
489
 
490
490
  describe('Arc.fromDxf', () => {
491
491
  test('projects start and end points from DXF angle codes', () => {
492
- const center = new Point(0, 0);
493
- const result = Arc.fromDxf({ points: [center], 40: 10, 50: 0, 51: 90 });
492
+ const centre = new Point(0, 0);
493
+ const result = Arc.fromDxf({ points: [centre], 40: 10, 50: 0, 51: 90 });
494
494
  expect(result.points.length).toBe(3);
495
- expect(result.points[0]).toBe(center);
495
+ expect(result.points[0]).toBe(centre);
496
496
  expect(result.points[1].x).toBeCloseTo(10); // project(0°, 10)
497
497
  expect(result.points[1].y).toBeCloseTo(0);
498
498
  expect(result.points[2].x).toBeCloseTo(0); // project(90°, 10)
@@ -513,15 +513,15 @@ describe('Arc.fromDxf', () => {
513
513
  expect(result[6]).toBe('ByLayer');
514
514
  });
515
515
 
516
- test('returns data unchanged when no center point', () => {
516
+ test('returns data unchanged when no centre point', () => {
517
517
  const data = { 40: 10, 50: 0, 51: 90 };
518
518
  expect(Arc.fromDxf(data)).toBe(data);
519
519
  });
520
520
 
521
521
  test('arc constructed via fromDxf matches arc constructed directly', () => {
522
- const center = new Point(100, 100);
523
- const fromDxfArc = new Arc(Arc.fromDxf({ points: [center], 40: 50, 50: 0, 51: 90 }));
524
- const directArc = new Arc({ points: [center, new Point(150, 100), new Point(100, 150)] });
522
+ const centre = new Point(100, 100);
523
+ const fromDxfArc = new Arc(Arc.fromDxf({ points: [centre], 40: 50, 50: 0, 51: 90 }));
524
+ const directArc = new Arc({ points: [centre, new Point(150, 100), new Point(100, 150)] });
525
525
  expect(fromDxfArc.getProperty('radius')).toBeCloseTo(directArc.getProperty('radius'));
526
526
  expect(fromDxfArc.startAngle()).toBeCloseTo(directArc.startAngle());
527
527
  expect(fromDxfArc.endAngle()).toBeCloseTo(directArc.endAngle());
@@ -16,14 +16,14 @@ const arcInputScenarios = [
16
16
  {
17
17
  desc: 'two points and an angle',
18
18
  input: [new SingleSelection(0, new Point(5, 0)), 2.5, 'Test Arc'],
19
- selectedItems: [new Arc({ points: [new Point(), new Point(100, 0), new Point(-100, 0)] })],
19
+ selectedEntities: [new Arc({ points: [new Point(), new Point(100, 0), new Point(-100, 0)] })],
20
20
  expectedTextHeight: 2.5,
21
21
  expectedText: 'Test Arc',
22
22
  },
23
23
  ];
24
24
 
25
25
  test.each(arcInputScenarios)('ArcText.execute handles $desc', async (scenario) => {
26
- const { input, selectedItems, expectedTextHeight, expectedText } = scenario;
26
+ const { input, selectedEntities, expectedTextHeight, expectedText } = scenario;
27
27
 
28
28
  await withMockInput(DesignCore.Scene, input, async () => {
29
29
  const arcText = new ArcAlignedText();
@@ -37,7 +37,7 @@ test.each(arcInputScenarios)('ArcText.execute handles $desc', async (scenario) =
37
37
  expect(arcText.getProperty('radius')).toBe(100);
38
38
  expect(arcText.startAngle()).toBe(0);
39
39
  expect(arcText.endAngle()).toBeCloseTo(3.14159);
40
- }, { selectedItems });
40
+ }, { selectedEntities });
41
41
  });
42
42
 
43
43
  test('ArcAlignedCharacter', () => {
@@ -105,7 +105,7 @@ test('ArcText getArcAlignedCharacters', () => {
105
105
  // offsetFromLeft 0 - mm
106
106
  // textReversed 0 = forward, 1 = reversed
107
107
  // textOrientation 1 = outward, 2 = inward
108
- // textAlignment 1 = fit to arc, 2 = left align, 3 = right align, 4 = center
108
+ // textAlignment 1 = fit to arc, 2 = left align, 3 = right align, 4 = centre
109
109
  // ArcSide convex = 1, concave = 2
110
110
  let chars = [];
111
111
 
@@ -387,7 +387,7 @@ test('ArcText snaps with empty string returns only centre snap', () => {
387
387
  });
388
388
 
389
389
  test('ArcText closestPoint returns distance 0.1 when within height * 0.35', () => {
390
- // Single char 'T' center-aligned sits at (0, 101.25); height = 2.5, threshold = 0.875
390
+ // Single char 'T' centre-aligned sits at (0, 101.25); height = 2.5, threshold = 0.875
391
391
  const arcText = new ArcAlignedText({ points: [new Point(0, 0)], string: 'T', radius: 100 });
392
392
  const chars = arcText.getArcAlignedCharacters();
393
393
  const charPos = chars[0].position;
@@ -408,7 +408,7 @@ test('ArcText getArcAlignedCharacters fit-to-arc single character places at midp
408
408
  });
409
409
 
410
410
  test('ArcText getArcAlignedCharacters single character is placed at arc midpoint', () => {
411
- // Single char with center alignment: charOffsetAngles = [0], stringStartPoint = arcMidPoint
411
+ // Single char with centre alignment: charOffsetAngles = [0], stringStartPoint = arcMidPoint
412
412
  // arcMidAngle(0, PI) = PI/2 → project(PI/2, 101.25) = (0, 101.25), angle = PI/2 - PI/2 = 0
413
413
  const arcText = new ArcAlignedText({ points: [new Point(0, 0)], string: 'X', radius: 100 });
414
414
  const chars = arcText.getArcAlignedCharacters();
@@ -128,22 +128,22 @@ test('Test Circle.toPolylinePoints', () => {
128
128
  });
129
129
 
130
130
  test('Circle.execute creates circle from diameter input', async () => {
131
- const center = new Point(0, 0);
131
+ const centre = new Point(0, 0);
132
132
 
133
- await withMockInput(DesignCore.Scene, [center, 'Diameter', 20], async () => {
133
+ await withMockInput(DesignCore.Scene, [centre, 'Diameter', 20], async () => {
134
134
  const circle = new Circle({});
135
135
  await circle.execute();
136
136
 
137
- expect(circle.points[0]).toBe(center);
137
+ expect(circle.points[0]).toBe(centre);
138
138
  expect(circle.getRadius()).toBeCloseTo(10);
139
139
  });
140
140
  });
141
141
 
142
142
  test('Circle.execute re-prompts on zero or negative radius', async () => {
143
- const center = new Point(0, 0);
143
+ const centre = new Point(0, 0);
144
144
 
145
145
  // 0 and -5 are rejected; 10 is accepted
146
- await withMockInput(DesignCore.Scene, [center, 0, -5, 10], async () => {
146
+ await withMockInput(DesignCore.Scene, [centre, 0, -5, 10], async () => {
147
147
  const circle = new Circle({});
148
148
  await circle.execute();
149
149
 
@@ -152,10 +152,10 @@ test('Circle.execute re-prompts on zero or negative radius', async () => {
152
152
  });
153
153
 
154
154
  test('Circle.execute re-prompts on zero or negative diameter', async () => {
155
- const center = new Point(0, 0);
155
+ const centre = new Point(0, 0);
156
156
 
157
157
  // 'Diameter', then 0 and -20 rejected, then 20 accepted (radius = 10)
158
- await withMockInput(DesignCore.Scene, [center, 'Diameter', 0, -20, 20], async () => {
158
+ await withMockInput(DesignCore.Scene, [centre, 'Diameter', 0, -20, 20], async () => {
159
159
  const circle = new Circle({});
160
160
  await circle.execute();
161
161
 
@@ -175,8 +175,8 @@ test('Circle constructor loads radius from DXF group code 40 via fromDxf', () =>
175
175
  });
176
176
 
177
177
  test('Circle.execute creates circle from numeric radius input', async () => {
178
- const center = new Point(0, 0);
179
- await withMockInput(DesignCore.Scene, [center, 25], async () => {
178
+ const centre = new Point(0, 0);
179
+ await withMockInput(DesignCore.Scene, [centre, 25], async () => {
180
180
  const circle = new Circle({});
181
181
  await circle.execute();
182
182
  expect(circle.getRadius()).toBeCloseTo(25);
@@ -185,8 +185,8 @@ test('Circle.execute creates circle from numeric radius input', async () => {
185
185
 
186
186
  test('Circle.execute re-prompts on zero-distance point input', async () => {
187
187
  const notifySpy = jest.spyOn(DesignCore.Core, 'notify').mockImplementation(() => {});
188
- const center = new Point(0, 0);
189
- await withMockInput(DesignCore.Scene, [center, new Point(0, 0), new Point(10, 0)], async () => {
188
+ const centre = new Point(0, 0);
189
+ await withMockInput(DesignCore.Scene, [centre, new Point(0, 0), new Point(10, 0)], async () => {
190
190
  const circle = new Circle({});
191
191
  await circle.execute();
192
192
  expect(notifySpy).toHaveBeenCalledWith(expect.stringContaining(Strings.Error.NONZERO));
@@ -296,10 +296,10 @@ test('Circle.snaps returns two tangent snaps from outside', () => {
296
296
 
297
297
  describe('Circle.fromDxf', () => {
298
298
  test('projects edge point from DXF radius code', () => {
299
- const center = new Point(0, 0);
300
- const result = Circle.fromDxf({ points: [center], 40: 10 });
299
+ const centre = new Point(0, 0);
300
+ const result = Circle.fromDxf({ points: [centre], 40: 10 });
301
301
  expect(result.points.length).toBe(2);
302
- expect(result.points[0]).toBe(center);
302
+ expect(result.points[0]).toBe(centre);
303
303
  expect(result.points[1].x).toBeCloseTo(10);
304
304
  expect(result.points[1].y).toBeCloseTo(0);
305
305
  });
@@ -309,7 +309,7 @@ describe('Circle.fromDxf', () => {
309
309
  expect(result[8]).toBe('MyLayer');
310
310
  });
311
311
 
312
- test('returns data unchanged when no center point', () => {
312
+ test('returns data unchanged when no centre point', () => {
313
313
  const data = { 40: 10 };
314
314
  expect(Circle.fromDxf(data)).toBe(data);
315
315
  });
@@ -320,9 +320,9 @@ describe('Circle.fromDxf', () => {
320
320
  });
321
321
 
322
322
  test('circle constructed via fromDxf matches circle constructed directly', () => {
323
- const center = new Point(100, 100);
324
- const fromDxfCircle = new Circle(Circle.fromDxf({ points: [center], 40: 50 }));
325
- const directCircle = new Circle({ points: [center, new Point(150, 100)] });
323
+ const centre = new Point(100, 100);
324
+ const fromDxfCircle = new Circle(Circle.fromDxf({ points: [centre], 40: 50 }));
325
+ const directCircle = new Circle({ points: [centre, new Point(150, 100)] });
326
326
  expect(fromDxfCircle.getRadius()).toBeCloseTo(directCircle.getRadius());
327
327
  expect(fromDxfCircle.points[0].x).toBeCloseTo(directCircle.points[0].x);
328
328
  expect(fromDxfCircle.points[0].y).toBeCloseTo(directCircle.points[0].y);