Splitting a face using 3d trimming curves unreliable

I am trying to split a face using a number of 3d trimming curves. However, the Split function in RhinoCommon as well as the split command in Rhino seems to be really unreliable in determining if the curve interesects the surface or not.

I have tried generating the curves by interpolating them on the surface as well as pulling them to the surface. I also tried extending the curves along the surface to see if that helps, but i can not find a reliable solution to splitting the face into any number of pieces. It also seems to be dependent on the order of splitting. I tried splitting with only some of the curves, and then splitting with the rest, and that provided different results although still nothing reliable.

Does anyone know of some method to ensure that the face can be split by the trimming curves?

Can you post some sample geometry, along with some sample source code that you cannot make work?

Thanks!

The source code would be a bit too large to show you here, but i can demonstrate it without. See the following file:

splitfailexample.3dm(131.1 KB)

Simply use the Split command on the surface with all the curves as splitting curves. The splitting fails in two places.

Just curious, where did the surface come from. Did you import it or did you create it in Rhino. If you created it, how so?

The surface in the file was created in Rhino by manipulating a simple grid of control points. I have experienced the issue with a wide variety of surfaces, both ones that are created in Rhino and ones that are imported.

This Brep has sloppy trims or edges. If it were made in Rhino, I’d like instruction on how to create this so we can fix the sloppiness.

I was able to split this by first duplicating the edge curves (DupEdge) and then untrimming the surface (Untrim). I then split the surface from the duplicate edges and then split the sub-surface by your grid of curves. You might be able to skip all these steps using the RebuildEdges command.

Interesting. I did succeed in splitting it after rebuilding the edges of the surface. I will have to check if this was the problem with all the surfaces i have experienced this issue with.

I can assure that the surface was created in Rhino. I didn’t create it myself but I just talked to the person who did, and he is prette sure that he split it from a viewport such as the front view, with a planar polyline curve behind the surface. I hope this can help you in identifying the issue.

I am curious, how did you tell that the edges were sloppy?

Debugging with debug Rhino.exe should give your more information in Visual Studio’s output window.

Where can i find a debug executable? I am using RhinoCommon.

Download the Rhino 5 C++ SDK.

http://www.rhino3d.com/download/rhino-sdk/5.0/commercial