Skip to content

Remove Gaussian/SciPy (PR #11), restore strict MATLAB-faithful H-kernel implementation - #12

Merged
QL-UoHull merged 4 commits into
mainfrom
copilot/corrective-follow-up-pr-11
Jul 16, 2026
Merged

QL-UoHull merged 4 commits into
mainfrom
copilot/corrective-follow-up-pr-11

Conversation

Copilot AI commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

PR #11 replaced the intended MATLAB construction with an isotropic Gaussian boundary integral using scipy.special.ndtr, which has no equivalent in any MATLAB source file and incorrectly rendered n as a no-op. This PR reverts that substitution and implements the correct MATLAB-derived evaluator.

Core mathematical change

The public evaluator imp_spline_2d now uses the H-kernel boundary integral — derived from MATLAB H.m via Green's theorem:

f(x,y) = ∮_{∂Ω CCW} (1 − H(Δx + δ/2, δ, n)) · H′(Δy + δ/2, δ, n) dy
  • Additive: internal decomposition edges cancel to floating-point precision — no seams, no normalization hacks
  • delta and n match MATLAB H.m semantics exactly; field is C^(n−1)
  • No SciPy dependency; no Gaussian anywhere in the public API

MATLAB-to-Python primitive mapping

MATLAB Python
H.m H(t, delta, n)
Lxy.m / Lxy00.m lxy(...) / lxy00(...)
Point_imp.m point_imp(...)
LineSeg_imp.m line_seg_imp(...)
L_corner_inter.m l_corner_inter(...)
U_Angle_inter.m u_angle_inter(...)
Square_Angle_inter.m square_angle_inter(...)
ImpSpline2D.m convex_product_spline_2d(...)

Key fixes

  • core.py: Removed scipy.special.ndtr; replaced with H-kernel boundary integral. All MATLAB primitives ported with source-file citations. Default quadrature order raised 16 → 96 (the narrow compact support of H′ requires sufficient GL nodes to avoid ~66% integration error on large polygons).
  • requirements.txt: Removed scipy>=1.7.
  • __init__.py: Exports all new MATLAB primitives; version → 0.2.0.
  • tests/: Removed 3 Gaussian-specific tests (rotation invariance, C^∞ contour sharpness, grid refinement). Added MATLAB parity tests for every primitive and C^(n−1) smoothness validation consistent with MATLAB's claimed behaviour.

Copilot AI changed the title [WIP] Revert Gaussian behavior from PR #11 for strict MATLAB compliance Remove Gaussian/SciPy (PR #11), restore strict MATLAB-faithful H-kernel implementation Jul 16, 2026
Copilot AI requested a review from QL-UoHull July 16, 2026 22:17
@QL-UoHull
QL-UoHull marked this pull request as ready for review July 16, 2026 22:46
Copilot AI review requested due to automatic review settings July 16, 2026 22:46
@QL-UoHull
QL-UoHull merged commit eb1fe8c into main Jul 16, 2026
1 check failed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@QL-UoHull
QL-UoHull deleted the copilot/corrective-follow-up-pr-11 branch July 16, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants