Skip to content

Nurbs curve feature#10840

Open
hefniraera wants to merge 2 commits intoqgis:masterfrom
hefniraera:nurbscurve-digit
Open

Nurbs curve feature#10840
hefniraera wants to merge 2 commits intoqgis:masterfrom
hefniraera:nurbscurve-digit

Conversation

@hefniraera
Copy link
Copy Markdown
Collaborator

@hefniraera hefniraera commented Mar 16, 2026

fixes #10692 fixes #10711

Goal:

Ticket(s): #

  • Backport to LTR documentation is requested

click and the ending right click are necessary in this mode.
* The |digitizeShape| :sup:`Digitize Shape`: triggers tools on the
:ref:`Shape Digitizing Toolbar <shape_edit>` to draw a polygon of a regular shape.
* The |digitizeWithNURBS| :sup:`Digitize with NURBS Curve`: creates smooth curves using
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hefniraera !

Are you planning to include Bézier curves in this PR as well, or do you want to create a separate one for that?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im probably going to include it in this PR @lbartoletti

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, how can I help you?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if you're going to open a PR related to Bezier curve as you mentioned here. Could you also please clarify what the 'Weight' represents? Thank you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, I can write a short paragraph about Bézier right here.

As for the weight, it’s important to know that there’s a map tool shortcut associated with the W key + mouse wheel (Ctrl modifier: fine adjustment / Shift modifier: coarse adjustment ) that lets you move closer to or farther from a control point. This determines the weight. If a point has a higher weight, the curve will be pulled more toward that point than if it has a lower weight.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, I can write a short paragraph about Bézier right here.

Yes, please.

As for the weight, it’s important to know that there’s a map tool shortcut associated with the W key + mouse wheel (Ctrl modifier: fine adjustment / Shift modifier: coarse adjustment ) that lets you move closer to or farther from a control point. This determines the weight. If a point has a higher weight, the curve will be pulled more toward that point than if it has a lower weight.

That helps. Let me try on my side. Thanks

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbartoletti Speaking about weight, I'm not sure how broadly it applies across different tools. After testing it in QGIS, it applies to nurbs curve only, at least for now. I'm also quite unfamiliar with bezier curve. After digging into it a bit, I'm wondering what kind of bezier does QGIS implement? From what I've read, there are different kinds, including rational bezier which supports weight (not like bezier in QGIS). Given that, do you think the name "Digitize with Bézier Curve" is too generic?

cc @DelazJ

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing it in QGIS, it applies to nurbs curve only, at least for now.

Yes, it is.

Given that, do you think the name "Digitize with Bézier Curve" is too generic?

No, I think it's ok.

I can propose something like (AI has been used to help me):

- The |digitizeWithNURBS| :sup:Digitize with Bézier Curve: creates smooth curves
  by placing anchor points with control handles, similar to the pen tool in vector
  graphics editors. Each anchor has two handles that define how the curve enters and
  leaves that point.

And if we want to describe the actions:

    - Click and drag on empty space to add a new anchor point. The drag direction
  defines symmetric handles: the right handle follows the mouse while the left
  handle mirrors it on the opposite side.
    - Click and drag on an existing anchor to move it. Both handles move along with
  the anchor, preserving the curve shape.
    - :kbd:Alt + click and drag on an existing anchor to redefine its handles
  symmetrically, without moving the anchor itself.
    - Click and drag on a handle to move it independently, adjusting only one side
  of the curve at that anchor.
    - Right-click to finish the curve.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if we want to describe the actions:

IMHO this is a must-do. We should explain how technically people are expected to use these techniques/tools and the parameters they have to deal with. But I wouldn't put the details here because this simply introduces the various drawing techniques. Should probably have a dedicated sub-section in "adding features" and/or "vertex tool" features?

Copy link
Copy Markdown
Collaborator Author

@hefniraera hefniraera Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Click and drag on an existing anchor to move it. Both handles move along with the anchor, preserving the curve shape.

This action does not work on my end (windows). I can move each handle but not the anchor. Since you said it's AI generated, could you please confirm if this behavior is correct? @lbartoletti

Copy link
Copy Markdown
Collaborator

@DelazJ DelazJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hefniraera TBH I am not familiar with this kind of drawing tools and just made a quick test right now to comment (and won't have time to do more soon).

Some limitations that need to be mentioned: better store features in a nurbscurve layer (any other fully supporting layer type, Loïc?) if you don't want segmented lines and be able to properly edit with vertex tool.

Comment on lines 506 to 507
The selected technique remains while switching among the digitizing tools.
You can combine any of the first three methods while drawing the same geometry.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These statements seem to have gotten some changes. Can you check and adjust?
And for completeness, you would need to walk through the existing tools and check whether their description complies with these new techniques or not.

click and the ending right click are necessary in this mode.
* The |digitizeShape| :sup:`Digitize Shape`: triggers tools on the
:ref:`Shape Digitizing Toolbar <shape_edit>` to draw a polygon of a regular shape.
* The |digitizeWithNURBS| :sup:`Digitize with NURBS Curve`: creates smooth curves using
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if we want to describe the actions:

IMHO this is a must-do. We should explain how technically people are expected to use these techniques/tools and the parameters they have to deal with. But I wouldn't put the details here because this simply introduces the various drawing techniques. Should probably have a dedicated sub-section in "adding features" and/or "vertex tool" features?

@DelazJ
Copy link
Copy Markdown
Collaborator

DelazJ commented Mar 19, 2026

@lbartoletti some issues I think I found when testing and no time to properly report upstream:

  • using nurbscurve layer, unable to auto-snap on drawn vertex in order, e.g., to close a line

  • using nurbscurve layer, unable to draw a feature with only straight lines. Got:

    Ajouter une entité: Le type de géométrie numérisée (CompoundCurve) ne correspond pas au type de géométrie de la couche (NurbsCurve).

    Actually, seems that using anything other than nurbs tools on a nurbs layer draws nothing

  • unable to start a feature with straight lines then switch to nurbs methods. drawing restarts when tool is switched.

  • trying to add a part to a nurbs feature... well, I couldn't do anything, and at some point got a yellow cursor, and I couldn't release the tool or remove the rubberband

image

@lbartoletti
Copy link
Copy Markdown
Member

  • using nurbscurve layer, unable to auto-snap on drawn vertex in order, e.g., to close a line

mm, seems ok to me, activating "Enable self-snapping"

  • Actually, seems that using anything other than nurbs tools on a nurbs layer draws nothing

It's normal

  • unable to start a feature with straight lines then switch to nurbs methods. drawing restarts when tool is switched.

It's also normal

  • trying to add a part to a nurbs feature... well, I couldn't do anything, and at some point got a yellow cursor, and I couldn't release the tool or remove the rubberband

Yes, you couldn't add a part to a nurbs. I tried but haven't had the issues you encounter.

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.

Expose nurbs curve as potential geometry type for new memory layers (Request in QGIS) Feature/add nurbscurve gui control points (Request in QGIS)

3 participants