def generateBolts4Tunnel2(centerX , centerY , halfWidth , halfHeight \ , arcHeight , boltLength , boltLength2 , boltsDistance ): import DDACalcTools bolts = DDACalcTools.pyBolts() print bolts.size() DDACalcTools.calcBolts4Type2Tunnel( float(centerX) , float(centerY) , float(halfWidth), float(halfHeight) \ , float(arcHeight) , float(boltLength) , float(boltLength2) , float(boltsDistance) , bolts) return TunnelBoltsGenerator._convert2BoltElements(bolts)
def generateBolts(centerX , centerY , halfWidth , halfHeight \ , arcRadius , boltsDistance , boltLength , boltLength2 ): import DDACalcTools bolts = DDACalcTools.pyBolts() print bolts.size() DDACalcTools.calcBolts4Type2Tunnel( centerX , centerY , halfWidth, halfHeight \ , arcRadius , boltLength , boltLength2 , boltsDistance , bolts) from loadDataTools import BoltElement resultBolts=[] for bolt in bolts: p1 = ( bolt.startPoint.x , bolt.startPoint.y , 0 ) p2 = ( bolt.endPoint.x , bolt.endPoint.y , 0 ) resultBolts.append(BoltElement(p1 , p2 , 0 , 0 , 0)) print "(%lf , %lf) (%lf , %lf)"%(bolt.startPoint.x \ ,bolt.startPoint.y , bolt.endPoint.x,bolt.endPoint.y) return resultBolts