-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Hi,
This is not an issue, just a proposal to include isolines as other 2D representations of SDF.
To something like this
The change in code is not that much, this is an example.
def show_slice(*args, **kwargs):
import matplotlib.pyplot as plt
from matplotlib.colors import TwoSlopeNorm
a, extent, axes = sample_slice(*args, **kwargs)
norm = TwoSlopeNorm(vmin=a.min(), vcenter=0, vmax=a.max())
im = plt.imshow(a, extent=extent, origin='lower', cmap="PRGn", norm=norm)
plt.contour(a, colors='white', alpha=0.5, extent=extent) # Add semi-transparent isolines
plt.contour(a, levels=[0], colors='black', extent=extent) # Add isoline at 0
plt.xlabel(axes[0])
plt.ylabel(axes[1])
plt.colorbar(im)
plt.show()The idea is to use a diverging color map centered at 0, add isonlines shown in white and add a single isoline shown in black representing the boundary of the solid.
Metadata
Metadata
Assignees
Labels
No labels

