Nurbs editor

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
microelly2
Posts: 4627
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Postby microelly2 » Tue Aug 02, 2016 9:03 pm

triplus wrote: I guess in the future only individual control point properties could be made visible when selecting control point? As having huge BSpline would expose too many control point properties if all would be listed?
Nurbs have the nice property that an area only depends on some poles and knots in the near neighborhood, so after landing somewhere on the nurbs surface needs only knowledge of these points and data is required and vice versa a local change influences only a small part of the landscape. I hope to find with the use of the pie menu a good way always to open the suitable (and simple enough) dialog.
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Postby triplus » Tue Aug 02, 2016 9:22 pm

I could be way off but having control over control point as control point property would likely represent a value to me. And to be able for example select few control points and to remove/create "face".

This i guess would allow me to create 3D forms that currently can't be done from GUI? And i do imagine having some tools that apply algorithms on a selected set of control points could make sense in the future.
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Postby triplus » Tue Aug 02, 2016 9:44 pm

Hi @microelly2!

Reading this:

http://www.pilot3d.com/NurbSecrets.htm
Vertex Weight Values



Although weights have a local influence on the shape of the surface, manipulating their values can be difficult. A common approach is to try to obtain the desired surface shape by only adding and manipulating rows and columns of vertices. After you have roughed out the surface shape, you can then change the weight values to achieve specific local effects. Most objects, however, can be defined without changing the vertex weight values. Only experienced users should try manipulating these values.
I was under such impression myself before reading it. Therefore my suggestion would be to focus on this part for now:
A common approach is to try to obtain the desired surface shape by only adding and manipulating rows and columns of vertices.
And to produce such results (i guess the term is patches) with ease:

Image

I would like to have the possibility to control individual control point property and to change the number of rows and columns. That would be a good start from my point of view and based on the images you attached you likely are there already. You asked what to do and on what to focus first. My suggestion would be on this.

P.S. Once this is properly working and i guess in master you can start focusing on advanced capabilities like Vertex Weight Values and PieMenu special behaviour. ;)
User avatar
microelly2
Posts: 4627
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Postby microelly2 » Wed Aug 03, 2016 7:53 am

The basic methods already exist.
https://www.youtube.com/watch?v=AE0j9PErfHY
add a u-line or a v-line, change the weight or height of a pole or a simple selection of points
and the segmentation of surfaces into subsurfaces for further local refinement.
viewtopic.php?f=3&t=16473&start=30#p132914
Some code beautifying and making a nice workbench must be done,
I hope to merge my work with http://edwardvmills.github.io/NURBSlib_EVM/.
This will be the first version.
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Postby triplus » Wed Aug 03, 2016 11:26 am

I see. Therefore a whole lot of work left to be done before the first version. Well i personally would be happy with first version that only has (production ready) Patch feature in it. And advanced features like weight values could be omitted. To have the degree always set to 3 instead of exposing the setting to user would likely be sensible thing to do. As omitting weight values and setting degree to 3 could make your and user life easier if you ever plan to add the possibility to joint 2 patches in the future.
User avatar
microelly2
Posts: 4627
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Postby microelly2 » Fri Aug 05, 2016 11:19 am

@triplus

Followed your suggestions here a first version
https://www.youtube.com/watch?v=bkshrLUnTAs

Selection of the poles in the dialog:
Single Pole mode
Pole area mode (All Poles in a selectable uv-intervall)

Operations:
create a u-Line
create a v-Line
change the height of all selected poles the same value (change Height relative)
set the height of all selected poles to the same value (set absolute Height and Weight)

Restrictions:
degree 3
only one nurbs in the document
starting surface is a plane
generic data (number of poles in both directions, size of the grid) are only editable before first time the nurbs dialog is started)
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Postby triplus » Fri Aug 05, 2016 12:29 pm

Hi @microelly2.

Looks exactly like something i would occasionally use for some tasks. Before giving more feedback can i test it? Or it isn't ready yet for that?
User avatar
microelly2
Posts: 4627
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Postby microelly2 » Fri Aug 05, 2016 1:46 pm

Yes, please you can test it.
The video shows the functionality. i'm on a workshop this weekend and will be back on sunday evening (to fix some bugs).
Then I will shutdown my computer for 2 weeks.
triplus
Posts: 9278
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Postby triplus » Fri Aug 05, 2016 4:53 pm

I did some quick tests and as for the tools that are not yet implemented and missing icons for them. Better to not enable them until that is fixed. If i wouldn't look at the video i would probably struggle a bit to figure out on how to get into edit mode.

I was able to get some results after in rather straightforward fashion. It would be nice if there would be a grid of control points (or poles) and i could select and modify them directly by point and click and after i guess drag operation.

If i understand correctly setting height is limited to +/- 100 ATM? And what about the corner control points or poles. Will user be able to modify them in the future as it is possible with "central ones"?

Anyway i like what i see but i feel that before implementing other features it could make sense to focus only on single Patch feature and to build good interaction and selection functionality around it.
User avatar
microelly2
Posts: 4627
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Postby microelly2 » Sun Aug 07, 2016 5:55 pm

triplus wrote:I did some quick tests and as for the tools that are not yet implemented and missing icons for them. Better to not enable them until that is fixed. If i wouldn't look at the video i would probably struggle a bit to figure out on how to get into edit mode.
edit mode is
contextmenu -> Edit .. or
double click

I was able to get some results after in rather straightforward fashion. It would be nice if there would be a grid of control points (or poles) and i could select and modify them directly by point and click and after i guess drag operation.
Yes, will come: select the points or line by mouse and then contextmenu -> action

If i understand correctly setting height is limited to +/- 100 ATM? And what about the corner control points or poles. Will user be able to modify them in the future as it is possible with "central ones"?
Yes, there is a restriction to this inteval because I map the dialer to an interval
My idea is to use as next a nonlinear function like arctan to get a mapping from a finite intervall to all possible values

At the moment the outer poles are fixed to have well defined borders and solids without errors.
Free borders will come.

Anyway i like what i see but i feel that before implementing other features it could make sense to focus only on single Patch feature and to build good interaction and selection functionality around it.
Yes, I agree, change the height of a pole using the Draft snap tools.