How to feed trimmed surface to python operator without untrimming

Hi, all. This is actually an old question on the forum, but I came into it recently. Please let me know if anyone have answer for it.

So the problem is when I try to feed a trimmed surface into grasshopper python operator, it automatedly read the surface as the original untrimmed geometry. Initially, I thought this happened because I was using ghpython library, so I tried same thing with rhino common library. But the result is still the same. Here are my comparison studies using " flip " command as an example:

1. Untrimmed surface split with grasshopper operator. Trimmed surface flipped with ghpython libray in python operator. Untrimmed surface out.

#2. Untrimmed surface split with rhino common library in python operator. Trimmed surface flipped with ghpython library in another python operator. Untrimmed surface out.

#3. Untrimmed surface split with rhino common library in python operator. Trimmed surface flipped with rhino common library in another python operator. Untrimmed surface out.

#4. Surface split and flipped in the same python operator. Trimmed surface out.

#5. Simiar to 1, but the type hint of trimmed surface is assigned as " Brep " when feeding into python operator. Trimmed surface out.

In conclusion, I think the conversion from trimmed surface to untrimmed surface happens when the geometry data was fed into the python operator. Feeding the data as “Brep” is a temporary solution, but I wonder if there is anyway to avoid that for " surface " type since it’s not always ideal to change the type hint to “Brep”. I’m also attaching my test here:

Related post from 2017:

I don’t think there is a way to avoid it. It has to do with how the class types are set up.

Perhaps it isn’t so bad for McNeel to eliminate the term “trimmed surface”. Just call it Brep

1 Like

@Will_Wang is correct here. The only way to trim a surface is to make it a Brep and attach trimming curves to it. Surfaces in Rhino do not have trims or edges, other than the boundaries defined by the isocurves at the min and max of the u and v parameters.

What grasshopper calls a “Trimmed surface” is a Brep made of exactly one surface and one or more trims. Note that this is very close to the definition of a Brep face. It does that because some components can handle surfaces, trimmed surfaces and brep faces, but not multi-face Breps or polysurfaces.

2 Likes

I see. Thank you so much. That’s good to know. So basically after trimming one surface, I have to always keep it classified as " Brep " to avoid reverting it back to original untrimmed ones.

Thank you for such detailed explanation. So the option would be: 1. keep it as Brep after trimming or 2. always bind the boundary curves and surface together and do a trim when needed.