ttricco / sarracen

A Python library for smoothed particle hydrodynamics (SPH) analysis and visualization.
https://sarracen.readthedocs.io
GNU General Public License v3.0
15 stars 17 forks source link

Pixel culling fix for exact interpolation #54

Closed AndrewHarris709 closed 1 year ago

AndrewHarris709 commented 1 year ago

Fixes cases for exact rendering where pixels on the edge of a particle's smoothing circle were incorrectly cut.

As an example, here is a single particle drawn at a low resolution for both exact & fast rendering with this change applied: image

Before this fix, the exact and fast interpolations looked identical, with the outermost pixels not included in the exact interpolation.

This should resolve #49.

ttricco commented 1 year ago

The issue was around pixels on the periphery of the kernel. Any overlap between a pixel and the kernel must be included. Previously, some pixels might not be included due to the rounding that was used (which was fine for the fast case, but not exact).