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

"Move NURBS Curve Point" node #4623

Merged
merged 6 commits into from
Aug 27, 2022
Merged

"Move NURBS Curve Point" node #4623

merged 6 commits into from
Aug 27, 2022

Conversation

portnov
Copy link
Collaborator

@portnov portnov commented Aug 26, 2022

This node suggests several ways of adjusting a NURBS curve so that it would go
through another point at specified position, while keeping most of the curve
more or less in place.

Different methods of curve adjustment allow different degrees of freedom in
specifying what do you want to move and where to.

The following methods are available:

  • Move one control point. The node will move exactly one control point of
    the curve, to move curve point at T parameter by Vector. The index
    of control point being moved is specified in the Index input. Note that
    it is not always possible to move arbitrary curve point by arbitrary vector
    by moving specified control point. In intuitive terms, the point to be
    moved has to be near control point being moved.
  • Adjust one weight. The node will adjust one weight of the curve, to
    move curve point at T parameter directly towards corresponding control
    point, or in the opposite direction. The index of the weight being adjusted
    (and the index of corresponding control point) is specified in the
    Index input. Movement distance is specified in the Distance input.
    Note that it is not always possible to move arbitrary curve point by
    adjusting the specified curve weight. Also, if you try to move the point
    too far with this method, you will probably get unexpected curve shapes.
  • Adjust two weights. The node will adjust two weights of the curve, to
    move curve point at T parameter, together with neighbouring curve span,
    towards the corresponding control polygon leg, or in the opposite
    direction. The index of the first weight to be adjusted (and corresponding
    control point index) is specified in the Index input. Note that it is
    not always possible to move an arbitrary curve point by adjusting the
    specified weights. Also, if you try to move the point too far with this
    method, you will probably get unexpected curve shapes.
  • Move control points. The node will move several control points of the
    curve (approximately p of them, where p is the degree of the
    curve), to move curve point at T parameter by the specified vector. The
    node will automatically figure out which control points have to be moved.
    This algorithms gives most smooth results, but it requires more
    computations, so it is probably less performant.
  • Insert knot. The node will insert additional knot into curve's
    knotvector, and then move three control points, in order to move curve
    point at T parameter by specified vector. The node will automatically
    figure out which control points have to be moved.

Screenshot_20220826_220919
Screenshot_20220826_220732
Screenshot_20220826_220609
Screenshot_20220826_220503
Screenshot_20220826_220305

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 added the NURBS label Aug 26, 2022
@portnov portnov merged commit 39eb615 into master Aug 27, 2022
@portnov portnov deleted the nurbs_move_point branch August 27, 2022 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant