Trim Mesh same way as a brep?

Hi all,

I’m trying to trim a Mesh but can’t figure out how.
With a brep i would do:

Dim Splitted As Geometry.Brep() = BrepToTrim.Trim(Trim.Brep, doc.ModelAbsoluteTolerance)

How to do this with a mesh?

-Jordy

You can maybe use Mesh.Split(…) to split a mesh with one or more meshes. Then use a BoundingBox or size test to decide which part to keep.

http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Mesh_Split_2.htm
http://4.rhino3d.com/5/rhinocommon/html/M_Rhino_Geometry_Mesh_Split.htm

Was thinking of the same. But it could be easier if there would be a function like the brep one :stuck_out_tongue:

How does the size test work? Never heard of it ^^

Size test: number of vertices, faces. If you know you are removing the larger part and trimming the smaller part, just counting vertices or faces can be the fastest decision to know what to keep.

Ah like that. Also a good idea but I dont know if which one is bigger :stuck_out_tongue: but thanks for the tip :slight_smile: