def doSegmentAimPointConstraint(objList): """ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION: Processes a list of items to make a contstraint array ARGUMENTS: objList(list) - list of items to connect RETURNS: constraintGroups(list) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> """ constraintGroups = [] if len(objList) < 3: return 'Not enough items to make this tool worthwhile' # check to see if we have at least 3 items if len(objList) == 3: print 'Three!' constraintGroups.append( doPointAimConstraintObjectGroup([objList[0], objList[2]], objList[1], mode=0)) elif len(objList) == 4: constraintGroups.append( doPointAimConstraintObjectGroup([objList[0], objList[3]], objList[1], mode=1)) constraintGroups.append( doPointAimConstraintObjectGroup([objList[0], objList[3]], objList[2], mode=1)) else: #first get our main sets mainSet = lists.returnFirstMidLastList(objList) constraintGroups.append( doPointAimConstraintObjectGroup([mainSet[0], mainSet[2]], mainSet[1], mode=0)) setsToConstrain = lists.returnFactoredConstraintList(objList, 3) for set in setsToConstrain: if len(set) == 3: constraintGroups.append( doPointAimConstraintObjectGroup([set[0], set[2]], set[1], mode=0)) else: constraintGroups.append( doPointAimConstraintObjectGroup([set[0], set[3]], set[1], mode=1)) constraintGroups.append( doPointAimConstraintObjectGroup([set[1], set[3]], set[2], mode=1)) return constraintGroups
def doSegmentAimPointConstraint(objList): """ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION: Processes a list of items to make a contstraint array ARGUMENTS: objList(list) - list of items to connect RETURNS: constraintGroups(list) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> """ constraintGroups = [] if len(objList) < 3: return 'Not enough items to make this tool worthwhile' # check to see if we have at least 3 items if len(objList) == 3: print 'Three!' constraintGroups.append(doPointAimConstraintObjectGroup([objList[0],objList[2]],objList[1],mode=0)) elif len(objList) == 4: constraintGroups.append(doPointAimConstraintObjectGroup([objList[0],objList[3]],objList[1],mode=1)) constraintGroups.append(doPointAimConstraintObjectGroup([objList[0],objList[3]],objList[2],mode=1)) else: #first get our main sets mainSet = lists.returnFirstMidLastList(objList) constraintGroups.append(doPointAimConstraintObjectGroup([mainSet[0],mainSet[2]],mainSet[1],mode=0)) setsToConstrain = lists.returnFactoredConstraintList(objList, 3) for set in setsToConstrain: if len(set) == 3: constraintGroups.append(doPointAimConstraintObjectGroup([set[0],set[2]],set[1],mode=0)) else: constraintGroups.append(doPointAimConstraintObjectGroup([set[0],set[3]],set[1],mode=1)) constraintGroups.append(doPointAimConstraintObjectGroup([set[1],set[3]],set[2],mode=1)) return constraintGroups