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
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Post by microelly2 »

this was one of the last mysteries:
segment a nurbs into pieces by selecting an area in the knot grid , modify a detail and recombine all back.
this way local modifications on large nurbs surfaces can be reduced to the the small area where the change happens.
Attachments
bp_081.png
bp_081.png (77.27 KiB) Viewed 4341 times
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Nurbs editor

Post by yorik »

Each new module of you is more impressive than the previous one, microelly2! This could be awesome to recreate terrains...
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Nurbs editor & OpenNurbs

Post by keithsloan52 »

Couple of years ago I started work on using OpenNurbs https://www.rhino3d.com/opennurbs to be able to read Rhino files into FreeCAD. I was able to parse the Rhino files but got stuck adding code to create FreeCAD objects.

A copy of my efforts are available at https://www.dropbox.com/sh/9xtd5pmfkxze ... eqyGa?dl=0

Happy for people to use as long as I get some acknowledgement.

The source is in sub directory Lib which has a Makefile

testRead : Reads a test Rhino file and parses ( Note: test file location is hard coded )
importNurbs.so is a shared module library that should exist in /usr/lib/freecad/libs
i.e. Needs a softlink ( ln -s ) to /usr/lib/freecad/libs/importNurbs.so

Unfortunately I did not backup the FreeCAD module directory /usr/lib/freecad/Mod/Nurbs, but it should be fairly easy to recreate if you look at /usr/lib/freecad/Mod/Import

Note: the version of OpenNurbs will be several years out of date.
I added in places code to print out the relevant data that is needed to add info to FreeCAD

Quite happy to work with microelly2 if he/she could provide details on creating FreeCAD objects and control points

Thanks
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Post by microelly2 »

@keithsloan52

thank you, I will look at your sources at the end of my holidays.
the occ/freecad support for nurbs is very good, so now I'm on the way to bring all ideas together.
I hope to merge my work with the wonderful ideas of edwardvmills and maybe with a rhino interface from you too. 8-)
https://github.com/edwardvmills/NURBSlib_EVM
I start a separate workbench for nurbs and will shift the examples and methods step by step from the reconstruction wb to this place.
https://github.com/microelly2/freecad-nurbs

@yorik
thank you for the compliment.
Indeed the idea to create terrains was a main force to study nurbs.
with the segmentation we will be able to fill the SRTM data with local data details
viewtopic.php?f=8&t=6973&hilit=geodat&start=100#p129973
and I hope to get something like a zoom in functionality with different LOD models in the same CAD file.
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Import OpenNurbs

Post by keithsloan52 »

keithsloan52 wrote:Couple of years ago I started work on using OpenNurbs https://www.rhino3d.com/opennurbs to be able to read Rhino files into FreeCAD. I was able to parse the Rhino files but got stuck adding code to create FreeCAD objects.

A copy of my efforts are available at https://www.dropbox.com/sh/9xtd5pmfkxze ... eqyGa?dl=0

Happy for people to use as long as I get some acknowledgement.

The source is in sub directory Lib which has a Makefile

testRead : Reads a test Rhino file and parses ( Note: test file location is hard coded )
importNurbs.so is a shared module library that should exist in /usr/lib/freecad/libs
i.e. Needs a softlink ( ln -s ) to /usr/lib/freecad/libs/importNurbs.so

Unfortunately I did not backup the FreeCAD module directory /usr/lib/freecad/Mod/Nurbs, but it should be fairly easy to recreate if you look at /usr/lib/freecad/Mod/Import

Note: the version of OpenNurbs will be several years out of date.
I added in places code to print out the relevant data that is needed to add info to FreeCAD

Quite happy to work with microelly2 if he/she could provide details on creating FreeCAD objects and control points

Thanks
Okay I recreated the Mod directory. If you download from Dropbox and then run the commands in the file softLinks having changed the source according to where you downloaded the dropbox directory you should be able to do the following in FreeCAD

Get the option to load Rhino files i.e. *.3dm.

FreeCAD will not currently display anything but the output from parsing the file with opennurbs will be in the file /tmp/opennurbs.out

If somebody can tell me the calls I need to make to create the FreeCAD objects for the sample 3dm files I can then make some more progress.

I do not have access to Rhino but did invest in a Rhino ios app so that I could view what the 3dm looked like, but the sample files supplied with opennurbs need to be first loaded into Rhino and resaved with some option :-( ( I might be able to dig out the email from there support as to details).

Do we have any users with access to Rhino that would be willing to help?
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Import OpenNurbs

Post by microelly2 »

keithsloan52 wrote: Do we have any users with access to Rhino that would be willing to help?
My colleague has a CNC machine and uses Rhino, so we can start supported work in september. :)
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Nurbs editor

Post by saso »

User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Nurbs editor

Post by Chris_G »

Hi,
Interesting.
Would Rhynamo author, Nathan Miller, be NateM on this forum, who gave a try at a surface WB ?
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Nurbs editor

Post by microelly2 »

I still learn what all the parameters of a BSpline can influence.
Moving the poles is intuitive,
now here a video what the pole weights and the knot vector do when the poles remain fixed.
https://youtu.be/H-_XNOpCQb4
bp_088.png
bp_088.png (16.09 KiB) Viewed 4177 times
the script is here: http://freecadbuch.de/doku.php?id=blog: ... i_bsplines
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Nurbs editor

Post by triplus »

Yes now the interface is much more align to the rest of FreeCAD. 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?

Anyway i like the approach of having such detailed control over control point.
Post Reply