Permet de révéler, entre deux jeux d'objets, les courbes qui sont entièrement superposées à d'autres et qui sont donc équivalentes à des sous-courbes. Cela exclu les intersections en un point et les superposition partielles.
import rhinoscriptsyntax as rs
polylines = rs.GetObjects("Select a set of curves")
subCrvs = rs.GetObjects("Select a set of curves to check for full overlapping with first set")
safeList = []
if subCrvs and polylines:
for subCrv in subCrvs:
overlap = None
for polyline in polylines:
if overlap == None:
intersections = rs.CurveCurveIntersection(subCrv, polyline)
if intersections != None:
for intersection in intersections:
if intersection[0] == 2: #checks for overlap and not point intersection
if intersection[5] == rs.CurveDomain(subCrv)[0] and intersection[6] == rs.CurveDomain(subCrv)[1]: #checks for full overlap and not partial
overlap = True
break
if overlap == True:
safeList.append(subCrv)
rs.SelectObjects(safeList)