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

"Curve to NURBS" node #5158

Merged
merged 4 commits into from
Oct 26, 2024
Merged

"Curve to NURBS" node #5158

merged 4 commits into from
Oct 26, 2024

Conversation

portnov
Copy link
Collaborator

@portnov portnov commented Oct 20, 2024

This node allows to:

  • Convert arbitrary (non-NURBS) curve to NURBS curve
  • Reparametrize any curve: given one curve, make a NURBS curve with "natural" (uniform) parametrization, or with arbitrary parametrization

General nodes setup:

curve_to_nurbs_nodes

If we specify Parametrization = "Keep Original", then for NURBS curves node will basically return the same curve (slightly modified due to algorithms involved):

curve_to_nurbs_original

So if you already have a NURBS curve, it does not make sense to use original parametrization. It may, however, make sense for generic curves, see below.

In the following case we already have Bezier curve, but we want to have a NURBS curve with uniform parametrization:

curve_to_nurbs_bezier_degree_3

Note that while the curve is smooth, it's curvature comb is not smooth. If we want it to be smooth, we can use NURBS curves of higher degree:

curve_to_nurbs_bezier_degree_4

It is possible to create NURBS curves with arbitrary parametrization. Nodes setup:

curve_to_nurbs_arbitrary_nodes

"Formula interpolate" node defines the following reparametrization curve in this case:

curve_to_nurbs_arbitrary_parametrization

This gives the following result:

curve_to_nurbs_arbitrary_result

Let's check with arbitrary curve; in this case it's a straight line segment deformed by vector noise field:

curve_to_nurbs_noise_nodes

With Parametrization = "Keep Original" this gives:

curve_to_nurbs_noise_keep

With Parametrization = "Natural" this gives:

curve_to_nurbs_noise_natural

Preflight checklist

Put an x letter in each brackets when you're done this item:

  • Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • Manual testing done.
  • Unit-tests implemented.
  • Ready for merge.

@portnov portnov merged commit 2b817c6 into master Oct 26, 2024
1 of 2 checks passed
@portnov portnov deleted the curve_to_nurbs branch October 26, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant