summaryrefslogtreecommitdiff
path: root/Connections/Shear/Finplate/filletweld.py
diff options
context:
space:
mode:
authordeepa-chaudhari2015-06-02 22:34:08 +0530
committerdeepa-chaudhari2015-06-02 22:34:08 +0530
commitaf0232ace0890ee6e8afc97c0fefd03a224c42bb (patch)
tree6ba0b57fe30456f26362a6713718280440f8c2d9 /Connections/Shear/Finplate/filletweld.py
downloadOsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.tar.gz
OsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.tar.bz2
OsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.zip
Initial checkin
Diffstat (limited to 'Connections/Shear/Finplate/filletweld.py')
-rw-r--r--Connections/Shear/Finplate/filletweld.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/Connections/Shear/Finplate/filletweld.py b/Connections/Shear/Finplate/filletweld.py
new file mode 100644
index 0000000..91d8cef
--- /dev/null
+++ b/Connections/Shear/Finplate/filletweld.py
@@ -0,0 +1,44 @@
+'''
+Created on 27-May-2015
+
+@author: deepa
+'''
+import numpy
+from ModelUtils import *
+from OCC.BRepAlgoAPI import BRepAlgoAPI_Fuse
+
+class FilletWeld(object):
+
+ def __init__(self,b,h,L):
+ self.L = L
+ self.b = b
+ self.h = h
+ 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()
+
+ def place(self, secOrigin, uDir, wDir):
+ self.secOrigin = secOrigin
+ self.uDir = uDir
+ self.wDir = wDir
+ self.computeParams()
+
+ def computeParams(self):
+ self.vDir = numpy.cross(self.wDir, self.uDir)
+ self.a1 = self.secOrigin
+ self.a2 = self.secOrigin + self.b * self.uDir
+ self.a3 = self.secOrigin + self.h * self.vDir
+ self.points = [self.a1, self.a2, self.a3,]
+
+
+ def createModel(self):
+ Pnt = getGpPt(self.secOrigin)
+ edges = makeEdgesFromPoints(self.points)
+ wire = makeWireFromEdges(edges)
+ aFace = makeFaceFromWire(wire)
+ extrudeDir = self.L * (self.wDir) # extrudeDir is a numpy array
+ prism = makePrismFromFace(aFace, extrudeDir)
+ my_sphere = BRepPrimAPI_MakeSphere(Pnt,5.0).Shape()
+ spherebody = BRepAlgoAPI_Fuse(prism, my_sphere).Shape()
+ return prism \ No newline at end of file