If we are given a closed curve $(x(t),y(t))$, $0<t<L$, then how to extract the region inside it ?
I have seen answers that use FilledCurve
and BSpline
, but I don't want to extract some points and then join them again into an spline. For instance, consider the rhombus
x[t_] := -(Piecewise[{{-1, Inequality[0, Less, t, LessEqual, 2]},
{-3 + t, Inequality[2, Less, t, LessEqual, 4]},
{1, Inequality[4, Less, t, LessEqual, 6]},
{7 - t, Inequality[6, Less, t, LessEqual, 8]}}, 0]/Sqrt[2]) +
Piecewise[{{-1 + t, Inequality[0, Less, t, LessEqual, 2]},
{1, Inequality[2, Less, t, LessEqual, 4]},
{5 - t, Inequality[4, Less, t, LessEqual, 6]},
{-1, Inequality[6, Less, t, LessEqual, 8]}}, 0]/Sqrt[2]
y[t_] := Piecewise[{{-1, Inequality[0, Less, t, LessEqual, 2]},
{-3 + t, Inequality[2, Less, t, LessEqual, 4]},
{1, Inequality[4, Less, t, LessEqual, 6]},
{7 - t, Inequality[6, Less, t, LessEqual, 8]}}, 0]/Sqrt[2] +
Piecewise[{{-1 + t, Inequality[0, Less, t, LessEqual, 2]},
{1, Inequality[2, Less, t, LessEqual, 4]},
{5 - t, Inequality[4, Less, t, LessEqual, 6]},
{-1, Inequality[6, Less, t, LessEqual, 8]}}, 0]/Sqrt[2]
(nothing special about it, just as an example) then how to get interior as a discretized region ?
poly = Polygon@Table[{x[t], y[t]}, {t, 1, 8, 1}]
? $\endgroup$ParametricRegion[{x[t], y[t]}, {{t, 0, 8}}]
, but that just gets us a 1-D region. To get a 2-D region, I think you're going to need to provide the 2-D parameterization. You could do this by adding a second parameter and filling out the interior with vectors from {0,0} to {x[t],y[t]}. I'm not aware of a built-in function that automatically creates "interior" regions from non-mesh boundary regions in the general case. $\endgroup$