src.tests.simple_curve_extractor_unit_test
Classes
- class src.tests.simple_curve_extractor_unit_test.SimpleCurveExtractorUnitTest
- Author:
Alberto M. Esmoris Pena
Regression unit test for the “shorter wins” invariant enforced by
SimpleCurveExtractor ._drop_coverage_crossing_features()when both colliding features are taggedSKEL_MTH='coverage_refine'.Fixture (synthetic, deterministic):
Feature A: 4 points forming the horizontal segment \(y=0\) from \(x=0\) to \(x=10\), arc length ~10 m,
SKEL_MTH='coverage_refine',CURVE_ID=0.Feature B: 4 points forming the vertical segment \(x=5\) from \(y=-10\) to \(y=10\), arc length ~20 m,
SKEL_MTH='coverage_refine',CURVE_ID=0.The 2D segments cross at \((5, 0)\) and share a bbox-grid cell at
cell_size = 5.0, so the C++curve_segments_cross_dhelper must emit the crossing pair.length_2d(A) = 10 < length_2d(B) = 20STRICTLY, so the shorter-wins tie-break cannot be confused with an arbitrary ordering.
With
predicate=lambda fa, fb, md: Truethe helper must return{0}(the index of feature A, the shorter one). If it returns{1}instead, the invariant is broken and the test fails.- EXPECTED_LEN_A_ = 10.0
- EXPECTED_LEN_B_ = 20.0
- STRICT_MARGIN_ = 1.0
- __init__()
Basic configuration for any VL3D test.
- Parameters:
name (str) – Test name
- run()
Run the “shorter wins” unit test for
SimpleCurveExtractor ._drop_coverage_crossing_features().- Returns:
Trueif the drop set equals{0},Falseotherwise.- Return type:
bool