Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(48)  |  Call(48)  |  Derive(0)  |  Import(0)

src/l/a/ladybug-HEAD/src/Ladybug_Radiation Rose.py   ladybug(Download)
                # rotating the vectors
                if northVector != rc.Geometry.Vector3d.YAxis:
                    rotatoionAngle= rc.Geometry.Vector3d.VectorAngle(northVector, rc.Geometry.Vector3d.YAxis, rc.Geometry.Plane.WorldXY)
                    for vectorCount, vec in enumerate(tiltedRoseVectors):
                        rcVector = rc.Geometry.Vector3d(vec)

src/l/a/ladybug-HEAD/src/Ladybug_view Rose.py   ladybug(Download)
            vector2 = newRadius * getUnitizedMovingVector(testPt, nextPt)
 
            if math.degrees(rc.Geometry.Vector3d.VectorAngle(vector1, vector2, testPlane))== 180:
                #alternate method for midVector
                midVector = rc.Geometry.Vector3d(vector1)
 
            # find the blocked domain
            startAngle = math.degrees(rc.Geometry.Vector3d.VectorAngle(referenceVector, vector1, testPlane))
            midAngle = math.degrees(rc.Geometry.Vector3d.VectorAngle(referenceVector, midVector, testPlane))
            endAngle = math.degrees(rc.Geometry.Vector3d.VectorAngle(referenceVector, vector2, testPlane))

src/l/a/ladybug-HEAD/src/ladybug_ladybug.py   ladybug(Download)
                northVector = rc.Geometry.Vector3d(north)
                northVector.Unitize()
                return rc.Geometry.Vector3d.VectorAngle(rc.Geometry.Vector3d.YAxis, northVector, rc.Geometry.Plane.WorldXY), northVector
            except:
                    #w = gh.GH_RuntimeMessageLevel.Warning
        for vector in TregenzaPatches: TregenzaVectors.append(rc.Geometry.Vector3d(*vector))
 
        angle = rc.Geometry.Vector3d.VectorAngle(northVector, YAxis)
        if northVector.X > 0 : angle = -angle
 
                    if gh.GH_Document.IsEscapeKeyDown(): assert False
 
                    vecAngle = rc.Geometry.Vector3d.VectorAngle(patchVec, testVec[i]) # calculate the angle between the surface and sky patch
 
                    intersectionMtx[i][patchNum] = {'isIntersect' : 0,
            sunVectorCount =+ 1
 
        angle = rc.Geometry.Vector3d.VectorAngle(northVector, YAxis)
        if northVector.X > 0 : angle = -angle
        # print math.degrees(angle)
                    if gh.GH_Document.IsEscapeKeyDown(): assert False
 
                    vecAngle = rc.Geometry.Vector3d.VectorAngle(vector, testVec[i]) # calculate the angle between the surface and sun vector
                    check = 0
                    if vecAngle < (PI/2):

src/l/a/ladybug-HEAD/src/Ladybug_ShadingDesigner.py   ladybug(Download)
    def getTransform():
        if plane.ZAxis.IsParallelTo(vector)**2 == 1:
            x = rc.Geometry.Transform.PlanarProjection(plane)
            return x
        elif math.sin(rc.Geometry.Vector3d.VectorAngle(plane.ZAxis,vector)) == 1:
        z0 = originalPlane.ZAxis
        z1 = newPlane.ZAxis
        angle = rc.Geometry.Vector3d.VectorAngle(z0, z1)
 
        intersect, axis = rc.Geometry.Intersect.Intersection.PlanePlane(originalPlane, newPlane)
            if pVector != rc.Geometry.Vector3d(0, 0, 0):
                #print int(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))
                if int(round(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))) == 0 or pVector.Length < sc.doc.ModelAbsoluteTolerance:
                    shadingPts.append(pt)
                else:
def isSrfFacingTheVector(sunV, normalVector):
    sunVRev = rc.Geometry.Vector3d(sunV)
    sunVRev.Reverse()
    #print math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector))
    if rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector) < math.pi/2: return True
        brepNormal = getSrfPlane(brep).Normal
        for srf in sortedFaces:
            angle = rc.Geometry.Vector3d.VectorAngle(getSrfPlane(srf).Normal, brepNormal)
            if angle > math.pi/2: srf.Flip()
    elif len(optionalPlanes_)!=0:

src/l/a/ladybug-HEAD/src/Ladybug_SunPath.py   ladybug(Download)
            newSunVector.Reverse()
 
            return 360 - math.degrees(rc.Geometry.Vector3d.VectorAngle(northVector, newSunVector, rc.Geometry.Plane.WorldXY))
 
        # define sun positions based on altitude and azimuth [this one should have a bug]

src/h/o/Honeybee-HEAD/src/Honeybee_Honeybee.py   Honeybee(Download)
            testVector = rc.Geometry.Vector3d(projectedPt - self.cenPt)
            # check the direction of the vectors and flip zone surfaces if needed
            vecAngleDiff = math.degrees(rc.Geometry.Vector3d.VectorAngle(testVector, normal))
 
            # vecAngleDiff should be 0 otherwise the normal is reversed
            if findNormal:
                normal = findNormal[1]
                angle2Z = math.degrees(rc.Geometry.Vector3d.VectorAngle(normal, rc.Geometry.Vector3d.ZAxis))
            else:
                #print findNormal
                testVector = rc.Geometry.Vector3d(cenPt - self.cenPt)
                ## check the direction of the vectors and flip zone surfaces if needed
                if rc.Geometry.Vector3d.VectorAngle(testVector, normal)> 1:
                    normal.Reverse()
                    reverseList = True
        normalVector = self.getSrfCenPtandNormalAlternate()[1]
        if self.type in types:
            angle =  rc.Geometry.Vector3d.VectorAngle(northVector, normalVector, rc.Geometry.Plane.WorldXY)
        #if normalVector.X < 0: angle = (2* math.pi) - angle
        else: angle = 0
        def isClockWise(pts, basePlane):
            vector0 = rc.Geometry.Vector3d(pts[0]- basePlane.Origin)
            vector1 = rc.Geometry.Vector3d(pts[1]- basePlane.Origin)
            vector2 =  rc.Geometry.Vector3d(pts[-1]- basePlane.Origin)
            if rc.Geometry.Vector3d.VectorAngle(vector0, vector1, basePlane) < rc.Geometry.Vector3d.VectorAngle(vector0, vector2, basePlane):

src/l/a/ladybug-HEAD/src/Ladybug_SolarFan.py   ladybug(Download)
    def getTransform():
        if plane.ZAxis.IsParallelTo(vector)**2 == 1:
            x = rc.Geometry.Transform.PlanarProjection(plane)
            return x
        elif math.sin(rc.Geometry.Vector3d.VectorAngle(plane.ZAxis,vector)) == 1:
        z0 = originalPlane.ZAxis
        z1 = newPlane.ZAxis
        angle = rc.Geometry.Vector3d.VectorAngle(z0, z1)
 
        intersect, axis = rc.Geometry.Intersect.Intersection.PlanePlane(originalPlane, newPlane)
            if pVector != rc.Geometry.Vector3d(0, 0, 0):
                #print int(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))
                if int(round(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))) == 0 or pVector.Length < sc.doc.ModelAbsoluteTolerance:
                    shadingPts.append(pt)
                else:
def isSrfFacingTheVector(sunV, normalVector):
    sunVRev = rc.Geometry.Vector3d(sunV)
    sunVRev.Reverse()
    #print math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector))
    if rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector) < math.pi/2: return True

src/l/a/ladybug-HEAD/src/Ladybug_SolarEnvelope.py   ladybug(Download)
    def getTransform():
        if plane.ZAxis.IsParallelTo(vector)**2 == 1:
            x = rc.Geometry.Transform.PlanarProjection(plane)
            return x
        elif math.sin(rc.Geometry.Vector3d.VectorAngle(plane.ZAxis,vector)) == 1:
        z0 = originalPlane.ZAxis
        z1 = newPlane.ZAxis
        angle = rc.Geometry.Vector3d.VectorAngle(z0, z1)
 
        intersect, axis = rc.Geometry.Intersect.Intersection.PlanePlane(originalPlane, newPlane)
            if pVector != rc.Geometry.Vector3d(0, 0, 0):
                #print int(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))
                if int(round(math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVector, pVector)))) == 0 or pVector.Length < sc.doc.ModelAbsoluteTolerance:
                    shadingPts.append(pt)
                else:
def isSrfFacingTheVector(sunV, normalVector):
    sunVRev = rc.Geometry.Vector3d(sunV)
    sunVRev.Reverse()
    #print math.degrees(rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector))
    if rc.Geometry.Vector3d.VectorAngle(sunVRev, normalVector) < math.pi/2: return True

src/l/a/ladybug-HEAD/src/Ladybug_Shadow Study.py   ladybug(Download)
    def getTransform():
        if plane.ZAxis.IsParallelTo(vector)**2 == 1:
            x = rc.Geometry.Transform.PlanarProjection(plane)
            return x
        elif math.sin(rc.Geometry.Vector3d.VectorAngle(plane.ZAxis,vector)) == 1:
        z0 = originalPlane.ZAxis
        z1 = newPlane.ZAxis
        angle = rc.Geometry.Vector3d.VectorAngle(z0, z1)
 
        intersect, axis = rc.Geometry.Intersect.Intersection.PlanePlane(originalPlane, newPlane)
 
            #print int(math.degrees(rc.Geometry.Vector3d.VectorAngle(vector, pVector)))
            if int(math.degrees(rc.Geometry.Vector3d.VectorAngle(vector, pVector))) == 0 or pVector.Length < tol:
                #print 'yup!'
                shadingPts.append(pt)
 
            #print int(math.degrees(rc.Geometry.Vector3d.VectorAngle(vector, pVector)))
            if int(math.degrees(rc.Geometry.Vector3d.VectorAngle(vector, pVector))) == 0 or pVector.Length < tol:
                #print 'yup!'
                shadingPts.append(pt)
 
        # check if the face is facing the sun
        if rc.Geometry.Vector3d.VectorAngle(toBeShadedFace.normal, _sunVector) > math.pi/2:
 
            for shadingFaceID in facesList.keys():

src/l/a/ladybug-HEAD/src/Ladybug_Bounce from Surface.py   ladybug(Download)
            ray = rc.Geometry.Ray3d(testPt, vector)
 
            if numOfBounce>0 and rc.Geometry.Vector3d.VectorAngle(vector, ptsNormals[ptCount]) < math.pi/2:
                intPts = rc.Geometry.Intersect.Intersection.RayShoot(ray, [cleanBrep], numOfBounce)
                #print intPts

  1 | 2  Next