# tracing – How can we eliminate moire artifacts from ListDensityPlot3D?

I have difficulty eliminating some moire-type artifacts from the 3D output of `ListDensityPlot3D`.

Here is an example:

``````n = 1.5;
ρCore = 166;
bdElectronDensityConversion = 5.25 * ^ 23 * ρCore;
ξCore = \$ MachineEpsilon;
R = 8.26 * ^ 9 * Quantity["cm"];
M = 0.04 * Quantity["SolarMass"];
K = (M ^ (1/3) * R * Quantity["GravitationalConstant"]) / 2.3573;
a = Sqrt[((n + 1)*(K*(ρCore*Quantity["g/cc"]) ^ ((1 - n) / n)))
/ (4 * Pi * Quantity["GravitationalConstant"])];
ξRadius = (QuantityMagnitude[UnitConvert[R]]/ QuantityMagnitude[UnitConvert[a]])
system = {Dt[ξ^2*Derivative[θ][ξ], {ξ}]/ ξ ^ 2
== -θ[ξ]^ n,
θ[ξCore] == 1,
Derivative[θ][ξCore]    == 0};
sol = NDSolve[system, θ, {ξ, ξCore, ξRadius}][[[[];

Rkm = QuantityMagnitude @ UnitConvert[R, "km"];
Show[DensityPlot3D[
(bdElectronDensityConversion*θ[Sqrt[(x*ξRadius/Rkm)^2
+ (y*ξRadius/Rkm)^2 + (z*ξRadius/Rkm)^2]]^ n /. ground),
{x, y, z} ∈ RegionDifference[
Ball[{0, 0, 0}, Rkm], Cuboid[{0, -Rkm, 0}, {Rkm, Rkm, Rkm}]],
PerformanceGoal -> "Quality", PlotPoints -> 200,
OpacityFunction -> None,
ColorFunction -> ColorData[{"SolarColors", {1*^25, 8*^25}}],
ColorFunctionScaling -> False], Image size -> Large]
``````

When I run this code, I see this: Unfortunately, moiré artifacts run through the cut faces of the balloon, giving the false impression that a spherical non-symmetrical structure exists in the solution. This could mislead anyone who hopes to interpret the plot!

I would greatly appreciate any advice on the removal of these artifacts. I have tried to increase `PointsPot`, in vain.

Thank you!

Posted on