Group Abstract Group Abstract

Message Boards Message Boards

1
|
5.1K Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Make a part of an ellipse as a BSplineCurve?

Posted 7 years ago
POSTED BY: Juerg Baertsch
Posted 7 years ago

I have found a solution for me that works fine. I calculate the point first for a cricle, interpolate them wit the function of the first post, then I transform them to the ellipse and mak the BSplineCurve:

ellipse[o_, a_, b_, \[Alpha]1_, \[Alpha]2 := Module[
   {m, o1, a1, b1, pts},
   m = TransformationMatrix[
     FindGeometricTransform[{{0, 0}, {1, 0}, {0, 1}}, {o, o + a, 
        o + b}][[2]]];
   pts = interpolate[
     Table[Cos[t]*{1, 0} + 
       Sin[t]*{0, 
         1}, {t, \[Alpha]1, \[Alpha]2, (\[Alpha]2 - \[Alpha]1)/n}]];
   pts = Append[Transpose[pts], Table[1, Length[pts]]];
   pts = Transpose[Inverse[m].pts][[All, 1 ;; -2]];
   BSplineCurve[pts]
   ];

The result looks perfect with only few points:

enter image description here

But this works only for ellipses. For now I'm happy with this workaround. But If somebody has a solution to convert any parametric functions in Splines, I'm still very interested in this.

POSTED BY: Juerg Baertsch
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard