Message Boards Message Boards

4 Replies
2 Total Likes
View groups...
Share this post:

Is this a bug in ParametricRegion?

Posted 10 years ago

This doesn't seem to work. Is it a bug or a limitation of ParametricRegion?

Make a spline function that returns a pair of real values for a parameter 0<s<1:

pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}};
spl = BSplineFunction[pts]

Valid syntax for ParametricRegion is:

ParametricRegion[{Cos[t], Sin[t]}, {{t, 0, 2 Pi}}]

However, these throw an error:

parRegion = ParametricRegion[spl[t], {{t, 0, 1}}]

parRegion = ParametricRegion[Evaluate@spl[t], {{t, 0, 1}}]

And, more bizarrely, this doesn't throw an error but gives a result that appears to be wrong:

fx[t_] := First[spl[t]]
fy[t_] := Last[spl[t]]
ParametricRegion[{fx[t], fy[t]}, {{t, 0, 1}}]


ParametricRegion[{{t, t}, 0 <= t <= 1}, {t}]

POSTED BY: W. Craig Carter
4 Replies

Have you looked at the plot of spl? Is that what was intended? It looks like the problem is in the spline function.

enter image description here

Hello David, That is not what I am seeing:

pts = {{0, 0}, {1, 1}, {2, -1}, {3, 0}};
spl = BSplineFunction[pts]
ParametricPlot[spl[t], {t, 0, 1}]

enter image description here

Am I doing something wrong?

POSTED BY: W. Craig Carter

The strange result is simply due to evaluation:

In[3]:= First[foo[bar][t]]

Out[3]= t

ParametricRegion isn't going to be very useful without an explicit symbolic formula. You can get a MeshRegion, however:

POSTED BY: Ilian Gachevski

Sorry Craig, my mistake. You can get a Region by using:

g = ParametricPlot[spl[t], {t, 0, 1}]
gRegion = DiscretizeGraphics[g]

That works as a region. For example:

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract