Offset a curve on a surface. The source curve must lie on the surface. The offset curve or curves will be added to Rhino.
rhinoscriptsyntax.OffsetCurveOnSurface (curve_id, surface_id, distance_or_parameter)
rhinoscript.curve.OffsetCurveOnSurface (curve_id, surface_id, distance_or_parameter)
curve_id |
Required. String or Guid. The curve object's identifier. Note, the curve must lie on the surface. |
surface_id |
Required. String or Guid. The surface object's identifier. |
distance_or_parameter |
Required. Number or tuple of 2 numbers. If a single number, this is interpreted as the distance of the offset. Based on the curve's direction, a positive value will offset to the left and a negative value will offset to the right. If a tuple of two numbers, this is interpreted as the surface U,V parameter that the curve will be offset through. |
List |
A list of Guids containing the identifiers of the new curve objects if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
def TestOffset():
curve = rs.GetObject("Select curve on a surface", rs.filter.curve)
if curve is None: return False
surface = rs.GetObject("Select base surface", rs.filter.surface)
if surface is None: return False
point = rc.GetPointOnSurface( surface, "Through point" )
if point is None: return False
parameter = rs.SurfaceClosestPoint(surface, point)
rc = rs.OffsetCurveOnSurface( curve, surface, parameter )
return rc is not None
TestOffset()