summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Connections/Shear/Finplate/bolt.py35
-rw-r--r--Connections/Shear/Finplate/colWebBeamWebConnectivity.py9
-rw-r--r--Connections/Shear/Finplate/finPlateMain.py26
-rw-r--r--Connections/Shear/Finplate/nutBoltPlacement.py41
4 files changed, 79 insertions, 32 deletions
diff --git a/Connections/Shear/Finplate/bolt.py b/Connections/Shear/Finplate/bolt.py
index 4badc86..c404d34 100644
--- a/Connections/Shear/Finplate/bolt.py
+++ b/Connections/Shear/Finplate/bolt.py
@@ -22,25 +22,32 @@ class Bolt(object):
self.H = H
self.T = T
self.r = r
- self.secOrigin = numpy.array([0, 0, 0])
- self.uDir = numpy.array([1.0, 0, 0])
- self.wDir = numpy.array([0.0, 0, 1.0])
- self.computeParams()
+ self.origin = None
+ self.uDir = None
+ self.shaftDir = None
+ self.vDir = None
+ self.a1 = None
+ self.a2 = None
+ self.a3 = None
+ self.a4 = None
+ self.a5 = None
+ self.a6 = None
+ self.points = []
+ #self.computeParams()
- def place(self, secOrigin, uDir, wDir):
- self.secOrigin = secOrigin
+ def place(self, origin, uDir, shaftDir):
+ self.origin = origin
self.uDir = uDir
- self.wDir = wDir
+ self.shaftDir = shaftDir
self.computeParams()
def getPoint(self,theta):
theta = math.radians(theta)
- point = self.secOrigin + (self.R * math.cos(theta)) * self.uDir + (self.R * math.sin(theta)) * self.vDir
+ point = self.origin + (self.R * math.cos(theta)) * self.uDir + (self.R * math.sin(theta)) * self.vDir
return point
- def computeParams(self):
-
- self.vDir = numpy.cross(self.wDir, self.uDir)
+ def computeParams(self):
+ self.vDir = numpy.cross(self.shaftDir, self.uDir)
self.a1 = self.getPoint(0)
self.a2 = self.getPoint(60)
self.a3 = self.getPoint(120)
@@ -56,7 +63,7 @@ class Bolt(object):
edges = makeEdgesFromPoints(self.points)
wire = makeWireFromEdges(edges)
aFace = makeFaceFromWire(wire)
- extrudeDir = self.T * self.wDir # extrudeDir is a numpy array
+ extrudeDir = -self.T * self.shaftDir # extrudeDir is a numpy array
boltHead = makePrismFromFace(aFace, extrudeDir)
mkFillet = BRepFilletAPI_MakeFillet(boltHead)
anEdgeExplorer = TopExp_Explorer(boltHead, TopAbs_EDGE)
@@ -66,9 +73,9 @@ class Bolt(object):
anEdgeExplorer.Next()
boltHead = mkFillet.Shape()
- cylOrigin = self.secOrigin + self.T * self.wDir
+ cylOrigin = self.origin
- boltCylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(getGpPt(cylOrigin), getGpDir(self.wDir)), self.r, self.H).Shape()
+ boltCylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(getGpPt(cylOrigin), getGpDir(self.shaftDir)), self.r, self.H).Shape()
whole_Bolt = BRepAlgoAPI_Fuse(boltHead,boltCylinder).Shape()
mkFillet = BRepFilletAPI_MakeFillet(whole_Bolt)
diff --git a/Connections/Shear/Finplate/colWebBeamWebConnectivity.py b/Connections/Shear/Finplate/colWebBeamWebConnectivity.py
index 46bdc27..181dc9d 100644
--- a/Connections/Shear/Finplate/colWebBeamWebConnectivity.py
+++ b/Connections/Shear/Finplate/colWebBeamWebConnectivity.py
@@ -93,11 +93,14 @@ class ColWebBeamWeb(object):
self.weldRight.place(filletWeld2Origin,uDir1,wDir1)
def createNutBoltArray(self):
- nutboltArrayOrigin = self.plate.secOrigin + self.plate.T/2.0 * self.plate.uDir - self.plate.L/2.0 * self.plate.vDir
+ nutboltArrayOrigin = self.plate.secOrigin
+ nutboltArrayOrigin -= self.plate.T/2.0 * self.plate.uDir
+ nutboltArrayOrigin += self.plate.L/2.0 * self.plate.vDir
+
gaugeDir = self.plate.wDir
- pitchDir = self.plate.vDir
+ pitchDir = -self.plate.vDir
boltDir = self.plate.uDir
- self.nutBoltArray.place(nutboltArrayOrigin, gaugeDir, pitchDir,boltDir)
+ self.nutBoltArray.place(nutboltArrayOrigin, gaugeDir, pitchDir, boltDir)
def get_models(self):
'''Returning 3D models
diff --git a/Connections/Shear/Finplate/finPlateMain.py b/Connections/Shear/Finplate/finPlateMain.py
index d3509b1..2501eff 100644
--- a/Connections/Shear/Finplate/finPlateMain.py
+++ b/Connections/Shear/Finplate/finPlateMain.py
@@ -132,7 +132,7 @@ class MainController(QtGui.QMainWindow):
# self.memberlist = [my_box, my_cylendar, my_cylendar]
#my_sphere = BRepPrimAPI_MakeSphere(5).Shape()
- self.fuse_model = self.create2Dcad()
+ #self.fuse_model = self.create2Dcad()
#self.fuse_model = my_sphere
@@ -757,7 +757,7 @@ class MainController(QtGui.QMainWindow):
colflangeconn = ColFlangeBeamWeb(column,beam,weld,plate,boltRadius,nutRadius)
return colflangeconn.create_3dmodel()
- def call_3DModel(self):
+ def call_3DModelduplicate(self):
self.display.EraseAll()
uiObj = self.getuser_inputs()
resultObj = finConn(uiObj)
@@ -780,11 +780,31 @@ class MainController(QtGui.QMainWindow):
plateOrigin = connectivity.plate.secOrigin
gpPntplateOrigin= getGpPt(plateOrigin)
my_sphere = BRepPrimAPI_MakeSphere(gpPntplateOrigin,2).Shape()
- self.display.DisplayShape(my_sphere,update=True)
+ #self.display.DisplayShape(my_sphere,update=True)
else:
self.display.DisplayMessage(gp_Pnt(1000,0,400),"Sorry, can not create 3D model",height = 25.0)
+ def call_3DModel(self):
+ if self.ui.btn3D.isEnabled():
+ self.ui.chkBxBeam.setChecked(QtCore.Qt.Unchecked)
+ self.ui.chkBxCol.setChecked(QtCore.Qt.Unchecked)
+ self.ui.chkBxFinplate.setChecked(QtCore.Qt.Unchecked)
+ self.ui.mytabWidget.setCurrentIndex(0)
+
+ if self.ui.comboConnLoc.currentText()== "Column web-Beam web":
+ connectivity = self.colWebBeamWeb
+ else:
+ self.ui.mytabWidget.setCurrentIndex(0)
+ connectivity = self.createColFlangeBeamWeb()
+
+ self.display3Dmodel(connectivity.get_models(), "Model")
+ plateOrigin = connectivity.plate.secOrigin
+ gpPntplateOrigin= getGpPt(plateOrigin)
+ my_sphere = BRepPrimAPI_MakeSphere(gpPntplateOrigin,2).Shape()
+ self.display.DisplayShape(my_sphere,update=True)
+
+
def call_3DBeam(self):
'''
Creating and displaying 3D Beam
diff --git a/Connections/Shear/Finplate/nutBoltPlacement.py b/Connections/Shear/Finplate/nutBoltPlacement.py
index c7e5832..2e1fb19 100644
--- a/Connections/Shear/Finplate/nutBoltPlacement.py
+++ b/Connections/Shear/Finplate/nutBoltPlacement.py
@@ -6,13 +6,15 @@ Created on 07-Jun-2015
import numpy
from bolt import Bolt
from nut import Nut
+from OCC.BRepPrimAPI import BRepPrimAPI_MakeSphere
+from ModelUtils import getGpPt
class NutBoltArray():
def __init__(self,boltPlaceObj,nut,bolt,gap):
- self.origin = numpy.array([0.0, 0.0, 0])
- self.gaugeDir = numpy.array([1.0, 0.0, 0])
- self.pitchDir = numpy.array([0.0, 1.0, 0])
- self.boltDir = numpy.array([0.0, 0.0, -1.0])
+ self.origin = None
+ self.gaugeDir = None
+ self.pitchDir = None
+ self.boltDir = None
self.initBoltPlaceParams(boltPlaceObj)
@@ -25,7 +27,7 @@ class NutBoltArray():
self.initialiseNutBolts()
self.positions = []
- self.calculatePositions()
+ #self.calculatePositions()
self.models = []
@@ -39,17 +41,25 @@ class NutBoltArray():
def initBoltPlaceParams(self,boltPlaceObj):
self.pitch = boltPlaceObj['Bolt']['pitch']
self.gauge = boltPlaceObj['Bolt']['gauge']
+ #self.gauge = 30
self.edge = boltPlaceObj['Bolt']['edge']
self.end = boltPlaceObj['Bolt']['enddist']
self.row = boltPlaceObj['Bolt']['numofrow']
self.col = boltPlaceObj['Bolt']['numofcol']
-
+ #self.row = 3
+ #self.col = 2
+
def calculatePositions(self):
self.positions = []
- for rw in range(1,(self.row +1)):
+ for rw in range(self.row):
for col in range(self.col):
- pos = self.origin +(self.edge + (col * self.gauge))* self.gaugeDir + rw * self.pitch * self.pitchDir
+ pos = self.origin
+ pos = pos + self.edge * self.gaugeDir
+ pos = pos + col * self.gauge * self.gaugeDir
+ pos = pos + self.end * self.pitchDir
+ pos = pos + rw * self.pitch * self.pitchDir
+
self.positions.append(pos)
def place(self, origin, gaugeDir, pitchDir, boltDir):
@@ -60,16 +70,23 @@ class NutBoltArray():
self.calculatePositions()
- for index,pos in enumerate (self.positions):
- self.bolts[index].place(pos,gaugeDir,boltDir)
- self.nuts[index].place((pos + self.gap* boltDir),gaugeDir,pitchDir)
+ for index, pos in enumerate (self.positions):
+ self.bolts[index].place(pos, gaugeDir, boltDir)
+ self.nuts[index].place((pos + self.gap * boltDir), gaugeDir, -boltDir)
def createModel(self):
for bolt in self.bolts:
- self.models.append(bolt.createModel())
+ self.models.append(bolt.createModel())
+
for nut in self.nuts:
self.models.append(nut.createModel())
+
+ dbg = self.dbgSphere(self.origin)
+ self.models.append(dbg)
+
+ def dbgSphere(self, pt):
+ return BRepPrimAPI_MakeSphere(getGpPt(pt), 2).Shape()
def getnutboltModels(self):
return self.models