sdf-sampler 0.5.0__py3-none-any.whl → 0.6.0__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.
@@ -80,17 +80,18 @@ def sample_box_inverse_square(
80
80
  """Generate samples from a box with inverse-square density distribution.
81
81
 
82
82
  Samples more points near the surface (point cloud) and fewer far away.
83
+ Uses actual distance to surface for phi values (signed distance).
83
84
 
84
85
  Args:
85
86
  constraint: Box constraint to sample
86
87
  rng: Random number generator
87
- near_band: Near-band width for offset
88
+ near_band: Near-band width for density weighting (not phi assignment)
88
89
  n_samples: Number of samples to generate
89
90
  surface_tree: KDTree of surface points for distance computation
90
91
  falloff: Falloff exponent (higher = faster falloff)
91
92
 
92
93
  Returns:
93
- List of TrainingSample objects
94
+ List of TrainingSample objects with phi = actual signed distance to surface
94
95
  """
95
96
  samples = []
96
97
  center = np.array(constraint.center)
@@ -109,8 +110,11 @@ def sample_box_inverse_square(
109
110
  weight = (near_band / min_dist) ** falloff
110
111
 
111
112
  if rng.random() < min(1.0, weight):
112
- offset = near_band if constraint.sign == SignConvention.EMPTY else -near_band
113
- phi = offset
113
+ # Use actual distance to surface for phi, with sign based on constraint type
114
+ # EMPTY regions have positive phi (outside surface)
115
+ # SOLID regions have negative phi (inside surface)
116
+ sign = 1.0 if constraint.sign == SignConvention.EMPTY else -1.0
117
+ phi = sign * float(dist_to_surface)
114
118
 
115
119
  samples.append(
116
120
  TrainingSample(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdf-sampler
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: Auto-analysis and sampling of point clouds for SDF (Signed Distance Field) training data generation
5
5
  Project-URL: Repository, https://github.com/Chiark-Collective/sdf-sampler
6
6
  Author-email: Liam <liam@example.com>
@@ -17,12 +17,12 @@ sdf_sampler/models/analysis.py,sha256=xSzz1jmpV3mOSM4gIF3NR4dhPXPH6UlxIgxZSOke5y
17
17
  sdf_sampler/models/constraints.py,sha256=k0v6-JwXmUkFXGycDpPG44amjoRo13xz1ggqdr9NVtE,7316
18
18
  sdf_sampler/models/samples.py,sha256=0DD7Z8D70zJKRTq16pik9SgGiRDeXh56EqmBZfql_sk,1474
19
19
  sdf_sampler/sampling/__init__.py,sha256=mbeU9DTHxR4R1D4WqjEzaYHq7bV1nSv-wywc3YoD_Lg,492
20
- sdf_sampler/sampling/box.py,sha256=qRAumR1z_7vU9rfNvk-B6xNu62UeHSyQNghYiTwVR_Y,3912
20
+ sdf_sampler/sampling/box.py,sha256=_CNJ98tl09NegA1XOECEVZWpigwsrAx_nP6cUmNHYR4,4284
21
21
  sdf_sampler/sampling/brush.py,sha256=CcAgOYLdYXMM3y_H4fIwyzRJ8PZivFxkUHP7d0ElpNM,1991
22
22
  sdf_sampler/sampling/ray_carve.py,sha256=EsfzEGk33q0iWVzOJKDAJi2iWEsY-JZXmEfEZ0dmNdg,4444
23
23
  sdf_sampler/sampling/sphere.py,sha256=Xqpwq-RcEnAD6HhoyIC-ErxRHDknDKMtYf6aWUJ43_U,1680
24
- sdf_sampler-0.5.0.dist-info/METADATA,sha256=ADbLw7eMU236XZthdMxpRPrJSVL-gLN-eEyGH56r5PE,10481
25
- sdf_sampler-0.5.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
- sdf_sampler-0.5.0.dist-info/entry_points.txt,sha256=2IMWFbDYEqVUkpiRF1BlRMOhipeirPJSbv5PIOIZrvA,53
27
- sdf_sampler-0.5.0.dist-info/licenses/LICENSE,sha256=eeB8aLnEG-dgFYs2KqfMJaP52GFQT8sZPHwaYnHRW8E,1061
28
- sdf_sampler-0.5.0.dist-info/RECORD,,
24
+ sdf_sampler-0.6.0.dist-info/METADATA,sha256=Gi2B0UQmqjula9BBpah3C2WMAjrOk20mcP_EUss_rp0,10481
25
+ sdf_sampler-0.6.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
+ sdf_sampler-0.6.0.dist-info/entry_points.txt,sha256=2IMWFbDYEqVUkpiRF1BlRMOhipeirPJSbv5PIOIZrvA,53
27
+ sdf_sampler-0.6.0.dist-info/licenses/LICENSE,sha256=eeB8aLnEG-dgFYs2KqfMJaP52GFQT8sZPHwaYnHRW8E,1061
28
+ sdf_sampler-0.6.0.dist-info/RECORD,,