Closed kamex-kumax closed 6 years ago
`if orientation != None: ori = int(orientation) sin45 = math.sin(math.radians(45)) cos45 = math.cos(math.radians(45)) if ori >= 0 and ori <= 9: if ori == 0: orient = rc.Geometry.Vector3d( 0, 1, 0) # N elif ori == 1: orient = rc.Geometry.Vector3d( sin45, cos45, 0) # NE elif ori == 2: orient = rc.Geometry.Vector3d( 1, 0, 0) # E elif ori == 3: orient = rc.Geometry.Vector3d( sin45, -cos45, 0) # SE elif ori == 4: orient = rc.Geometry.Vector3d( 0, -1, 0) # S elif ori == 5: orient = rc.Geometry.Vector3d(-sin45, -cos45, 0) # SW elif ori == 6: orient = rc.Geometry.Vector3d(-1, 0, 0) # W elif ori == 7: orient = rc.Geometry.Vector3d( -sin45, cos45, 0) # NW elif ori == 8: orient = rc.Geometry.Vector3d( 0, 0, 1) # ROOF # roofOrient = True elif ori == 9: orient = rc.Geometry.Vector3d( 0, 0, -1) # FLOOR # floorOrient = True
else: #orient = None warning = "_orientation_ must be between 0 and 9." print warning ghenv.Component.AddRuntimeMessage(gh.GH_RuntimeMessageLevel.Warning, warning) #print 'Orient ', orient return -1 #return None, None, None, None, None, None, None, None, None`
`if orientation != None: ori = int(orientation) sin45 = math.sin(math.radians(45)) cos45 = math.cos(math.radians(45)) if ori >= 0 and ori <= 9: if ori == 0: orient = rc.Geometry.Vector3d( 0, 1, 0) # N elif ori == 1: orient = rc.Geometry.Vector3d( sin45, cos45, 0) # NE elif ori == 2: orient = rc.Geometry.Vector3d( 1, 0, 0) # E elif ori == 3: orient = rc.Geometry.Vector3d( sin45, -cos45, 0) # SE elif ori == 4: orient = rc.Geometry.Vector3d( 0, -1, 0) # S elif ori == 5: orient = rc.Geometry.Vector3d(-sin45, -cos45, 0) # SW elif ori == 6: orient = rc.Geometry.Vector3d(-1, 0, 0) # W elif ori == 7: orient = rc.Geometry.Vector3d( -sin45, cos45, 0) # NW elif ori == 8: orient = rc.Geometry.Vector3d( 0, 0, 1) # ROOF # roofOrient = True elif ori == 9: orient = rc.Geometry.Vector3d( 0, 0, -1) # FLOOR # floorOrient = True
print 'orient ', orient