Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

Points to Bezier Curves

Enes_HIZLIEnes_HIZLI Member Posts: 8
Hi everyone,

I just wonder that if there is a way to create a bezier curve through the coordinates not the control points? The only way I see is to create a sketch and set a coincident constraint for the bezier curve to the points.

In summary, I have 3D coordinates in .csv file. I need a tool that creates a bezier curve that satisfies all the coordinates I provide. It will arrange the control points itself to satisfy my coordinates.

However I found a feature script on the community support but it is not a bezier curve, it is just an approximate spline. So I need a tool to do it to have a Class-A surface.

Thanks for your help,

Enes

Best Answer

  • Options
    Matt_ShieldsMatt_Shields Member Posts: 217 PRO
    edited April 23 Answer ✓
    Hi Enes,

    I created a few custom features a while ago that may suit your needs.  The document below has three custom features.

    https://cad.onshape.com/documents/ce3ffb7bcb1ad02727fd8f8a/w/da9113a2ff4358ac51752b6a/e/cbd6bb0f0c9ab175358f21e0

    3D Bezier uses the Bezier equation to find the specified number of points given the user-defined control points. The parameter t can be specified as well. Use t = 0 to 1 for the full curve. A spline is then drawn through the points.

    Bezier Through Points uses the user-defined points to find new control points such that the curve passes through the user’s points. It then creates a spline thorough the user’s points.

    Bezier Least Square Fit was basically the whole point of this exercise. It not only uses linear algebra to find new control points based on the user-defined points, but it allows the user to specify the order of the final curve. This is useful if you want to fit to a lot of points. For example, if you want to fit to 20 points, the default curve would be a 19th order curve. Reducing the order can result in a satisfactory fit and better computational time. Finally, this feature creates a b-spline of best fit through the given points and with the given order.

    I haven't done a ton of testing, but hopefully it helps.

    Matt


Answers

  • Options
    Matt_ShieldsMatt_Shields Member Posts: 217 PRO
    edited April 23 Answer ✓
    Hi Enes,

    I created a few custom features a while ago that may suit your needs.  The document below has three custom features.

    https://cad.onshape.com/documents/ce3ffb7bcb1ad02727fd8f8a/w/da9113a2ff4358ac51752b6a/e/cbd6bb0f0c9ab175358f21e0

    3D Bezier uses the Bezier equation to find the specified number of points given the user-defined control points. The parameter t can be specified as well. Use t = 0 to 1 for the full curve. A spline is then drawn through the points.

    Bezier Through Points uses the user-defined points to find new control points such that the curve passes through the user’s points. It then creates a spline thorough the user’s points.

    Bezier Least Square Fit was basically the whole point of this exercise. It not only uses linear algebra to find new control points based on the user-defined points, but it allows the user to specify the order of the final curve. This is useful if you want to fit to a lot of points. For example, if you want to fit to 20 points, the default curve would be a 19th order curve. Reducing the order can result in a satisfactory fit and better computational time. Finally, this feature creates a b-spline of best fit through the given points and with the given order.

    I haven't done a ton of testing, but hopefully it helps.

    Matt


  • Options
    Matt_ShieldsMatt_Shields Member Posts: 217 PRO
    If you don't mind me asking, I'm curious what your application is.

    Thanks,
    Matt
  • Options
    Enes_HIZLIEnes_HIZLI Member Posts: 8
    I have airfoil profiles along the wing. To have a better surface, I want to describe the profiles with less points as much as possible once they satisfy my profile coordinates with the acceptable tolerance. That's one of the application I want to check.

    Thanks for the answer again.
    Enes
Sign In or Register to comment.