UPDATE for 3D CASE
Options[CAGDBezierCurve] = {SplineClosed -> False,
SplineDegree -> Automatic, ControlPoints -> False, Method -> Automatic};
CAGDBezierCurve[pts : {{_, _} ..} | {{_, _, _} ..}, opts : OptionsPattern[]] :=
Module[{sc, sd, cp, Bezier, ptGroupptgroup},
sc = OptionValue[SplineClosed];
sd = OptionValue[SplineDegree] /. Automatic -> 3;
cp = OptionValue[ControlPoints];
Bezier =
ToExpression@OptionValue[Method] /. Automatic -> BezierDefinition;
ptGroupptgroup =
Partition[pts, sd If[sc+ 1, sd, 1, {}];
If[Length@First@pts == Partition[Append[pts2,
First@pts] ParametricPlot[
Evaluate[Bezier[#, sdu] +& 1/@ ptgroup], sd{u, 0, 1},
Evaluate@
(Sequence @@
FilterRules[{opts}], Options[ParametricPlot]]),
Partition[pts Axes -> False, sdPlotRange +-> 1All,
sd Epilog -> If[cp, 1{Green, Line[pts], Red, Point[pts]}, {}]];
]],
ParametricPlot[ Show[
Evaluate[ {ParametricPlot3D[
Bezier[# Evaluate[Bezier[#, u] & /@ ptGroup]ptgroup], {u, 0, 1},
Evaluate@
Evaluate@
(Sequence @@
(Sequence FilterRules[@@FilterRules[{opts}, Options[ParametricPlot]]Options[ParametricPlot3D]]),
Axes -> False, PlotRange -> AllAll],
Graphics3D[
Epilog -> Evaluate@If[cpIf[cp, {Green, Line[pts], Red, Point[pts]}, {]]}]
]
]
pts1 = {{0, 0, 0}, {1, 1, 1}, {2, -1, 1}, {3, 0, 2}, {5, 3, 4}};
CAGDBezierCurve[pts1, SplineDegree -> 4, ControlPoints -> True]