Finally got round to making a start on FreeCAD exporter for BSpline, sorry it has taken so long. #1518
Replies: 8 comments
-
I think the patch value is just the "poles". It's the coordinates of the control points. You also need the degree, which is missing. Maybe it's supposed to be [4,2]. You may have hit a degenerate case that's not handled by my code with a degree 2 nurbs with just 3 control points and knots just at the ends, because when I tried that it failed. I'll have to take a look later. But you might try an example with more than 2 knots if you get the "undefined operation" error.
So I had it as above, which gets the undefined operation error. |
Beta Was this translation helpful? Give feedback.
-
Now producing
Which creates
Gives error |
Beta Was this translation helpful? Give feedback.
-
You didn't pass the multiplicity of the knots in the mult arg. You also need to set type to "open". Note, however, that if you do that it looks like you hit the same bug I was getting before. It appears to have something to do with non-uniform knots, which are more complicated and handled by a different code branch. Nonuniform knots means the knots vector isn't evenly spaced. Your example is uniform, so at least for now you can just pass multiplicity, do NOT pass the knots at all, and then it gives this:
I would say that ideally you would check if the knots are uniform and only give them in the case of non-uniform knots. The non-uniform code may run slower, and future optimizations will target only the uniform knot case. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Well, you have |
Beta Was this translation helpful? Give feedback.
-
Thanks, still seem syntax error for poles definition, so there must be some error there. Print statements for Poles and Weights from FreeCAD surface
|
Beta Was this translation helpful? Give feedback.
-
Tried working on BSpline_Curves Generate
But get error ignoring function debug_nurbs Have I got the right version of the library installed? Been referring to doc at https://github.com/BelfrySCAD/BOSL2/wiki/nurbs.scad |
Beta Was this translation helpful? Give feedback.
-
debug_nurbs() is not a function, but a module, so it can't have a return value. Remove the "curve=" and it will work once you fix the other problems:
You will need type="open" not type="clamped" I think. Do you know anything about nurbs or are you flying blind, as it were? The clamped, open and closed options control how the ends of the curve are treated and they work by taking a user input and manipulating the knots and possibly patch points (poles). You can do everything with type "open", which passes the input unaltered, if you do that manipulation manually. The purpose of the types is to make life easier for the user. You labeled the above as "clamped" and indeed I can see from mults that it is a clamped curve because it's already been formulated that way by freecad. So you'll need type "open" for that example. Given that, you may find the same true for closed curves. Your broken poles definition is that you're missing a comma in the vector triples. |
Beta Was this translation helpful? Give feedback.
-
Under Part SPline is a list of the function calls etc
Relevant code at present is
File output is currently
Not sure I am currently understanding what I should be generating as patch values and vnf statement given the above.
Beta Was this translation helpful? Give feedback.
All reactions