Coverage for colour/geometry/tests/test_primitives.py: 100%

47 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-16 23:01 +1300

1"""Define the unit tests for the :mod:`colour.geometry.primitives` module.""" 

2 

3from __future__ import annotations 

4 

5import numpy as np 

6 

7from colour.constants import TOLERANCE_ABSOLUTE_TESTS 

8from colour.geometry import ( 

9 MAPPING_PLANE_TO_AXIS, 

10 primitive_cube, 

11 primitive_grid, 

12) 

13 

14__author__ = "Colour Developers" 

15__copyright__ = "Copyright 2013 Colour Developers" 

16__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" 

17__maintainer__ = "Colour Developers" 

18__email__ = "colour-developers@colour-science.org" 

19__status__ = "Production" 

20 

21__all__ = [ 

22 "TestPrimitiveGrid", 

23 "TestPrimitiveCube", 

24] 

25 

26 

27class TestPrimitiveGrid: 

28 """ 

29 Define :func:`colour.geometry.primitives.primitive_grid` 

30 definition unit tests methods. 

31 """ 

32 

33 def test_primitive_grid(self) -> None: 

34 """ 

35 Test :func:`colour.geometry.primitives.primitive_grid` 

36 definition. 

37 """ 

38 

39 vertices, faces, outline = primitive_grid() 

40 np.testing.assert_allclose( 

41 vertices["position"], 

42 np.array( 

43 [ 

44 [-0.5, 0.5, 0.0], 

45 [0.5, 0.5, 0.0], 

46 [-0.5, -0.5, 0.0], 

47 [0.5, -0.5, 0.0], 

48 ] 

49 ), 

50 atol=TOLERANCE_ABSOLUTE_TESTS, 

51 ) 

52 

53 np.testing.assert_allclose( 

54 vertices["uv"], 

55 np.array([[0, 1], [1, 1], [0, 0], [1, 0]]), 

56 atol=TOLERANCE_ABSOLUTE_TESTS, 

57 ) 

58 

59 np.testing.assert_allclose( 

60 vertices["normal"], 

61 np.array([[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]), 

62 atol=TOLERANCE_ABSOLUTE_TESTS, 

63 ) 

64 

65 np.testing.assert_allclose( 

66 vertices["colour"], 

67 np.array( 

68 [ 

69 [0, 1, 0, 1], 

70 [1, 1, 0, 1], 

71 [0, 0, 0, 1], 

72 [1, 0, 0, 1], 

73 ] 

74 ), 

75 atol=TOLERANCE_ABSOLUTE_TESTS, 

76 ) 

77 

78 np.testing.assert_equal(faces, np.array([[0, 2, 1], [2, 3, 1]])) 

79 

80 np.testing.assert_equal(outline, np.array([[0, 2], [2, 3], [3, 1], [1, 0]])) 

81 

82 vertices, faces, outline = primitive_grid( 

83 width=0.2, 

84 height=0.4, 

85 width_segments=1, 

86 height_segments=2, 

87 axis="+z", 

88 ) 

89 

90 np.testing.assert_allclose( 

91 vertices["position"], 

92 np.array( 

93 [ 

94 [-0.10000000, 0.20000000, 0.00000000], 

95 [0.10000000, 0.20000000, 0.00000000], 

96 [-0.10000000, -0.00000000, 0.00000000], 

97 [0.10000000, -0.00000000, 0.00000000], 

98 [-0.10000000, -0.20000000, 0.00000000], 

99 [0.10000000, -0.20000000, 0.00000000], 

100 ] 

101 ), 

102 atol=TOLERANCE_ABSOLUTE_TESTS, 

103 ) 

104 

105 np.testing.assert_allclose( 

106 vertices["uv"], 

107 np.array( 

108 [ 

109 [0.00000000, 1.00000000], 

110 [1.00000000, 1.00000000], 

111 [0.00000000, 0.50000000], 

112 [1.00000000, 0.50000000], 

113 [0.00000000, 0.00000000], 

114 [1.00000000, 0.00000000], 

115 ] 

116 ), 

117 atol=TOLERANCE_ABSOLUTE_TESTS, 

118 ) 

119 

120 np.testing.assert_allclose( 

121 vertices["normal"], 

122 np.array( 

123 [ 

124 [0, 0, 1], 

125 [0, 0, 1], 

126 [0, 0, 1], 

127 [0, 0, 1], 

128 [0, 0, 1], 

129 [0, 0, 1], 

130 ] 

131 ), 

132 atol=TOLERANCE_ABSOLUTE_TESTS, 

133 ) 

134 

135 np.testing.assert_allclose( 

136 vertices["colour"], 

137 np.array( 

138 [ 

139 [0.25000000, 1.00000000, 0.00000000, 1.00000000], 

140 [0.75000000, 1.00000000, 0.00000000, 1.00000000], 

141 [0.25000000, 0.50000000, 0.00000000, 1.00000000], 

142 [0.75000000, 0.50000000, 0.00000000, 1.00000000], 

143 [0.25000000, 0.00000000, 0.00000000, 1.00000000], 

144 [0.75000000, 0.00000000, 0.00000000, 1.00000000], 

145 ] 

146 ), 

147 atol=TOLERANCE_ABSOLUTE_TESTS, 

148 ) 

149 

150 np.testing.assert_equal( 

151 faces, 

152 np.array( 

153 [ 

154 [0, 2, 1], 

155 [2, 3, 1], 

156 [2, 4, 3], 

157 [4, 5, 3], 

158 ] 

159 ), 

160 ) 

161 

162 np.testing.assert_equal( 

163 outline, 

164 np.array( 

165 [ 

166 [0, 2], 

167 [2, 3], 

168 [3, 1], 

169 [1, 0], 

170 [2, 4], 

171 [4, 5], 

172 [5, 3], 

173 [3, 2], 

174 ] 

175 ), 

176 ) 

177 

178 for plane in MAPPING_PLANE_TO_AXIS: 

179 np.testing.assert_allclose( 

180 primitive_grid(axis=plane)[0]["position"], 

181 primitive_grid(axis=MAPPING_PLANE_TO_AXIS[plane])[0]["position"], 

182 atol=TOLERANCE_ABSOLUTE_TESTS, 

183 ) 

184 

185 

186class TestPrimitiveCube: 

187 """ 

188 Define :func:`colour.geometry.primitives.primitive_cube` 

189 definition unit tests methods. 

190 """ 

191 

192 def test_primitive_cube(self) -> None: 

193 """ 

194 Test :func:`colour.geometry.primitives.primitive_cube` 

195 definition. 

196 """ 

197 

198 vertices, faces, outline = primitive_cube() 

199 np.testing.assert_allclose( 

200 vertices["position"], 

201 np.array( 

202 [ 

203 [-0.5, 0.5, -0.5], 

204 [0.5, 0.5, -0.5], 

205 [-0.5, -0.5, -0.5], 

206 [0.5, -0.5, -0.5], 

207 [-0.5, 0.5, 0.5], 

208 [0.5, 0.5, 0.5], 

209 [-0.5, -0.5, 0.5], 

210 [0.5, -0.5, 0.5], 

211 [0.5, -0.5, -0.5], 

212 [0.5, -0.5, 0.5], 

213 [-0.5, -0.5, -0.5], 

214 [-0.5, -0.5, 0.5], 

215 [0.5, 0.5, -0.5], 

216 [0.5, 0.5, 0.5], 

217 [-0.5, 0.5, -0.5], 

218 [-0.5, 0.5, 0.5], 

219 [-0.5, -0.5, 0.5], 

220 [-0.5, 0.5, 0.5], 

221 [-0.5, -0.5, -0.5], 

222 [-0.5, 0.5, -0.5], 

223 [0.5, -0.5, 0.5], 

224 [0.5, 0.5, 0.5], 

225 [0.5, -0.5, -0.5], 

226 [0.5, 0.5, -0.5], 

227 ] 

228 ), 

229 atol=TOLERANCE_ABSOLUTE_TESTS, 

230 ) 

231 

232 np.testing.assert_allclose( 

233 vertices["uv"], 

234 np.array( 

235 [ 

236 [0, 1], 

237 [1, 1], 

238 [0, 0], 

239 [1, 0], 

240 [0, 1], 

241 [1, 1], 

242 [0, 0], 

243 [1, 0], 

244 [0, 1], 

245 [1, 1], 

246 [0, 0], 

247 [1, 0], 

248 [0, 1], 

249 [1, 1], 

250 [0, 0], 

251 [1, 0], 

252 [0, 1], 

253 [1, 1], 

254 [0, 0], 

255 [1, 0], 

256 [0, 1], 

257 [1, 1], 

258 [0, 0], 

259 [1, 0], 

260 ] 

261 ), 

262 atol=TOLERANCE_ABSOLUTE_TESTS, 

263 ) 

264 

265 np.testing.assert_allclose( 

266 vertices["normal"], 

267 np.array( 

268 [ 

269 [0, 0, -1.0], 

270 [0, 0, -1], 

271 [0, 0, -1], 

272 [0, 0, -1], 

273 [0, 0, 1], 

274 [0, 0, 1], 

275 [0, 0, 1], 

276 [0, 0, 1], 

277 [0, -1, 0], 

278 [0, -1, 0], 

279 [0, -1, 0], 

280 [0, -1, 0], 

281 [0, 1, 0], 

282 [0, 1, 0], 

283 [0, 1, 0], 

284 [0, 1, 0], 

285 [-1, 0, 0], 

286 [-1, 0, 0], 

287 [-1, 0, 0], 

288 [-1, 0, 0], 

289 [1, 0, 0], 

290 [1, 0, 0], 

291 [1, 0, 0], 

292 [1, 0, 0], 

293 ] 

294 ), 

295 atol=TOLERANCE_ABSOLUTE_TESTS, 

296 ) 

297 

298 np.testing.assert_allclose( 

299 vertices["colour"], 

300 np.array( 

301 [ 

302 [0, 1, 0, 1], 

303 [1, 1, 0, 1], 

304 [0, 0, 0, 1], 

305 [1, 0, 0, 1], 

306 [0, 1, 1, 1], 

307 [1, 1, 1, 1], 

308 [0, 0, 1, 1], 

309 [1, 0, 1, 1], 

310 [1, 0, 0, 1], 

311 [1, 0, 1, 1], 

312 [0, 0, 0, 1], 

313 [0, 0, 1, 1], 

314 [1, 1, 0, 1], 

315 [1, 1, 1, 1], 

316 [0, 1, 0, 1], 

317 [0, 1, 1, 1], 

318 [0, 0, 1, 1], 

319 [0, 1, 1, 1], 

320 [0, 0, 0, 1], 

321 [0, 1, 0, 1], 

322 [1, 0, 1, 1], 

323 [1, 1, 1, 1], 

324 [1, 0, 0, 1], 

325 [1, 1, 0, 1], 

326 ] 

327 ), 

328 atol=TOLERANCE_ABSOLUTE_TESTS, 

329 ) 

330 

331 np.testing.assert_equal( 

332 faces, 

333 np.array( 

334 [ 

335 [1, 2, 0], 

336 [1, 3, 2], 

337 [4, 6, 5], 

338 [6, 7, 5], 

339 [9, 10, 8], 

340 [9, 11, 10], 

341 [12, 14, 13], 

342 [14, 15, 13], 

343 [17, 18, 16], 

344 [17, 19, 18], 

345 [20, 22, 21], 

346 [22, 23, 21], 

347 ] 

348 ), 

349 ) 

350 

351 np.testing.assert_equal( 

352 outline, 

353 np.array( 

354 [ 

355 [0, 2], 

356 [2, 3], 

357 [3, 1], 

358 [1, 0], 

359 [4, 6], 

360 [6, 7], 

361 [7, 5], 

362 [5, 4], 

363 [8, 10], 

364 [10, 11], 

365 [11, 9], 

366 [9, 8], 

367 [12, 14], 

368 [14, 15], 

369 [15, 13], 

370 [13, 12], 

371 [16, 18], 

372 [18, 19], 

373 [19, 17], 

374 [17, 16], 

375 [20, 22], 

376 [22, 23], 

377 [23, 21], 

378 [21, 20], 

379 ] 

380 ), 

381 ) 

382 

383 vertices, faces, outline = primitive_cube( 

384 width=0.2, 

385 height=0.4, 

386 depth=0.6, 

387 width_segments=1, 

388 height_segments=2, 

389 depth_segments=3, 

390 ) 

391 

392 np.testing.assert_allclose( 

393 vertices["position"], 

394 np.array( 

395 [ 

396 [-0.10000000, 0.30000001, -0.20000000], 

397 [0.10000000, 0.30000001, -0.20000000], 

398 [-0.10000000, 0.10000000, -0.20000000], 

399 [0.10000000, 0.10000000, -0.20000000], 

400 [-0.10000000, -0.10000000, -0.20000000], 

401 [0.10000000, -0.10000000, -0.20000000], 

402 [-0.10000000, -0.30000001, -0.20000000], 

403 [0.10000000, -0.30000001, -0.20000000], 

404 [-0.10000000, 0.30000001, 0.20000000], 

405 [0.10000000, 0.30000001, 0.20000000], 

406 [-0.10000000, 0.10000000, 0.20000000], 

407 [0.10000000, 0.10000000, 0.20000000], 

408 [-0.10000000, -0.10000000, 0.20000000], 

409 [0.10000000, -0.10000000, 0.20000000], 

410 [-0.10000000, -0.30000001, 0.20000000], 

411 [0.10000000, -0.30000001, 0.20000000], 

412 [0.10000000, -0.30000001, -0.20000000], 

413 [0.10000000, -0.30000001, 0.00000000], 

414 [0.10000000, -0.30000001, 0.20000000], 

415 [-0.10000000, -0.30000001, -0.20000000], 

416 [-0.10000000, -0.30000001, 0.00000000], 

417 [-0.10000000, -0.30000001, 0.20000000], 

418 [0.10000000, 0.30000001, -0.20000000], 

419 [0.10000000, 0.30000001, 0.00000000], 

420 [0.10000000, 0.30000001, 0.20000000], 

421 [-0.10000000, 0.30000001, -0.20000000], 

422 [-0.10000000, 0.30000001, 0.00000000], 

423 [-0.10000000, 0.30000001, 0.20000000], 

424 [-0.10000000, -0.30000001, 0.20000000], 

425 [-0.10000000, -0.10000000, 0.20000000], 

426 [-0.10000000, 0.10000000, 0.20000000], 

427 [-0.10000000, 0.30000001, 0.20000000], 

428 [-0.10000000, -0.30000001, -0.00000000], 

429 [-0.10000000, -0.10000000, -0.00000000], 

430 [-0.10000000, 0.10000000, -0.00000000], 

431 [-0.10000000, 0.30000001, -0.00000000], 

432 [-0.10000000, -0.30000001, -0.20000000], 

433 [-0.10000000, -0.10000000, -0.20000000], 

434 [-0.10000000, 0.10000000, -0.20000000], 

435 [-0.10000000, 0.30000001, -0.20000000], 

436 [0.10000000, -0.30000001, 0.20000000], 

437 [0.10000000, -0.10000000, 0.20000000], 

438 [0.10000000, 0.10000000, 0.20000000], 

439 [0.10000000, 0.30000001, 0.20000000], 

440 [0.10000000, -0.30000001, -0.00000000], 

441 [0.10000000, -0.10000000, -0.00000000], 

442 [0.10000000, 0.10000000, -0.00000000], 

443 [0.10000000, 0.30000001, -0.00000000], 

444 [0.10000000, -0.30000001, -0.20000000], 

445 [0.10000000, -0.10000000, -0.20000000], 

446 [0.10000000, 0.10000000, -0.20000000], 

447 [0.10000000, 0.30000001, -0.20000000], 

448 ] 

449 ), 

450 atol=TOLERANCE_ABSOLUTE_TESTS, 

451 ) 

452 

453 np.testing.assert_allclose( 

454 vertices["uv"], 

455 np.array( 

456 [ 

457 [0.00000000, 1.00000000], 

458 [1.00000000, 1.00000000], 

459 [0.00000000, 0.66666669], 

460 [1.00000000, 0.66666669], 

461 [0.00000000, 0.33333334], 

462 [1.00000000, 0.33333334], 

463 [0.00000000, 0.00000000], 

464 [1.00000000, 0.00000000], 

465 [0.00000000, 1.00000000], 

466 [1.00000000, 1.00000000], 

467 [0.00000000, 0.66666669], 

468 [1.00000000, 0.66666669], 

469 [0.00000000, 0.33333334], 

470 [1.00000000, 0.33333334], 

471 [0.00000000, 0.00000000], 

472 [1.00000000, 0.00000000], 

473 [0.00000000, 1.00000000], 

474 [0.50000000, 1.00000000], 

475 [1.00000000, 1.00000000], 

476 [0.00000000, 0.00000000], 

477 [0.50000000, 0.00000000], 

478 [1.00000000, 0.00000000], 

479 [0.00000000, 1.00000000], 

480 [0.50000000, 1.00000000], 

481 [1.00000000, 1.00000000], 

482 [0.00000000, 0.00000000], 

483 [0.50000000, 0.00000000], 

484 [1.00000000, 0.00000000], 

485 [0.00000000, 1.00000000], 

486 [0.33333334, 1.00000000], 

487 [0.66666669, 1.00000000], 

488 [1.00000000, 1.00000000], 

489 [0.00000000, 0.50000000], 

490 [0.33333334, 0.50000000], 

491 [0.66666669, 0.50000000], 

492 [1.00000000, 0.50000000], 

493 [0.00000000, 0.00000000], 

494 [0.33333334, 0.00000000], 

495 [0.66666669, 0.00000000], 

496 [1.00000000, 0.00000000], 

497 [0.00000000, 1.00000000], 

498 [0.33333334, 1.00000000], 

499 [0.66666669, 1.00000000], 

500 [1.00000000, 1.00000000], 

501 [0.00000000, 0.50000000], 

502 [0.33333334, 0.50000000], 

503 [0.66666669, 0.50000000], 

504 [1.00000000, 0.50000000], 

505 [0.00000000, 0.00000000], 

506 [0.33333334, 0.00000000], 

507 [0.66666669, 0.00000000], 

508 [1.00000000, 0.00000000], 

509 ] 

510 ), 

511 atol=TOLERANCE_ABSOLUTE_TESTS, 

512 ) 

513 

514 np.testing.assert_allclose( 

515 vertices["normal"], 

516 np.array( 

517 [ 

518 [-0.0, -0.0, -1.0], 

519 [0, 0, -1], 

520 [0, 0, -1], 

521 [0, 0, -1], 

522 [0, 0, -1], 

523 [0, 0, -1], 

524 [0, 0, -1], 

525 [0, 0, -1], 

526 [0, 0, 1], 

527 [0, 0, 1], 

528 [0, 0, 1], 

529 [0, 0, 1], 

530 [0, 0, 1], 

531 [0, 0, 1], 

532 [0, 0, 1], 

533 [0, 0, 1], 

534 [0, -1, 0], 

535 [0, -1, 0], 

536 [0, -1, 0], 

537 [0, -1, 0], 

538 [0, -1, 0], 

539 [0, -1, 0], 

540 [0, 1, 0], 

541 [0, 1, 0], 

542 [0, 1, 0], 

543 [0, 1, 0], 

544 [0, 1, 0], 

545 [0, 1, 0], 

546 [-1, 0, 0], 

547 [-1, 0, 0], 

548 [-1, 0, 0], 

549 [-1, 0, 0], 

550 [-1, 0, 0], 

551 [-1, 0, 0], 

552 [-1, 0, 0], 

553 [-1, 0, 0], 

554 [-1, 0, 0], 

555 [-1, 0, 0], 

556 [-1, 0, 0], 

557 [-1, 0, 0], 

558 [1, 0, 0], 

559 [1, 0, 0], 

560 [1, 0, 0], 

561 [1, 0, 0], 

562 [1, 0, 0], 

563 [1, 0, 0], 

564 [1, 0, 0], 

565 [1, 0, 0], 

566 [1, 0, 0], 

567 [1, 0, 0], 

568 [1, 0, 0], 

569 [1, 0, 0], 

570 ] 

571 ), 

572 atol=TOLERANCE_ABSOLUTE_TESTS, 

573 ) 

574 

575 np.testing.assert_allclose( 

576 vertices["colour"], 

577 np.array( 

578 [ 

579 [0.33333334, 1.00000000, 0.16666667, 1.00000000], 

580 [0.66666669, 1.00000000, 0.16666667, 1.00000000], 

581 [0.33333334, 0.66666669, 0.16666667, 1.00000000], 

582 [0.66666669, 0.66666669, 0.16666667, 1.00000000], 

583 [0.33333334, 0.33333334, 0.16666667, 1.00000000], 

584 [0.66666669, 0.33333334, 0.16666667, 1.00000000], 

585 [0.33333334, 0.00000000, 0.16666667, 1.00000000], 

586 [0.66666669, 0.00000000, 0.16666667, 1.00000000], 

587 [0.33333334, 1.00000000, 0.83333331, 1.00000000], 

588 [0.66666669, 1.00000000, 0.83333331, 1.00000000], 

589 [0.33333334, 0.66666669, 0.83333331, 1.00000000], 

590 [0.66666669, 0.66666669, 0.83333331, 1.00000000], 

591 [0.33333334, 0.33333334, 0.83333331, 1.00000000], 

592 [0.66666669, 0.33333334, 0.83333331, 1.00000000], 

593 [0.33333334, 0.00000000, 0.83333331, 1.00000000], 

594 [0.66666669, 0.00000000, 0.83333331, 1.00000000], 

595 [0.66666669, 0.00000000, 0.16666667, 1.00000000], 

596 [0.66666669, 0.00000000, 0.50000000, 1.00000000], 

597 [0.66666669, 0.00000000, 0.83333331, 1.00000000], 

598 [0.33333334, 0.00000000, 0.16666667, 1.00000000], 

599 [0.33333334, 0.00000000, 0.50000000, 1.00000000], 

600 [0.33333334, 0.00000000, 0.83333331, 1.00000000], 

601 [0.66666669, 1.00000000, 0.16666667, 1.00000000], 

602 [0.66666669, 1.00000000, 0.50000000, 1.00000000], 

603 [0.66666669, 1.00000000, 0.83333331, 1.00000000], 

604 [0.33333334, 1.00000000, 0.16666667, 1.00000000], 

605 [0.33333334, 1.00000000, 0.50000000, 1.00000000], 

606 [0.33333334, 1.00000000, 0.83333331, 1.00000000], 

607 [0.33333334, 0.00000000, 0.83333331, 1.00000000], 

608 [0.33333334, 0.33333334, 0.83333331, 1.00000000], 

609 [0.33333334, 0.66666669, 0.83333331, 1.00000000], 

610 [0.33333334, 1.00000000, 0.83333331, 1.00000000], 

611 [0.33333334, 0.00000000, 0.50000000, 1.00000000], 

612 [0.33333334, 0.33333334, 0.50000000, 1.00000000], 

613 [0.33333334, 0.66666669, 0.50000000, 1.00000000], 

614 [0.33333334, 1.00000000, 0.50000000, 1.00000000], 

615 [0.33333334, 0.00000000, 0.16666667, 1.00000000], 

616 [0.33333334, 0.33333334, 0.16666667, 1.00000000], 

617 [0.33333334, 0.66666669, 0.16666667, 1.00000000], 

618 [0.33333334, 1.00000000, 0.16666667, 1.00000000], 

619 [0.66666669, 0.00000000, 0.83333331, 1.00000000], 

620 [0.66666669, 0.33333334, 0.83333331, 1.00000000], 

621 [0.66666669, 0.66666669, 0.83333331, 1.00000000], 

622 [0.66666669, 1.00000000, 0.83333331, 1.00000000], 

623 [0.66666669, 0.00000000, 0.50000000, 1.00000000], 

624 [0.66666669, 0.33333334, 0.50000000, 1.00000000], 

625 [0.66666669, 0.66666669, 0.50000000, 1.00000000], 

626 [0.66666669, 1.00000000, 0.50000000, 1.00000000], 

627 [0.66666669, 0.00000000, 0.16666667, 1.00000000], 

628 [0.66666669, 0.33333334, 0.16666667, 1.00000000], 

629 [0.66666669, 0.66666669, 0.16666667, 1.00000000], 

630 [0.66666669, 1.00000000, 0.16666667, 1.00000000], 

631 ] 

632 ), 

633 atol=TOLERANCE_ABSOLUTE_TESTS, 

634 ) 

635 

636 np.testing.assert_equal( 

637 faces, 

638 np.array( 

639 [ 

640 [1, 2, 0], 

641 [1, 3, 2], 

642 [3, 4, 2], 

643 [3, 5, 4], 

644 [5, 6, 4], 

645 [5, 7, 6], 

646 [8, 10, 9], 

647 [10, 11, 9], 

648 [10, 12, 11], 

649 [12, 13, 11], 

650 [12, 14, 13], 

651 [14, 15, 13], 

652 [17, 19, 16], 

653 [17, 20, 19], 

654 [18, 20, 17], 

655 [18, 21, 20], 

656 [22, 25, 23], 

657 [25, 26, 23], 

658 [23, 26, 24], 

659 [26, 27, 24], 

660 [29, 32, 28], 

661 [29, 33, 32], 

662 [30, 33, 29], 

663 [30, 34, 33], 

664 [31, 34, 30], 

665 [31, 35, 34], 

666 [33, 36, 32], 

667 [33, 37, 36], 

668 [34, 37, 33], 

669 [34, 38, 37], 

670 [35, 38, 34], 

671 [35, 39, 38], 

672 [40, 44, 41], 

673 [44, 45, 41], 

674 [41, 45, 42], 

675 [45, 46, 42], 

676 [42, 46, 43], 

677 [46, 47, 43], 

678 [44, 48, 45], 

679 [48, 49, 45], 

680 [45, 49, 46], 

681 [49, 50, 46], 

682 [46, 50, 47], 

683 [50, 51, 47], 

684 ] 

685 ), 

686 ) 

687 

688 np.testing.assert_equal( 

689 outline, 

690 np.array( 

691 [ 

692 [0, 2], 

693 [2, 3], 

694 [3, 1], 

695 [1, 0], 

696 [2, 4], 

697 [4, 5], 

698 [5, 3], 

699 [3, 2], 

700 [4, 6], 

701 [6, 7], 

702 [7, 5], 

703 [5, 4], 

704 [8, 10], 

705 [10, 11], 

706 [11, 9], 

707 [9, 8], 

708 [10, 12], 

709 [12, 13], 

710 [13, 11], 

711 [11, 10], 

712 [12, 14], 

713 [14, 15], 

714 [15, 13], 

715 [13, 12], 

716 [16, 19], 

717 [19, 20], 

718 [20, 17], 

719 [17, 16], 

720 [17, 20], 

721 [20, 21], 

722 [21, 18], 

723 [18, 17], 

724 [22, 25], 

725 [25, 26], 

726 [26, 23], 

727 [23, 22], 

728 [23, 26], 

729 [26, 27], 

730 [27, 24], 

731 [24, 23], 

732 [28, 32], 

733 [32, 33], 

734 [33, 29], 

735 [29, 28], 

736 [29, 33], 

737 [33, 34], 

738 [34, 30], 

739 [30, 29], 

740 [30, 34], 

741 [34, 35], 

742 [35, 31], 

743 [31, 30], 

744 [32, 36], 

745 [36, 37], 

746 [37, 33], 

747 [33, 32], 

748 [33, 37], 

749 [37, 38], 

750 [38, 34], 

751 [34, 33], 

752 [34, 38], 

753 [38, 39], 

754 [39, 35], 

755 [35, 34], 

756 [40, 44], 

757 [44, 45], 

758 [45, 41], 

759 [41, 40], 

760 [41, 45], 

761 [45, 46], 

762 [46, 42], 

763 [42, 41], 

764 [42, 46], 

765 [46, 47], 

766 [47, 43], 

767 [43, 42], 

768 [44, 48], 

769 [48, 49], 

770 [49, 45], 

771 [45, 44], 

772 [45, 49], 

773 [49, 50], 

774 [50, 46], 

775 [46, 45], 

776 [46, 50], 

777 [50, 51], 

778 [51, 47], 

779 [47, 46], 

780 ] 

781 ), 

782 ) 

783 

784 for plane in MAPPING_PLANE_TO_AXIS: 

785 np.testing.assert_allclose( 

786 primitive_cube(planes=[plane])[0]["position"], # pyright: ignore 

787 primitive_cube(planes=[MAPPING_PLANE_TO_AXIS[plane]])[0]["position"], # pyright: ignore 

788 atol=TOLERANCE_ABSOLUTE_TESTS, 

789 )