Rhino.TrimBrep set cutter's direction in RhinoScript


How can I have control over what is kept and what is removed when using the Rhino.TrimBrep? (i.e. I would like to always keep the lower part of a vertical cylinder trimmed by a horizontal random surface)

Thank you!


From the RhinoScript help file:

The parts of the target surface or polysurface that lie to inside (opposite the normal) of the cutter are retained, while the parts to the outside (in the direction of the normal ) are discarded. If the cutter is a closed surface or polysurface, or is s plane, then a connected component of the target surface or polysurface that does not intersect the cutter is kept if and only if it is contained in the inside of cutter. That is the region bounded by the cutter opposite from the normal of the cutter, or in the case of a plane cutter the half-space opposite from the plan normal. If the cutter is not closed all these components are kept.

Does this help?

1 Like

Hi Dale,

Thanks for the reply!

I was asking because it seems that the TrimBrep result is not consistent with the cutter’s normal. Please see this screenshot where Flip in _Dir command was used and the example script from TrimBrep help.

Looks like regardless of the normal, the lower part is always retained (in accordance with the native normal)

Thank you!

I have the same problem with trimming in Rhino script. Is there a solution or do I have to use split instead?

I believe this has been fixed in the Rhino WIP.

This was working before …

I tried with Rhino Common and it just gives the same result.

The solution is to mirror the plane instead and it will work.