Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answerthis answer over on stackoverflow,

Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answer over on stackoverflow,

Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answer over on stackoverflow,

replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. It seems at first to be related to this problemthis problem with discretizing Bezier curves, but there you have the problem that BezierFunction is awful. Here we have a workaround, because BSplineFunction works just fine.

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. It seems at first to be related to this problem with discretizing Bezier curves, but there you have the problem that BezierFunction is awful. Here we have a workaround, because BSplineFunction works just fine.

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. It seems at first to be related to this problem with discretizing Bezier curves, but there you have the problem that BezierFunction is awful. Here we have a workaround, because BSplineFunction works just fine.

Bounty Awarded with 50 reputation awarded by M.R.
added 988 characters in body
Source Link
Jason B.
  • 72.3k
  • 3
  • 152
  • 317

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. But I've got It seems at first to be related to this problem with discretizing Bezier curves, but there you have the problem that BezierFunction is awful. Here we have a workaround, because BSplineFunction works just fine. Just

Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answer over on stackoverflow,

And I can't seem to improve the plot on the left with any combination of options to DiscretizeGraphics (AccuracyGoal, PerformanceGoal, PrecisionGoal, or MeshQualityGoal). It must be possible, as M.R.'s DiscretizeGraphics in his example image looks much better than mine. I'm using version 10.2, perhaps it has been improved in version 10.3?

Edit2 Following J.M.'s suggestion, I've worked up a version that uses ParametricPlot to adaptively sample the BSplineFunction. It seems to be an order of magnitude slower (not that it is all that slow), and ends up plotting many more points, but it could lead to a more faithful reproduction of the original BSplineCurve objects,

discretizeGraphics2b[graphics_] := DiscretizeGraphics@(graphics /. {BSplineCurve[ a__] :> (Line@(Cases[ ParametricPlot[BSplineFunction[a][t], {t, 0, 1}], Line[{x__}] :> x, \[Infinity]]))}); {discretizeGraphics2@p, discretizeGraphics2b@p} 

enter image description here

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. But I've got a workaround. Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answer over on stackoverflow,

And I can't seem to improve the plot on the left with any combination of options to DiscretizeGraphics (AccuracyGoal, PerformanceGoal, PrecisionGoal, or MeshQualityGoal). It must be possible, as M.R.'s DiscretizeGraphics in his example image looks much better than mine. I'm using version 10.2, perhaps it has been improved in version 10.3?

Why does it do this? Not sure, hopefully one of the kernel developers that hang around here can chime in. It seems at first to be related to this problem with discretizing Bezier curves, but there you have the problem that BezierFunction is awful. Here we have a workaround, because BSplineFunction works just fine.

Just extract the points from the curve, create a Line object from them, and discretize that. Inspiration came from this answer over on stackoverflow,

And I can't seem to improve the plot on the left with any combination of options to DiscretizeGraphics (AccuracyGoal, PerformanceGoal, PrecisionGoal, or MeshQualityGoal). It must be possible, as M.R.'s DiscretizeGraphics in his example image looks much better than mine. I'm using version 10.2, perhaps it has been improved in version 10.3?

Edit2 Following J.M.'s suggestion, I've worked up a version that uses ParametricPlot to adaptively sample the BSplineFunction. It seems to be an order of magnitude slower (not that it is all that slow), and ends up plotting many more points, but it could lead to a more faithful reproduction of the original BSplineCurve objects,

discretizeGraphics2b[graphics_] := DiscretizeGraphics@(graphics /. {BSplineCurve[ a__] :> (Line@(Cases[ ParametricPlot[BSplineFunction[a][t], {t, 0, 1}], Line[{x__}] :> x, \[Infinity]]))}); {discretizeGraphics2@p, discretizeGraphics2b@p} 

enter image description here

added 875 characters in body
Source Link
Jason B.
  • 72.3k
  • 3
  • 152
  • 317
Loading
deleted 296 characters in body
Source Link
Jason B.
  • 72.3k
  • 3
  • 152
  • 317
Loading
added 788 characters in body
Source Link
Jason B.
  • 72.3k
  • 3
  • 152
  • 317
Loading
Source Link
Jason B.
  • 72.3k
  • 3
  • 152
  • 317
Loading