@@ -285,6 +285,50 @@ const checkGeometryDefinitions = (labwareDef: LabwareDefinition2): void => {
285
285
}
286
286
} )
287
287
288
+ test ( 'first frustum section should match well diameter or x/y dimensions within ±1 mm' , ( ) => {
289
+ // TODO(rc, 2025-08-05): Review labware with 0–2 mm geometry discrepancies.
290
+ const wells = labwareDef . wells ?? { }
291
+ const geometries = labwareDef . innerLabwareGeometry ?? { }
292
+ // Allow minor mismatch due to simplified geometric approximation
293
+ const allowedDiscrepancy = 2
294
+ // Ignoring bc of a known x y mismatch
295
+ if (
296
+ labwareDef . parameters . loadName === 'nest_1_reservoir_195ml' &&
297
+ labwareDef . version === 3
298
+ ) {
299
+ return
300
+ }
301
+
302
+ for ( const well of Object . values ( wells ) ) {
303
+ const geometryId = well . geometryDefinitionId ?? ''
304
+ const geometry = geometries [ geometryId ]
305
+
306
+ if (
307
+ ! geometry ||
308
+ ! ( 'sections' in geometry ) ||
309
+ ! Array . isArray ( geometry . sections )
310
+ ) {
311
+ continue
312
+ }
313
+
314
+ const section = geometry . sections [ 0 ]
315
+ if ( ! section ) continue
316
+
317
+ if ( well . shape === 'circular' && section . shape === 'conical' ) {
318
+ expect (
319
+ Math . abs ( section . topDiameter - well . diameter )
320
+ ) . toBeLessThanOrEqual ( allowedDiscrepancy )
321
+ } else if ( well . shape === 'rectangular' && section . shape === 'cuboidal' ) {
322
+ expect (
323
+ Math . abs ( section . topXDimension - well . xDimension )
324
+ ) . toBeLessThanOrEqual ( allowedDiscrepancy )
325
+ expect (
326
+ Math . abs ( section . topYDimension - well . yDimension )
327
+ ) . toBeLessThanOrEqual ( allowedDiscrepancy )
328
+ }
329
+ }
330
+ } )
331
+
288
332
test ( 'the bottom of a well geometry should be at height 0' , ( ) => {
289
333
for ( const geometry of Object . values (
290
334
labwareDef . innerLabwareGeometry ?? { }
0 commit comments