Trims a surface or polysurface using an oriented cutter. The cutter can be a surface, a polysurface, or a plane.
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.
rhinoscriptsyntax.TrimBrep (object_id, cutter, tolerance=None)
rhinoscript.surface (object_id, cutter, tolerance=None)
object_id |
Required. String or Guid. The identifier of the surface or polysurface object to trim. |
cutter |
Required. String or Guid. The identifier of the cutting surface or polysurface object. |
tolerance |
Optional. Number. The trimming tolerance. If omitted, the document's absolute tolerance is used. |
list |
The identifiers of the retained components if successful. The identifier of the first element in the array will match the identifier of the target surface or polysurface. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
filter = rs.filter.surface + rs.filter.polysurface
obj = rs.GetObject("Select surface or polysurface to trim", filter)
if obj:
cutter = rs.GetObject("Select cutting surface or polysurface", filter)
if cutter:
rs.TrimBrep(obj,cutter)