TrimSurface

Removes the portions of the surface outside of the specified interval.

Syntax

rhinoscriptsyntax.TrimSurface (surface_id, direction, interval, delete_input=False)

rhinoscript.surface.TrimSurface (surface_id, direction, interval, delete_input=False)

Parameters

surface_id

Required.  String or Guid.  The identifier of the surface object to trim.

direction

Required.  Number.  If 0 (U), then interval specifies an sub-interval of SurfaceDomain(surface_id, 0). If 1 (V), then interval specifies an sub-interval of SurfaceDomain(surface_id, 1).

interval

Required.  Tuple of 2 numbers.  The interval of the surface to keep. If direction = 0, then the portions of the surface with parameters (s, t) satisfying s < SurfaceDomain(surface_id, 0)(0) or s > SurfaceDomain(surface_id, 0)(1) are trimmed away. If direction = 1, then the portions of the surface with parameters (s, t) satisfying t <SurfaceDomain(surface_id, 1)(0) or t >SurfaceDomain(surface_id, 1)(1) are trimmed away.

delete_input

Optional.  Boolean.  Delete input surface.  If omitted, the input surface will not be deleted (False).

Returns

Guid

The identifier of the new surface if successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

surface = rs.GetObject("Select surface to split", rs.filter.surface)

if surface:

    domain_u = rs.SurfaceDomain(surface, 0)

    domain_u[0] = (domain_u[1] - domain_u[0]) * 0.25

    rs.TrimSurface( surface, 0, domain_u, True )

Also See

SplitSurface