BezierCurve is different from BezierFunction











up vote
5
down vote

favorite
1












I am constructing Naca type profiles with Bezier curves.



controlPoints={{1, 0.}, {0.863924,0.00448168}, {0.78316,-0.019}, {0.444, -0.019}, 
{0.269064,-0.019}, {0,-0.014478}, {0, 0}, {0, 0.017794}, {0.236028, 0.041},
{0.442,0.041}, {0.616096,0.041}, {0.70006,0.0378152}, {1,0.}};

bezProfile = BezierFunction[controlPoints];

Show[Graphics[{Orange, BezierCurve[controlPoints], Red,
Point[controlPoints], Green, Line[controlPoints]},
Axes -> True], ParametricPlot[bezProfile[t], {t, 0, 1}]]


Result



The BezierFunction gives a very different results over the BezierCurve which is wrong !!



Any explanation ??










share|improve this question




















  • 3




    Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
    – Szabolcs
    Nov 29 at 8:40






  • 2




    use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
    – kglr
    Nov 29 at 8:42















up vote
5
down vote

favorite
1












I am constructing Naca type profiles with Bezier curves.



controlPoints={{1, 0.}, {0.863924,0.00448168}, {0.78316,-0.019}, {0.444, -0.019}, 
{0.269064,-0.019}, {0,-0.014478}, {0, 0}, {0, 0.017794}, {0.236028, 0.041},
{0.442,0.041}, {0.616096,0.041}, {0.70006,0.0378152}, {1,0.}};

bezProfile = BezierFunction[controlPoints];

Show[Graphics[{Orange, BezierCurve[controlPoints], Red,
Point[controlPoints], Green, Line[controlPoints]},
Axes -> True], ParametricPlot[bezProfile[t], {t, 0, 1}]]


Result



The BezierFunction gives a very different results over the BezierCurve which is wrong !!



Any explanation ??










share|improve this question




















  • 3




    Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
    – Szabolcs
    Nov 29 at 8:40






  • 2




    use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
    – kglr
    Nov 29 at 8:42













up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






1





I am constructing Naca type profiles with Bezier curves.



controlPoints={{1, 0.}, {0.863924,0.00448168}, {0.78316,-0.019}, {0.444, -0.019}, 
{0.269064,-0.019}, {0,-0.014478}, {0, 0}, {0, 0.017794}, {0.236028, 0.041},
{0.442,0.041}, {0.616096,0.041}, {0.70006,0.0378152}, {1,0.}};

bezProfile = BezierFunction[controlPoints];

Show[Graphics[{Orange, BezierCurve[controlPoints], Red,
Point[controlPoints], Green, Line[controlPoints]},
Axes -> True], ParametricPlot[bezProfile[t], {t, 0, 1}]]


Result



The BezierFunction gives a very different results over the BezierCurve which is wrong !!



Any explanation ??










share|improve this question















I am constructing Naca type profiles with Bezier curves.



controlPoints={{1, 0.}, {0.863924,0.00448168}, {0.78316,-0.019}, {0.444, -0.019}, 
{0.269064,-0.019}, {0,-0.014478}, {0, 0}, {0, 0.017794}, {0.236028, 0.041},
{0.442,0.041}, {0.616096,0.041}, {0.70006,0.0378152}, {1,0.}};

bezProfile = BezierFunction[controlPoints];

Show[Graphics[{Orange, BezierCurve[controlPoints], Red,
Point[controlPoints], Green, Line[controlPoints]},
Axes -> True], ParametricPlot[bezProfile[t], {t, 0, 1}]]


Result



The BezierFunction gives a very different results over the BezierCurve which is wrong !!



Any explanation ??







splines






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 at 8:55









kglr

175k9197402




175k9197402










asked Nov 29 at 8:36









Maarten Mostert

362




362








  • 3




    Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
    – Szabolcs
    Nov 29 at 8:40






  • 2




    use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
    – kglr
    Nov 29 at 8:42














  • 3




    Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
    – Szabolcs
    Nov 29 at 8:40






  • 2




    use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
    – kglr
    Nov 29 at 8:42








3




3




Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
– Szabolcs
Nov 29 at 8:40




Please do not use the bugs tag when posting questions. See the tag description. If you do suspect a bug, always mention your Mathematica version.
– Szabolcs
Nov 29 at 8:40




2




2




use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
– kglr
Nov 29 at 8:42




use BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)]?
– kglr
Nov 29 at 8:42










1 Answer
1






active

oldest

votes

















up vote
5
down vote













Use the option SplineDegree -> (Length@controlPoints - 1) with BezierCurve:



Show[Graphics[{Orange, Thick, 
BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)],
Red, Point[controlPoints], Green, Line[controlPoints]}, Axes -> True],
ParametricPlot[bezProfile[t], {t, 0, 1},
PlotStyle -> Directive[Thickness[.01], Opacity[.5]]],
AspectRatio -> 1/GoldenRatio]


enter image description here



BezierCurve >> Details and Options:




BezierCurve by default represents a composite cubic Bézier curve.




Graphics[{Orange, Thick, BezierCurve[controlPoints], 
Thickness[.01], Opacity[.3], Blue,
BezierCurve[controlPoints, SplineDegree -> 3]},
Axes -> True, AspectRatio -> 1/GoldenRatio]


enter image description here






share|improve this answer























  • Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
    – Maarten Mostert
    Nov 29 at 10:51












  • @MaartenMostert For composite bezier functions there is BSplineFunction
    – Coolwater
    Nov 29 at 11:02










  • @MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
    – kglr
    Nov 29 at 11:11











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186949%2fbeziercurve-is-different-from-bezierfunction%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote













Use the option SplineDegree -> (Length@controlPoints - 1) with BezierCurve:



Show[Graphics[{Orange, Thick, 
BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)],
Red, Point[controlPoints], Green, Line[controlPoints]}, Axes -> True],
ParametricPlot[bezProfile[t], {t, 0, 1},
PlotStyle -> Directive[Thickness[.01], Opacity[.5]]],
AspectRatio -> 1/GoldenRatio]


enter image description here



BezierCurve >> Details and Options:




BezierCurve by default represents a composite cubic Bézier curve.




Graphics[{Orange, Thick, BezierCurve[controlPoints], 
Thickness[.01], Opacity[.3], Blue,
BezierCurve[controlPoints, SplineDegree -> 3]},
Axes -> True, AspectRatio -> 1/GoldenRatio]


enter image description here






share|improve this answer























  • Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
    – Maarten Mostert
    Nov 29 at 10:51












  • @MaartenMostert For composite bezier functions there is BSplineFunction
    – Coolwater
    Nov 29 at 11:02










  • @MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
    – kglr
    Nov 29 at 11:11















up vote
5
down vote













Use the option SplineDegree -> (Length@controlPoints - 1) with BezierCurve:



Show[Graphics[{Orange, Thick, 
BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)],
Red, Point[controlPoints], Green, Line[controlPoints]}, Axes -> True],
ParametricPlot[bezProfile[t], {t, 0, 1},
PlotStyle -> Directive[Thickness[.01], Opacity[.5]]],
AspectRatio -> 1/GoldenRatio]


enter image description here



BezierCurve >> Details and Options:




BezierCurve by default represents a composite cubic Bézier curve.




Graphics[{Orange, Thick, BezierCurve[controlPoints], 
Thickness[.01], Opacity[.3], Blue,
BezierCurve[controlPoints, SplineDegree -> 3]},
Axes -> True, AspectRatio -> 1/GoldenRatio]


enter image description here






share|improve this answer























  • Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
    – Maarten Mostert
    Nov 29 at 10:51












  • @MaartenMostert For composite bezier functions there is BSplineFunction
    – Coolwater
    Nov 29 at 11:02










  • @MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
    – kglr
    Nov 29 at 11:11













up vote
5
down vote










up vote
5
down vote









Use the option SplineDegree -> (Length@controlPoints - 1) with BezierCurve:



Show[Graphics[{Orange, Thick, 
BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)],
Red, Point[controlPoints], Green, Line[controlPoints]}, Axes -> True],
ParametricPlot[bezProfile[t], {t, 0, 1},
PlotStyle -> Directive[Thickness[.01], Opacity[.5]]],
AspectRatio -> 1/GoldenRatio]


enter image description here



BezierCurve >> Details and Options:




BezierCurve by default represents a composite cubic Bézier curve.




Graphics[{Orange, Thick, BezierCurve[controlPoints], 
Thickness[.01], Opacity[.3], Blue,
BezierCurve[controlPoints, SplineDegree -> 3]},
Axes -> True, AspectRatio -> 1/GoldenRatio]


enter image description here






share|improve this answer














Use the option SplineDegree -> (Length@controlPoints - 1) with BezierCurve:



Show[Graphics[{Orange, Thick, 
BezierCurve[controlPoints, SplineDegree -> (Length@controlPoints - 1)],
Red, Point[controlPoints], Green, Line[controlPoints]}, Axes -> True],
ParametricPlot[bezProfile[t], {t, 0, 1},
PlotStyle -> Directive[Thickness[.01], Opacity[.5]]],
AspectRatio -> 1/GoldenRatio]


enter image description here



BezierCurve >> Details and Options:




BezierCurve by default represents a composite cubic Bézier curve.




Graphics[{Orange, Thick, BezierCurve[controlPoints], 
Thickness[.01], Opacity[.3], Blue,
BezierCurve[controlPoints, SplineDegree -> 3]},
Axes -> True, AspectRatio -> 1/GoldenRatio]


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 29 at 8:56

























answered Nov 29 at 8:50









kglr

175k9197402




175k9197402












  • Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
    – Maarten Mostert
    Nov 29 at 10:51












  • @MaartenMostert For composite bezier functions there is BSplineFunction
    – Coolwater
    Nov 29 at 11:02










  • @MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
    – kglr
    Nov 29 at 11:11


















  • Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
    – Maarten Mostert
    Nov 29 at 10:51












  • @MaartenMostert For composite bezier functions there is BSplineFunction
    – Coolwater
    Nov 29 at 11:02










  • @MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
    – kglr
    Nov 29 at 11:11
















Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
– Maarten Mostert
Nov 29 at 10:51






Thank you for swift reply. The BezierFunction does not have SplineDegree as an option only the BezierCurve has Why ? The correct curve is the last one you plotted with y=0 for x=0 and x=1. Should I split the curve in upper and lower one or are there other solutions.
– Maarten Mostert
Nov 29 at 10:51














@MaartenMostert For composite bezier functions there is BSplineFunction
– Coolwater
Nov 29 at 11:02




@MaartenMostert For composite bezier functions there is BSplineFunction
– Coolwater
Nov 29 at 11:02












@MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
– kglr
Nov 29 at 11:11




@MaartenMostert, can you use BSplineCurve and BSplineFunction instead of BezierCurve and BezierFunction?
– kglr
Nov 29 at 11:11


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186949%2fbeziercurve-is-different-from-bezierfunction%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Ellipse (mathématiques)

Quarter-circle Tiles

Mont Emei