1

I am new to C++ NURBS libary. I learnt generating line (by CLine, from nurbs.h ) and save it as igs. But in case of multiple control points, how to generate a curve ? Every other tutorial using graphics.h (putpixel), but couldnt find anything about igs. This should be a simple problem. But I have no idea which function can help me here. Thanks in advance.

We have 4 control points here to begin with.

for (float t = 0.0; t <= 1.0; t += 0.2) {
     double xt = 0.0, yt = 0.0;
     xt = pow(1 - t, 3) * x[0] + 3 * t * pow(1 - t, 2) * x[1] + 3 * pow(t, 2) * (1 - t) * x[2]
     + pow(t, 3) * x[3];
     yt = pow(1 - t, 3) * y[0] + 3 * t * pow(1 - t, 2) * y[1] + 3 * pow(t, 2) * (1 - t) * y[2]
     + pow(t, 3) * y[3];
     count = count + 1;
     //Math::Vector4f c(xt, yt, 0);
     for (int i = 1; i < 3; i++) {
                     listt[i][0]= xt;
                     listt[i][1]= yt;
                     Math::Vector4f a(listt[i][0], listt[i][1],0);
                     myvector.push_back (&a);
                 }
 }

......

.....
igs.Write("test.igs");



--- This is to create the points, but after that I dont know how to use the points to create a Bezier curve .

san
  • 23
  • 1
  • 5
  • 1
    This is not a C++ question, it is a question about how to use a (3rd party) library. Maybe you get better answers if you ask on the NURBS forum? – Pepijn Kramer Feb 06 '23 at 13:53
  • @PepijnKramer I used tags . The forum link is outside stack overflow? share the link please? – san Feb 06 '23 at 15:56
  • Can you explain what you think the various parts of the code you're showing even do? (in the post, of course). Because while the first few lines make sense, the next few kinda don't. – Mike 'Pomax' Kamermans Feb 06 '23 at 18:33
  • @Mike'Pomax'Kamermans Yeah those line can be ignored for now. I would like to know about Nurbs.h and how to create a curve using the points generated. I just saves the points in a vector – san Feb 07 '23 at 04:33
  • That kind of sounds like a job for "then just look up the documentation and some examples for nurbs.h"? Did that not work? (Remember, SO is your _last_ resort, you're fully expected to first (re)search on your own. But, if you already did that and the docs and examples out there are not clear enough, then that's something that you can [put in your post](/help/how-to-ask) so that people know how far into solving the problem you are) – Mike 'Pomax' Kamermans Feb 07 '23 at 16:11

0 Answers0