according to the docs, Brep.Trim(Brep, Double) should remove parts that are in normal direction of the cutter. However, if used with a flipped Brep as cutter, the opposite part is removed.
Example: TrimBrep.py (1008 Bytes)
IMHO this is either a bug or should be clearly stated in the docs.
Workaround: An additional BrepFaceList.Flip(True) gets rid of the flipped state and leads to the intended results.
I’m not very familiar with python, yet:
Reading the file, could it be that the second time you are trimming with the initial brep2 and not with the filled version?
When calling doc.Objects.Add(brep2) don’t you need to collect the newly added geometry ID?
thanks for your suggestions, but in this case I am directly working with RhinoCommon objects and only add the results (and the flipped brep2) to the document to be able to see what I’m working with. That’s why I don’t collect the new GUID.
And Brep.Flip() works in place, that’s why I am using the same instance again for the second test.
It appears that the function is looking at the surface normal instead of the direction of the face, which can be different. I’ve got this in the to-do list for a future service release.
Hi there,
I know it’s been more than three years of this post but I’ve found the same problem in the latest installation of RhinoCommon although in my case I’m creating the plugin running under a VB project.
The link you’ve sent is from 2014, and I’ve installed RhinoCommon two and half months ago, so… I don’t think I’m running an old version.
In any case, How do I check it?
strObject = Rhino.GetObject("Select surface or polysurface to trim")
If Not IsNull(strObject) Then
strCutter = Rhino.GetObject("Select cutting surface or polysurface")
If Not IsNull(strCutter) Then
Rhino.TrimBrep strObject, strCutter
End If
End If
It’s always trim in I don’t like. The same picture 2. But i want to cutting in " Want to trim" the same picture 1.
I don’t know about it. Please help me.
Trimming relies on the natural surface normal of the surfaces involved. With open surfaces, unless you know exactly which way that points for each object, your trim will always be unpredictable. I suggest you use Split instead and then find a way to test which parts of the surface you want to keep and which you want to discard…