Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • $\begingroup$ For the first part you can use pts = {{.5, 0}, {1, 0}, {1, 1}, {.5, 1}, {0, 1}, {0, 0}}; Graphics@BSplineCurve[pts, SplineClosed -> True] so that you don,'t need to duplicate the first or last point. There is a bug I thing in DiscretizeGraphics. It forgets to ckeck if the shape is closed. And algorithm skips the last segment. $\endgroup$ Commented Dec 11, 2015 at 9:54
  • $\begingroup$ ahhh, I don't know much about BSplineCurve, I grabbed that list of points from the help page. But even for a non-closed BSplineCurve, DiscretizeGraphics will omit points. Try this, gr = Graphics[{BezierCurve[{{0, 1}, {1, 1}, {2, -1}, {5, 2}}]}]; dgr = DiscretizeGraphics[gr]; Show[gr, dgr] $\endgroup$ Commented Dec 11, 2015 at 9:57
  • $\begingroup$ Yes, I think here is a bug in DiscretizeGraphics algorithm skips the last segment. $\endgroup$ Commented Dec 11, 2015 at 10:09
  • $\begingroup$ You might consider using ParametricPlot[] to adaptively sample your BSplineFunction[]. $\endgroup$ Commented Dec 11, 2015 at 11:22
  • $\begingroup$ @J.M. then how do I combine the graphics together? If I just use Show[g1,g2] where g1 and g2 are two different ParametricPlots, with different PlotRanges, it won't show the whole thing. But if they are Line objects, Graphics[g1,g2] automatically shows everything. $\endgroup$ Commented Dec 11, 2015 at 11:44