Updated
We use {x - x0, y - y0} . AngleVector[t]
to calculate the sign distance from the line through the center {x0,y0}
of the polygon.
Use Rescale
to limit the range of the distance to the interval [0,1]
.
Set the Blend
color from Red
to White
then to Blue
.
pol = {{1/2, 0, 0}, {1, 0, 0}, {5/4, Sqrt[3]/4, 0}, {1, Sqrt[3]/2,
0}, {1/2, Sqrt[3]/2, 0}, {1/4, Sqrt[3]/4, 0}, {1/2, 0, 0}};
{x0, y0, z0} = RegionCentroid@Polygon@pol;
t = π/2;
RegionPlot3D[Polygon@pol, PlotPoints -> 100, MaxRecursion -> 6,
Mesh -> None,
ColorFunction ->
Function[{x, y, z},
Blend[{{0, Red}, {.5, White}, {1, Blue}},
Rescale[{x - x0, y - y0} . AngleVector[t], {-(Sqrt[3]/4),
Sqrt[3]/4}]]], ColorFunctionScaling -> False,
Lighting -> {{"Ambient", White}}, PerformanceGoal -> "Quality",
Boxed -> False, Axes -> False]


Original
Maybe similar with this result.
RegionPlot3D[Polygon@pol, PlotPoints -> 100, MaxRecursion -> 4,
ColorFunction ->
Function[{x, y, z}, Blend[{{0, Red}, {.5, White}, {1, Red}}, y]],
ColorFunctionScaling -> True, Boxed -> False]

- Or set the color function be the distance from the line through the center of polygon.
{x0, y0, z0} = RegionCentroid@Polygon@pol;
ani = Manipulate[
RegionPlot3D[Polygon@pol, PlotPoints -> 80, MaxRecursion -> 4,
Mesh -> None,
ColorFunction ->
Function[{x, y, z},
Blend[{{1, Red}, {0, White}},
2.5 Abs[{x - x0, y - y0} . AngleVector[t]]]],
ColorFunctionScaling -> False, Lighting -> "Neutral",
PerformanceGoal -> "Quality", Boxed -> False, Axes -> False], {t,
0, 2 Pi}]
