trenchfoot 0.2.2__py3-none-any.whl → 0.2.3__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.

Potentially problematic release.


This version of trenchfoot might be problematic. Click here for more details.

@@ -128,6 +128,7 @@ def _offset_closed_polyline(path: List[Tuple[float,float]], offset: float) -> Li
128
128
  raise ValueError("Closed polyline needs at least 3 points")
129
129
 
130
130
  # Compute tangents treating path as closed loop
131
+ # For CCW-oriented polygons, use CW rotation to get outward-pointing normals
131
132
  tangents = []
132
133
  normals = []
133
134
  for i in range(n):
@@ -135,7 +136,7 @@ def _offset_closed_polyline(path: List[Tuple[float,float]], offset: float) -> Li
135
136
  if np.linalg.norm(t) < 1e-12:
136
137
  t = np.array([1.0, 0.0])
137
138
  tangents.append(t)
138
- normals.append(_rotate_ccw(t))
139
+ normals.append(_rotate_cw(t)) # CW rotation gives outward normal for CCW polygon
139
140
 
140
141
  # Compute offset points with proper miter at each vertex
141
142
  offset_pts = []
@@ -763,8 +764,8 @@ def make_ground_surface_plane(path_xy: List[Tuple[float,float]], width_top: floa
763
764
  the trench opening as an open hole. This creates a natural shape that
764
765
  hugs L-shaped, U-shaped, and curved trenches.
765
766
 
766
- For closed paths (like circles), also creates a center island inside
767
- the inner edge of the annular trench.
767
+ For closed paths (like circles), the ground surface is a ring around the
768
+ outer edge of the trench, with the trench opening left completely open.
768
769
  """
769
770
  half_top = width_top / 2.0
770
771
  m = float(max(0.5, ground.size_margin))
@@ -772,36 +773,23 @@ def make_ground_surface_plane(path_xy: List[Tuple[float,float]], width_top: floa
772
773
  is_closed = _is_path_closed(path_xy)
773
774
 
774
775
  if is_closed:
775
- # For closed paths, we have:
776
- # - Outer ground: annulus from ground_outer to trench_outer
777
- # - Center island: filled polygon inside trench_inner
776
+ # For closed paths (like circular wells), the ground is an annulus
777
+ # from the outer ground boundary to the outer edge of the trench opening.
778
+ # The center (inside the trench) is left completely open.
778
779
 
779
- # Trench boundaries
780
+ # Trench outer boundary (edge of trench opening)
780
781
  trench_outer = np.array(_offset_closed_polyline(path_xy, half_top), float)
781
- trench_inner = np.array(_offset_closed_polyline(path_xy, -half_top), float)
782
782
 
783
- # Ground outer boundary
783
+ # Ground outer boundary (edge of ground surface)
784
784
  ground_outer = np.array(_offset_closed_polyline(path_xy, half_top + m), float)
785
785
 
786
786
  # Ensure proper orientations
787
787
  trench_outer = _ensure_ccw(trench_outer)
788
- trench_inner = _ensure_ccw(trench_inner)
789
788
  ground_outer = _ensure_ccw(ground_outer)
790
789
 
791
- # Outer ground annulus
792
- outer_combined_xy, outer_tris = _triangulate_annulus(ground_outer, trench_outer)
793
- outer_Vg = np.array([[x, y, gfun(x, y)] for (x, y) in outer_combined_xy], float)
794
-
795
- # Center island (simple filled polygon)
796
- center_tris = _ear_clipping_triangulation(trench_inner)
797
- center_Vg = np.array([[x, y, gfun(x, y)] for (x, y) in trench_inner], float)
798
-
799
- # Combine into single ground surface
800
- n_outer_verts = len(outer_Vg)
801
- center_tris_offset = center_tris + n_outer_verts
802
-
803
- Vg = np.vstack([outer_Vg, center_Vg])
804
- tris = np.vstack([outer_tris, center_tris_offset])
790
+ # Ground annulus: from ground_outer to trench_outer
791
+ combined_xy, tris = _triangulate_annulus(ground_outer, trench_outer)
792
+ Vg = np.array([[x, y, gfun(x, y)] for (x, y) in combined_xy], float)
805
793
 
806
794
  return {"ground_surface": (Vg, tris)}
807
795
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trenchfoot
3
- Version: 0.2.2
3
+ Version: 0.2.3
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=EfldvoshgaZ6iZFk-UDL67-tvwGYaiZFS2NQZBMwhDM,1596
8
8
  trenchfoot/scene_spec_example.json,sha256=UcV25ku422UO0ZZPDrJwrT1zwmjoOIpnBdLuEdh-AZA,1028
9
- trenchfoot/trench_scene_generator_v3.py,sha256=gNYT_D8-7kI23RGCQeBCXG0lJTwttGKKuCy1diNoOR4,43324
9
+ trenchfoot/trench_scene_generator_v3.py,sha256=AbTQ90yOtEtVaKysItDRYQ595vIPZVQqpFGkU850Opc,43031
10
10
  trenchfoot/scenarios/SUMMARY.json,sha256=PUT7ID4nl5BJ6A0M3MhbOkx5bm2HAy0Gwzq8cc6JBAE,18492
11
11
  trenchfoot/scenarios/S01_straight_vwalls/metrics.json,sha256=_AoK-WCgTKKdu_zUJL-HiSnsxMJvr6GDxlet7Ojmtk4,691
12
12
  trenchfoot/scenarios/S01_straight_vwalls/preview.png,sha256=adsx3-6oMu9WaixggXRhuXi_KM-q5s2RNSBLR_stq80,199624
@@ -71,8 +71,8 @@ trenchfoot/scenarios/S07_circular_well/preview_top.png,sha256=XW7DQLDEYmSV6Lnfo1
71
71
  trenchfoot/scenarios/S07_circular_well/scene.json,sha256=bvror2YX6aNbsEc25-N7JO3ysH2dTLGyEE6zGzZysXQ,3146
72
72
  trenchfoot/scenarios/S07_circular_well/trench_scene.obj,sha256=1MAsyGkJ4-tCRXLDWi_7ruumgpCpcl_Ca5poRLtTua0,1619846
73
73
  trenchfoot/scenarios/S07_circular_well/volumetric/trench_volume.msh,sha256=dqhtd3SFKj5RLT_BcWIIvVGCbAqvOx7RX25-K7NKX10,615212
74
- trenchfoot-0.2.2.dist-info/METADATA,sha256=32oD4purZc8D9BqvfiYh6Tj--UaJD6VXXMo9LQfxcc8,5292
75
- trenchfoot-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
76
- trenchfoot-0.2.2.dist-info/entry_points.txt,sha256=5TejAGmc4GnNYLn7MhhLtSCNz9240RvzcNaetF4IHfg,119
77
- trenchfoot-0.2.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
78
- trenchfoot-0.2.2.dist-info/RECORD,,
74
+ trenchfoot-0.2.3.dist-info/METADATA,sha256=kbpaAePYuk_SrbL1xgQGn3lT-gZpFhX1G9Lb62Y1krI,5292
75
+ trenchfoot-0.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
76
+ trenchfoot-0.2.3.dist-info/entry_points.txt,sha256=5TejAGmc4GnNYLn7MhhLtSCNz9240RvzcNaetF4IHfg,119
77
+ trenchfoot-0.2.3.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
78
+ trenchfoot-0.2.3.dist-info/RECORD,,