trenchfoot 0.4.4__py3-none-any.whl → 0.4.5__py3-none-any.whl

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.
@@ -1340,6 +1340,58 @@ def _point_inside_trench(
1340
1340
  return abs(local_u) <= half_w
1341
1341
 
1342
1342
 
1343
+ def _is_beyond_trench_ends(
1344
+ x: float, y: float,
1345
+ path_xy: List[Tuple[float, float]],
1346
+ ) -> bool:
1347
+ """Check if a point is beyond the ends of an open trench path.
1348
+
1349
+ For open paths (not closed loops), points that project beyond the first
1350
+ or last vertex of the path are outside the trench void, even if their
1351
+ perpendicular distance would put them within the trench walls.
1352
+
1353
+ Returns True if the point is beyond either end of an open path.
1354
+ Returns False for closed paths (where there are no "ends").
1355
+ """
1356
+ if _is_path_closed(path_xy):
1357
+ return False # Closed paths have no ends to be beyond
1358
+
1359
+ P = np.array(path_xy, float)
1360
+ query = np.array([x, y], float)
1361
+
1362
+ # Check start of path (s=0)
1363
+ start = P[0]
1364
+ if len(P) > 1:
1365
+ # Tangent at start points in the direction of the path
1366
+ tangent_start = P[1] - P[0]
1367
+ tangent_start = tangent_start / (np.linalg.norm(tangent_start) + 1e-12)
1368
+ # Vector from start to query point
1369
+ to_query = query - start
1370
+ # Distance along tangent (negative means before the start)
1371
+ along_start = float(np.dot(to_query, tangent_start))
1372
+ # The trench has a vertical end wall at the start vertex.
1373
+ # Any point projecting before this wall is outside the trench.
1374
+ if along_start < 0:
1375
+ return True
1376
+
1377
+ # Check end of path (s=1)
1378
+ end = P[-1]
1379
+ if len(P) > 1:
1380
+ # Tangent at end points in the direction we came from
1381
+ tangent_end = P[-1] - P[-2]
1382
+ tangent_end = tangent_end / (np.linalg.norm(tangent_end) + 1e-12)
1383
+ # Vector from end to query point
1384
+ to_query = query - end
1385
+ # Distance along tangent (positive means past the end)
1386
+ along_end = float(np.dot(to_query, tangent_end))
1387
+ # The trench has a vertical end wall at the end vertex.
1388
+ # Any point projecting past this wall is outside the trench.
1389
+ if along_end > 0:
1390
+ return True
1391
+
1392
+ return False
1393
+
1394
+
1343
1395
  @dataclass
1344
1396
  class TruncationResult:
1345
1397
  """Result of computing pipe truncation."""
@@ -1405,6 +1457,11 @@ def _compute_pipe_truncation(
1405
1457
  if abs(local_u) + effective_radius > half_w:
1406
1458
  return False
1407
1459
 
1460
+ # Check trench end boundaries: for open trenches, pipe must not extend
1461
+ # beyond the vertical end walls at the start/end of the path
1462
+ if _is_beyond_trench_ends(x, y, path_xy):
1463
+ return False
1464
+
1408
1465
  return True
1409
1466
 
1410
1467
  def binary_search_boundary(t_inside: float, t_outside: float, tol: float = 0.001) -> float:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trenchfoot
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: Synthetic trench scenario generator bundle (surfaces + volumetrics).
5
5
  Author: Liam Moore
6
6
  License-File: LICENSE
@@ -6,7 +6,7 @@ trenchfoot/gmsh_sloped_trench_mesher.py,sha256=D7EL6V0wkE6tvDARmm006yZE6KEzCl25O
6
6
  trenchfoot/plot_mesh.py,sha256=26dOlVfaM1WsUfr_sXVqA7axtY9qjY3WCNM7cUBTS7Q,3810
7
7
  trenchfoot/render_colors.py,sha256=CWMre6DYa2EyrCgZsEY0bv313WqEhQdr3CdPF1xI-40,1649
8
8
  trenchfoot/scene_spec_example.json,sha256=UcV25ku422UO0ZZPDrJwrT1zwmjoOIpnBdLuEdh-AZA,1028
9
- trenchfoot/trench_scene_generator_v3.py,sha256=B2po9BugQj-gtn4JfOFrHCdqATZUWZ7P8qh_-uoQ4dg,75644
9
+ trenchfoot/trench_scene_generator_v3.py,sha256=Ct8DCQ1iur0Ia7RyYbmCKr525p3Od7zQhd2Of1KcwFM,77837
10
10
  trenchfoot/scenarios/SUMMARY.json,sha256=BWcI0HA4DWG-XOsr3bVJZGK5VmNtxSaOG86kxihfmh0,6831
11
11
  trenchfoot/scenarios/S01_straight_vwalls/ground_truth_isosurface.html,sha256=SLPROqEefBB8OgmZSW6DBmJxuSDxVQhWTn9eG3q6QRU,5880178
12
12
  trenchfoot/scenarios/S01_straight_vwalls/metrics.json,sha256=WZsyUfDIcJW1FFHfNq1wF8zn0r-XL3jCrkmowV4OFwA,691
@@ -22,50 +22,50 @@ trenchfoot/scenarios/S01_straight_vwalls/point_clouds/culled/resolution0p050.pth
22
22
  trenchfoot/scenarios/S01_straight_vwalls/point_clouds/full/resolution0p050.pth,sha256=w4AKFbud2V0NhAtudGXXheLynAq-NLxUFSPxLczK3T0,1352093
23
23
  trenchfoot/scenarios/S01_straight_vwalls/volumetric/trench_volume.msh,sha256=mpKNhdAPEogyDQrE9IGTgg535ZBNYXiLpIcmvl6QYPA,15007
24
24
  trenchfoot/scenarios/S02_straight_slope_pipe/ground_truth_isosurface.html,sha256=vHMtovoUUkmSGVh150se7hJERRBILzGr0iZYaJ6R1pw,6321783
25
- trenchfoot/scenarios/S02_straight_slope_pipe/metrics.json,sha256=quaLJZxP8DhUwVzskrY1TTBmNTY3cQOXBj37a5iOutk,928
25
+ trenchfoot/scenarios/S02_straight_slope_pipe/metrics.json,sha256=g8qKCa5t5gGE3-P9PTjFUn-z2ka3lxyWoI_pGjfAc9Q,929
26
26
  trenchfoot/scenarios/S02_straight_slope_pipe/preview.png,sha256=Aj5XpJMSdRNqnrPzL4oe-d0RjLdFT2V7OFrrZxwlsx8,251134
27
27
  trenchfoot/scenarios/S02_straight_slope_pipe/preview_oblique.png,sha256=8gTOJkd63NtXRkHcS31Sun_ClXiufqsxFeTVrPcG1no,173774
28
28
  trenchfoot/scenarios/S02_straight_slope_pipe/preview_side.png,sha256=Zwft-WEogsjPGcaUl7-Xd4kRIjewlbJ9h52MjS0pXB4,56706
29
29
  trenchfoot/scenarios/S02_straight_slope_pipe/preview_top.png,sha256=Su71iVHxgWIVPaYde4qnMiBR_gXix1n9bCSgmiYkO6M,57538
30
30
  trenchfoot/scenarios/S02_straight_slope_pipe/scene.json,sha256=W1ApzLHEnHQn-7AdWxh2xiEinj6Yb7830sQXNxmmmDw,486
31
31
  trenchfoot/scenarios/S02_straight_slope_pipe/sdf_metadata.json,sha256=5zWHXErct6UJro-6PzkCJqENG8PNAABVHBIIPg5sJfE,1211
32
- trenchfoot/scenarios/S02_straight_slope_pipe/trench_scene.obj,sha256=oBZQk-6yPKHd3mRp6l2qp2DpCDjOXNhtqz8WFFUlQ7g,333053
32
+ trenchfoot/scenarios/S02_straight_slope_pipe/trench_scene.obj,sha256=2FPl5hrUiE3WSW1vI2kkzhPpEshsyInEawOM2Ayk1pw,340328
33
33
  trenchfoot/scenarios/S02_straight_slope_pipe/meshes/trench_scene_culled.obj,sha256=OOiw80NuCBejzeN3MWAip9Haw8yQsLZEdlMQdDIgEMU,847
34
34
  trenchfoot/scenarios/S02_straight_slope_pipe/point_clouds/culled/resolution0p050.pth,sha256=Ug9hTIsm6iQKRs9cucXJyJpxpSvQ5f2GS1ytZmxi1mE,1623389
35
35
  trenchfoot/scenarios/S02_straight_slope_pipe/point_clouds/full/resolution0p050.pth,sha256=JgIRni8xWKtz2mm0gpSdmavGe-FF71mDervavM4Rqw8,1718877
36
36
  trenchfoot/scenarios/S02_straight_slope_pipe/volumetric/trench_volume.msh,sha256=kNFAqjr7dM-KX4JQV1u5GbHbWWFIfiEur1wV1fJCePA,47084
37
37
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/ground_truth_isosurface.html,sha256=0kRp_SHowhOHCljQV7CYaI0ur1KOzUjjjIJSwMdMoOI,6791920
38
- trenchfoot/scenarios/S03_L_slope_two_pipes_box/metrics.json,sha256=jI1yz_jxtWi8xKkbgu9ViNbiw63EMm1uIkBU_JJEY5c,1124
38
+ trenchfoot/scenarios/S03_L_slope_two_pipes_box/metrics.json,sha256=K1A8yiazMdnH4QBPIdrl88Uhaei8LdEz9P-RWKmYAi0,1124
39
39
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/preview.png,sha256=q0V_2HSLUl2ovWLc4INKV87aLVh3vzqabMyKr8XEWEg,224248
40
40
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/preview_oblique.png,sha256=Nvp0hvmG9HvZgbiEgbbI3uJtCLNFgLdamh8p2dw3ucY,154869
41
41
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/preview_side.png,sha256=57DnWIuV4p-7eguJVSshd0SZ0COy7Y2cedUMp_DrrjY,51284
42
42
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/preview_top.png,sha256=rs-CMZwaNUl5xef85WEckQqm_UqNrGcfE39nofvsp0E,48235
43
43
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/scene.json,sha256=72g4wMT8tWcLRDYyMoJXOK50PbpfC1DDt6VUYGZgFzM,941
44
44
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/sdf_metadata.json,sha256=6ESVHVGuw_PJzIUD65bMoTLazbU8_a29zEUjmwaQYGo,1774
45
- trenchfoot/scenarios/S03_L_slope_two_pipes_box/trench_scene.obj,sha256=_NZfaiXcSoFd9-UpVUAc5mti30rO0-xWb9Kvt44ndHo,677262
45
+ trenchfoot/scenarios/S03_L_slope_two_pipes_box/trench_scene.obj,sha256=YZvY0bhO5vjCb5seQb7-SG9SbgqdyMCCM6Og95heFaE,676874
46
46
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/meshes/trench_scene_culled.obj,sha256=At4lipowr_3MY1rxmcKa479F_mQ-jJDVQJe0yHTrFSc,1835
47
47
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/point_clouds/culled/resolution0p050.pth,sha256=KqbuoZ1tUPDhlnDgmhd-7WBb92TABsEmOzEsB__KtlA,2456029
48
48
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/point_clouds/full/resolution0p050.pth,sha256=4fXvfu0TMO9FJaoqYrW21SCGe3eKuSLkSUl9CdE14rw,2622685
49
49
  trenchfoot/scenarios/S03_L_slope_two_pipes_box/volumetric/trench_volume.msh,sha256=cPgHKHlzPPtWX8H1yaxAYsEgYba3fr2JjfPvgg2a000,87383
50
50
  trenchfoot/scenarios/S04_U_slope_multi_noise/ground_truth_isosurface.html,sha256=E7sa8dlDyICJBlnL9X2C8IEopEJzDMhHdLbW-WpoPFc,7184880
51
- trenchfoot/scenarios/S04_U_slope_multi_noise/metrics.json,sha256=Yfweq5vK1vGgjVGyOJj-yVn-Qpt5A8zSU1yqDtL4Ch4,1294
51
+ trenchfoot/scenarios/S04_U_slope_multi_noise/metrics.json,sha256=2o8LwqD4KKGwQC1oHs60i6aOP5nK2vOzLAVvGvQZ94w,1294
52
52
  trenchfoot/scenarios/S04_U_slope_multi_noise/preview.png,sha256=ZbLgrL0nRtUX1y77i7b3LCxw4w_j5Ivmmh0i2YzrBDs,238958
53
53
  trenchfoot/scenarios/S04_U_slope_multi_noise/preview_oblique.png,sha256=HKUWhUuuql2YZzqq4B5oDpQSCWy9RhuwY_JxVZ-bEbg,162693
54
54
  trenchfoot/scenarios/S04_U_slope_multi_noise/preview_side.png,sha256=S7n1ivuo1PFcMp_WuEEnJnCx2JMP5yiCCCYOFDzJtfY,77730
55
55
  trenchfoot/scenarios/S04_U_slope_multi_noise/preview_top.png,sha256=auLgGMvU1bRua43WrU-O2WelPy0TbPZZD7ALFIvqlqk,65419
56
56
  trenchfoot/scenarios/S04_U_slope_multi_noise/scene.json,sha256=jkUNZ_rHSjVajoj54o8KoeWzY3pFH97L5pdWiH_C75w,1119
57
57
  trenchfoot/scenarios/S04_U_slope_multi_noise/sdf_metadata.json,sha256=78CdQZwn01CBBfMr-4jUc3eOGNw9jxmWEmjwd7KvM6o,2234
58
- trenchfoot/scenarios/S04_U_slope_multi_noise/trench_scene.obj,sha256=QqbiUGgGlM-PRnixxw74izArBd3vK7HXEIX62Ky9jek,1211216
58
+ trenchfoot/scenarios/S04_U_slope_multi_noise/trench_scene.obj,sha256=er_f18snk8TQcboKdmlH2kOMAffR6S0BpliETvQT5iQ,1212223
59
59
  trenchfoot/scenarios/S04_U_slope_multi_noise/meshes/trench_scene_culled.obj,sha256=ykw_tzhXknXt3DbmSk3cBzbOL91Jm4zxjthp799YkWw,3206
60
60
  trenchfoot/scenarios/S04_U_slope_multi_noise/volumetric/trench_volume.msh,sha256=7KfGkJAlv19rzbaPhzbmy9UWo42Db_4VhAtisn6aMak,144623
61
61
  trenchfoot/scenarios/S05_wide_slope_pair/ground_truth_isosurface.html,sha256=MVKZHfrF2emDTNmpn7AhxqYUlcBXDUzY7_qSek2RpWg,6304070
62
- trenchfoot/scenarios/S05_wide_slope_pair/metrics.json,sha256=igpHy0ClKBKUMr8XUjkad-L4NhbpgcYXW0UHOJrQDxM,1109
62
+ trenchfoot/scenarios/S05_wide_slope_pair/metrics.json,sha256=ejqAir1__oegf0jF_N6R3vyFfCjlzP-zF-qsulS4ln4,1109
63
63
  trenchfoot/scenarios/S05_wide_slope_pair/preview_oblique.png,sha256=S0MwfT2bC0T7AAUsqwDAIBxxRea6lHeYhQYrumwJfFU,139982
64
64
  trenchfoot/scenarios/S05_wide_slope_pair/preview_side.png,sha256=8hiJ5ZZZ6iqIdPakWsgWDPrJnEuU7Qqy-odjnR38ocM,67796
65
65
  trenchfoot/scenarios/S05_wide_slope_pair/preview_top.png,sha256=bDdjWwBN6QQfZ2kV71VbV_Q59nrPYAiUMh3ivRo4L9M,57737
66
66
  trenchfoot/scenarios/S05_wide_slope_pair/scene.json,sha256=jmNMzqR8m4DvR35325GH87FdYXRgVb5VuKu7ZwDovW0,1028
67
67
  trenchfoot/scenarios/S05_wide_slope_pair/sdf_metadata.json,sha256=PRaqys_akemKtlfTwhJBELx5erUHKarjHMgMvU5R4kc,1776
68
- trenchfoot/scenarios/S05_wide_slope_pair/trench_scene.obj,sha256=cZOoLXbK7dQIe9C1UYTc0Ko4GMCMiJNIz73WrJ8haaA,694460
68
+ trenchfoot/scenarios/S05_wide_slope_pair/trench_scene.obj,sha256=udbLJuiOVA9VyNvZbWwmuTdgyXKmu2a_sLTGJDp61o0,693480
69
69
  trenchfoot/scenarios/S05_wide_slope_pair/volumetric/trench_volume.msh,sha256=pHrj2dJgpSklpxiHHThiZINJQWpUdvkfhUnVBpKASEM,123235
70
70
  trenchfoot/scenarios/S06_bumpy_wide_loop/ground_truth_isosurface.html,sha256=_p4-B7sg_lfvKzVwJyfg6ub5Nk_x-ekzmLUE2NxQvkQ,6600554
71
71
  trenchfoot/scenarios/S06_bumpy_wide_loop/metrics.json,sha256=CH9ubdgvXhEBX6hi0Hme8B2jMX_HVHQGyqh5w8a-veE,1220
@@ -85,8 +85,8 @@ trenchfoot/scenarios/S07_circular_well/scene.json,sha256=tLLEgEWNxARpvHXkgLNDRvm
85
85
  trenchfoot/scenarios/S07_circular_well/sdf_metadata.json,sha256=5_D_rA_CqWgg2uSgVlqWCO4zQg0Gg5NWUnXHtCERBUA,4776
86
86
  trenchfoot/scenarios/S07_circular_well/trench_scene.obj,sha256=PHsRceUTwRAc44sppI2HnCeWkqUPafS-LcTe_50rP84,1608845
87
87
  trenchfoot/scenarios/S07_circular_well/volumetric/trench_volume.msh,sha256=dqhtd3SFKj5RLT_BcWIIvVGCbAqvOx7RX25-K7NKX10,615212
88
- trenchfoot-0.4.4.dist-info/METADATA,sha256=9Uqjk87_kPrDsLPV3i3FOB_d9-3Zni7LYxtm_cS2fag,5292
89
- trenchfoot-0.4.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
90
- trenchfoot-0.4.4.dist-info/entry_points.txt,sha256=5TejAGmc4GnNYLn7MhhLtSCNz9240RvzcNaetF4IHfg,119
91
- trenchfoot-0.4.4.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
92
- trenchfoot-0.4.4.dist-info/RECORD,,
88
+ trenchfoot-0.4.5.dist-info/METADATA,sha256=u8rwlE8sWWjnjx5bU84gZuN88ppNvzv4GZ9BKpqRJGE,5292
89
+ trenchfoot-0.4.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
90
+ trenchfoot-0.4.5.dist-info/entry_points.txt,sha256=5TejAGmc4GnNYLn7MhhLtSCNz9240RvzcNaetF4IHfg,119
91
+ trenchfoot-0.4.5.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
92
+ trenchfoot-0.4.5.dist-info/RECORD,,