|
1 | | -import { describe, it, expect } from 'vitest'; |
| 1 | +import { describe, it } from 'vitest'; |
| 2 | + |
2 | 3 | import { Solid } from '$lib/3d/Solid'; |
3 | | -import { expectBoundsEqual, expectValidVertexCount, expectCloseTo } from '../../../setup'; |
| 4 | + |
| 5 | +import { expectBoundsEqual, expectCloseTo, expectValidVertexCount } from '../../../setup'; |
4 | 6 |
|
5 | 7 | describe('Solid - Alignment and Bounds', () => { |
6 | 8 | describe('getBounds()', () => { |
@@ -118,31 +120,39 @@ describe('Solid - Alignment and Bounds', () => { |
118 | 120 | }); |
119 | 121 |
|
120 | 122 | it('should center cube on x and y axes', () => { |
121 | | - const cube = Solid.cube(10, 10, 10).move({ x: 20, y: 30, z: 40 }).center({ x: true, y: true }); |
| 123 | + const cube = Solid.cube(10, 10, 10) |
| 124 | + .move({ x: 20, y: 30, z: 40 }) |
| 125 | + .center({ x: true, y: true }); |
122 | 126 | const bounds = cube.getBounds(); |
123 | 127 |
|
124 | 128 | expectCloseTo(bounds.center.x, 0, 1); |
125 | 129 | expectCloseTo(bounds.center.y, 0, 1); |
126 | 130 | }); |
127 | 131 |
|
128 | 132 | it('should center cube on x and z axes', () => { |
129 | | - const cube = Solid.cube(10, 10, 10).move({ x: 20, y: 30, z: 40 }).center({ x: true, z: true }); |
| 133 | + const cube = Solid.cube(10, 10, 10) |
| 134 | + .move({ x: 20, y: 30, z: 40 }) |
| 135 | + .center({ x: true, z: true }); |
130 | 136 | const bounds = cube.getBounds(); |
131 | 137 |
|
132 | 138 | expectCloseTo(bounds.center.x, 0, 1); |
133 | 139 | expectCloseTo(bounds.center.z, 0, 1); |
134 | 140 | }); |
135 | 141 |
|
136 | 142 | it('should center cube on y and z axes', () => { |
137 | | - const cube = Solid.cube(10, 10, 10).move({ x: 20, y: 30, z: 40 }).center({ y: true, z: true }); |
| 143 | + const cube = Solid.cube(10, 10, 10) |
| 144 | + .move({ x: 20, y: 30, z: 40 }) |
| 145 | + .center({ y: true, z: true }); |
138 | 146 | const bounds = cube.getBounds(); |
139 | 147 |
|
140 | 148 | expectCloseTo(bounds.center.y, 0, 1); |
141 | 149 | expectCloseTo(bounds.center.z, 0, 1); |
142 | 150 | }); |
143 | 151 |
|
144 | 152 | it('should center cube on all axes with explicit flags', () => { |
145 | | - const cube = Solid.cube(10, 10, 10).move({ x: 20, y: 30, z: 40 }).center({ x: true, y: true, z: true }); |
| 153 | + const cube = Solid.cube(10, 10, 10) |
| 154 | + .move({ x: 20, y: 30, z: 40 }) |
| 155 | + .center({ x: true, y: true, z: true }); |
146 | 156 | const bounds = cube.getBounds(); |
147 | 157 |
|
148 | 158 | expectCloseTo(bounds.center.x, 0, 1); |
@@ -302,7 +312,10 @@ describe('Solid - Alignment and Bounds', () => { |
302 | 312 |
|
303 | 313 | describe('Combined Alignment Operations', () => { |
304 | 314 | it('should combine center and align', () => { |
305 | | - const cube = Solid.cube(10, 20, 30).move({ x: 50, y: 60, z: 70 }).center({ x: true, z: true }).align('bottom'); |
| 315 | + const cube = Solid.cube(10, 20, 30) |
| 316 | + .move({ x: 50, y: 60, z: 70 }) |
| 317 | + .center({ x: true, z: true }) |
| 318 | + .align('bottom'); |
306 | 319 |
|
307 | 320 | const bounds = cube.getBounds(); |
308 | 321 |
|
@@ -332,7 +345,11 @@ describe('Solid - Alignment and Bounds', () => { |
332 | 345 | }); |
333 | 346 |
|
334 | 347 | it('should align multiple sides sequentially', () => { |
335 | | - const cube = Solid.cube(10, 20, 30).move({ x: 50, y: 60, z: 70 }).align('bottom').align('left').align('front'); |
| 348 | + const cube = Solid.cube(10, 20, 30) |
| 349 | + .move({ x: 50, y: 60, z: 70 }) |
| 350 | + .align('bottom') |
| 351 | + .align('left') |
| 352 | + .align('front'); |
336 | 353 |
|
337 | 354 | const bounds = cube.getBounds(); |
338 | 355 |
|
|
0 commit comments