Import Nurbs - Brep or Union/Fuse.

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
keithsloan52
Posts: 959
Joined: Mon Feb 27, 2012 5:31 pm

Import Nurbs - Brep or Union/Fuse.

Postby keithsloan52 » Sun Oct 30, 2016 10:41 am

Okay I am looking at developing a Nurbs importer for 3dm Rhino files. If one looks at general objects they are made up of nurb surfaces with ruled lines see [img]
Screen Shot 2016-10-30 at 10.19.47.png
Screen Shot 2016-10-30 at 10.19.47.png (762.76 KiB) Viewed 2137 times
[/img]. When I parse the file the parser reports them as brep with a number of surfaces and lines. Now given that some others are developing a nurbs editor I am wondering how I should deal with them. Currently I am thinking of having a run time configuration switch that offers the following
  • Just convert each object as a brep ( Surfaces & Lines )
    Import the following with a fuse/union
    • Just import the surfaces as separate objects
      import each surface as an object and its lines as a separate brep object - one per surface
What do people think?, especially those developing Nurbs editors
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Import Nurbs - Brep or Union/Fuse.

Postby shoogen » Sun Oct 30, 2016 11:04 am

I don't fully understand what you mean by surfaces and lines.
IMHO the default should be to obtain solids whenever possible (in the topological sense). If someone just doesn't really care about the nurbs he, will probably work with solids anyway.
Is there anything special about these lines that would not be preserved in the OpenCASCASDE BREP? Or could they be obtained at any time (like for u=0.5 or v=const at the second knot) (isoU,isoV or something like this was the name of the python functions)
EDIT: The correct term is "isoparametric curve"
keithsloan52
Posts: 959
Joined: Mon Feb 27, 2012 5:31 pm

Re: Import Nurbs - Brep or Union/Fuse.

Postby keithsloan52 » Sun Oct 30, 2016 12:05 pm

Well I find it disappointing when you import a step or iges document that it comes in as one FreeCAD object and you cannot edit it much. Maybe there is a way I am not aware of. if I just convert a opennurbs brep to an opencascade brep then it would be able to be viewed but I suspect limited in ability to edit. If people are working on Nurbs editors then I would prefer to import to a form that can be edited. Like I said the parser parses the OpenNurbs objects to a number of NurbSurfaces and Lines as per the png image. i.e. The surfaces have a number of lines drawn on them, but you cannot create the lines straight from the surfaces
User avatar
Chris_G
Posts: 1082
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Import Nurbs - Brep or Union/Fuse.

Postby Chris_G » Tue Nov 01, 2016 11:30 am

Hi,
I am not sure to understand since I don't know much about B-Rep format structure, but I would say that your importer should stay as close as possible to the original file structure.
From what I understand, Brep format only contains a list of faces ( = trimmed nurbs surfaces ).
Does it also contain objects like shells or solids ?
Is your question more about the additional curves that lay across the faces ?
I don't know what is the real nature of these curves. It looks like they are only isocurves for visualisation purpose.
Anyway, I don't think we can go very far with nurbs surface editing until FC gets OCC's Geom2d implemented.
Right now, only untrimmed nurbs surfaces can be edited. We don't have full access to the boundary edges ( 2d curves in the UV space of the surface ).