How can Surface.Trim() keep original UV domains?

I’m using this method of surfaces
https://apidocs.co/apps/rhinocommon/6/M_Rhino_Geometry_Surface_Trim.htm
I wonder if there is a way that all resultant “sub” surfaces can retain original surfaces’s UV domains, much like trimming with a curve “by hand” in the rhino model.
Now the trimmed is “shrunk”

You need to do the following:

  • extract the u- and/or v-isocurves that you want to use for trimming (or any other surface curve, does not need to be iso-curves)
  • convert the surface to a Brep
  • use BrepFace.Split(curves) to split the one face of the Brep
  • choose which part to keep of the resulting Brep.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Surface_IsoCurve.htm

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BrepFace_Split.htm

Clear. Thanks!
On this topic, do you happen to know if I can “region union” Brep trims? Kinda like applying another Brep’s trim on a Brep that is already a trimmed surface, and getting only the patch in the overlapped area between the two trims.

Not directly. I guess you could get the 2D trim curves of both BReps, use a curve boolean operation on them, then do BrepFace.PushUp(curves) to get the 3D trim curves and go from there, but I’m not sure how practical and robust that would be.

Keep in mind that split is going to take a lot longer than trim (split is a physical intersection operation). I’d probably still go the trim route and change the result surfaces domains to what they would be in a split. You can change the domains by using the UV data you use to trim with Surface.SetDomain();

That is of course only if your intent is to trim with the iso’s of the surface.