Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gordon NURBS Surface node #3603

Closed
portnov opened this issue Oct 1, 2020 · 5 comments
Closed

Gordon NURBS Surface node #3603

portnov opened this issue Oct 1, 2020 · 5 comments

Comments

@portnov
Copy link
Collaborator

portnov commented Oct 1, 2020

Also known as "surface from net of curves". We have a number of curves along U direction, another number of curves along V, they are intersecting at some number of points. Discussed in #3571.

Algorithm is looking very simple:

  1. Find intersection points of each of M U-Curves with each of N V-Curves, to have MxN intersection points. I expect this to be the trickiest part. In many cases the curves will just pass near one another at very small distance instead of intersecting. First idea how to do this is to use solvers from scipy, similar to how it is implemented in existing "intersect *" nodes.
  2. Build Nurbs surface L1 = loft between all U-curves. Use v-degree = number of V-curves - 1.
  3. Build Nurbs surface L2 = loft between all V-curves. Use u-degree = number of U-curves - 1.
  4. Build Nurbs surface I = interpolation between all intersection points. It will have degrees (M-1) x (N-1), the same as L1 and L2 by construction.
  5. Unify u- and v- knot vectors of L1, L2, I surfaces by adding new knots. Probably, have an option to do not add knots if existing knots have very similar values - use average value of knot in such cases.
  6. Calculate resulting surface control points = L1 + L2 - I.

and then fight bugs for some time :)

@rendetto
Copy link
Contributor

rendetto commented Oct 1, 2020

A small suggestion... It could be convenient if the user have the option to manually input the net intersection points, in case the numerical methods lack of precision on a particular setup. @portnov what's your opinion?

net_from_curves

Here is the file shown above in case you find it useful for testing:
net_from_curves.zip

Thanks

@portnov
Copy link
Collaborator Author

portnov commented Oct 2, 2020

Agreed.

@onerawartist
Copy link

Agreed 100%

@rendetto
Copy link
Contributor

rendetto commented Dec 1, 2020

I just finished some testing how the Gordon implementation in FreeCAD/CurvesWB will deal with the test file above.
The net is a bit too wavy, but shows an extreme case where the curves have arbitrary intersection/connection points.

FreeCAD_Gordon

It seems that this type of surface did a good job of interpolating all the curves from the net. So it's definitely worth having.

I'm sharing the file from the above screenshot in case you need a closer look:
net_from_curves(FreeCAD_Gordon)_simple.zip

@portnov
Copy link
Collaborator Author

portnov commented Jul 4, 2021

Consider this done in #4183.

@portnov portnov closed this as completed Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants