3
$\begingroup$

I am writing a script that involves creating bezier curves from poly curves. Is there any way to return the simplest bezier curve that can be made from a series of points?

Basically I want to convert this: Poly Curve

To this:Bezier Curve If someone could give me some pointers I'd really appreciate it. I haven't done much calculus since highschool.

Thanks!

$\endgroup$
3
  • 2
    $\begingroup$ this answer points to a good algorithm and a C language implementation. There's a reference to a numpy implementation in one of the comments. $\endgroup$ Commented Dec 12, 2021 at 17:21
  • $\begingroup$ Thank you will check this out! $\endgroup$ Commented Dec 13, 2021 at 12:20
  • 1
    $\begingroup$ That numpy script looks awesome! Exactly what I need and simple enough to apply and actually understand what it’s doing. Thanks again! $\endgroup$ Commented Dec 13, 2021 at 17:43

1 Answer 1

0
$\begingroup$

If you're trying to write a script only for this purpose, and not trying to incorporate this into a larger more complex script, note that you can already do this in Blender with the "Add Curve: Simplify Curves+" add-on.

Starting with a poly curve:

  1. Switch to edit mode
  2. Right click on the curve -> Set Spline Type -> Bezier
  3. Right click on the curve -> Curve Simplify (needs the Simplify Curves+ add-on)
  4. In the "Simplify Curves" dialog, increase the "Error" value to reduce the number of control points.
$\endgroup$
1
  • $\begingroup$ Thank you! Yeah it's just part of a script i'm writing to create custom bevel objects for roads, convert to mesh, grab certain loops and turn them back into bezier curves so i can manipulate the curves smoothly. Right now i'm debating whether I should just offset the road spline for striping, but I know offset can be touch and go for bezier curves. $\endgroup$ Commented Dec 12, 2021 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .