Creating a closed B-Rep surface

Hi,

I have a problem with creating closed B-Rep (trimmed) Nurbs surfaces.
I wrote a plugin for Rhino with C++, which can be used to visualize trimmed (non-periodic) Nurbs surfaces, specified in a text file

, this works fine. The visualization of untrimmed closed Nurbs surfaces works as well.

Just the visualization of trimmed closed Nurbs surfaces does not work

(closing of the surface in the figure was done manually in Rhino).

What is the difference in creating a non-periodic and periodic timmed surface? Thanks for your help.

Best regards,
Michael

Hi Michael,

We’re going to need to see some geometry and probably some sample source code if we are going to be helpful.

Feel free to email me directly if you like.

Hi Dale,

thanks for your email. I prepared a c++ project (see attached file) with a simple example, which causes the problem. By modifying the flag “flag_case_which_works” at the beginning of the command “BrepSurface” you can choose the working and not working case. The difference are just two lines of code. I hope the source code is clear enough. Thanks for your help.

Best regards,
Michael

BrepSurface.zip (19.4 KB)

Hi Michael,

If you look at the text log filled in by ON_Brep::IsValid, you will see this:

brep.m_E[0] edge is not valid.
  edge.m_vi[]=(0,1) but edge.IsClosed() is true
ON_Brep.m_E[0] is invalid.

Does this help?

Yes it helped, thanks. Now I’m also able to see the text log messages smile, which helps a lot. Does there exist a guideline how to create B-Rep surfaces, as shown in the code, considering all special cases (closed, etc)? Thanks for your help

No, not really. But there are alot of very informative comments on opennurbs_brep.h that can help. And you might have already seen these examples:

https://github.com/mcneel/Rhino5Samples_CPP/tree/master/SampleBrepCommands

Also, if you download the openNURBS source, you can see how some of our static functions create Breps.

perfect, I have not seen all of them, so it could be helpful. Thanks a lot