Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a15b7b
Added SimpleConnection module with 4 submodule placeholder and launcher
AmanAg744 Feb 19, 2025
56cbfc4
Added input and output dock with parameters for the Lapjointbolted co…
AmanAg744 Feb 21, 2025
3a22cb4
Added Design preferences for Bolt and Detailing
AmanAg744 Feb 23, 2025
833ddc7
Updated the detailing tab display message
AmanAg744 Feb 23, 2025
2b722ae
Lap Joint bolted final changes completed and Butt Joint Bolted module…
AmanAg744 Feb 28, 2025
688c044
Minor changes on the Detailing Design preference
AmanAg744 Feb 28, 2025
f3a83eb
Added images for SimpleConnection and some changes to LapJointBolted UI
AmanAg744 Mar 19, 2025
7898ded
Added Calc for LapJointBolted
AmanAg744 Mar 26, 2025
1277ca2
Calculations for Lap Joint Bolted Completed
AmanAg744 Mar 29, 2025
22a436f
Integrated Bolted Lap Joint with GUI
planetaryan Mar 30, 2025
28e4000
utilization ratio added and bolt dia and grade logic improved
AmanAg744 Apr 1, 2025
240c6fd
Merge remote-tracking branch 'bolted_lap_joint/SimpleConnection' into…
planetaryan Apr 2, 2025
f963d47
added max gauge and pitch
AmanAg744 Apr 3, 2025
0de79f0
Merge remote-tracking branch 'bolted_lap_joint/SimpleConnection' into…
planetaryan Apr 3, 2025
3d71c8e
added final pitch,gauge, end and edge dist
AmanAg744 Apr 3, 2025
14dbc61
Merge remote-tracking branch 'bolted_lap_joint/SimpleConnection' into…
planetaryan Apr 3, 2025
668d861
Updated createBoltedLapJoint to use final edge,end,pitch and gauge va…
planetaryan Apr 5, 2025
d8237ca
Plategirder done and LapJointLogic modified
AmanAg744 Apr 17, 2025
60e7374
Merge branch 'SimpleConnection' of https://github.com/AmanAg744/Osdag…
AmanAg744 Apr 17, 2025
23b1fde
final lap joint bolted with cad
AmanAg744 Apr 23, 2025
1a87e60
Working draft of Plate Girder
AmanAg744 Apr 29, 2025
25b7a53
Plate Girder PSO included
AmanAg744 May 21, 2025
c9dced0
PSO ratios checks improved
AmanAg744 May 22, 2025
109b0e3
PSO Updated version
AmanAg744 May 31, 2025
6b638ad
TO check the cad diagram loading
AmanAg744 Jun 1, 2025
b09491f
Latest changes fetched to the branch
AmanAg744 Jul 1, 2025
62d2db4
optimised plate girder cad model
harshans164 Jul 1, 2025
5ad776f
Merge branch 'dev' into CadPlateGirder
AmanAg744 Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
409 changes: 400 additions & 9 deletions src/osdag/Common.py

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions src/osdag/cad/SimpleConnections/BoltedLapJoint/bolted_lap_joint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import numpy
from OCC.Display.SimpleGui import init_display
from OCC.Core.BRepAlgoAPI import BRepAlgoAPI_Fuse
from OCC.Core.BOPAlgo import BOPAlgo_Builder
from OCC.Core.Quantity import Quantity_NOC_SADDLEBROWN,Quantity_NOC_GRAY,Quantity_NOC_BLUE1,Quantity_NOC_RED
from OCC.Core.Graphic3d import *
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeSphere
# Import the component classes
from ...items.bolt import Bolt
from ...items.nut import Nut
from ...items.plate import Plate

def create_bolted_lap_joint(plate1_thickness = 16, plate2_thickness = 8, plate_width = 100, bolt_dia = 16, actual_overlap_length=50,
bolt_rows=4,bolt_cols=2,pitch=20,gauge=20,edge=12,end=13.6,number_bolts=7):

plate_length = 3 * actual_overlap_length

# Calculate the offset of the second plate
plate2_offset = plate_length - actual_overlap_length

nut_thickness = 3.0
# Bolt parameters
bolt_head_radius = bolt_dia/2
bolt_head_thickness = 3.0
bolt_length = (plate1_thickness + plate2_thickness) + nut_thickness # Enough to go through both plates
bolt_shaft_radius = 1.5

# Nut parameters
nut_radius = bolt_head_radius

nut_height = bolt_head_radius
nut_inner_radius = bolt_shaft_radius

# Create the first plate
# Position it at the origin
origin1 = numpy.array([0.0, 0.0, 0.0]) # Global origin lies at midpoint of plate 1
uDir1 = numpy.array([0.0, 0.0, 1.0]) # Points along Z axis (height)
wDir1 = numpy.array([1.0, 0.0, 0.0]) # Points along X axis (length)

plate1 = Plate(plate_length, plate_width, plate1_thickness)
plate1.place(origin1, uDir1, wDir1)
plate1_model = plate1.create_model()

# Create the second plate
# Position it so that it properly overlaps with the first plate
# The second plate is elevated by plate1_thickness and offset in Y direction

origin2 = numpy.array([0.0, plate2_offset, 0.5*(plate1_thickness+plate2_thickness)])
uDir2 = numpy.array([0.0, 0.0, 1.0])
wDir2 = numpy.array([1.0, 0.0, 0.0])

plate2 = Plate(plate_length, plate_width, plate2_thickness)
plate2.place(origin2, uDir2, wDir2)
plate2_model = plate2.create_model()

bolt_positions=[]

# Calculate bolt positions
count = 0
exit_loops = False # Flag to break both loops

for col in range(bolt_cols):
for row in range(bolt_rows):
if count==number_bolts:
exit_loops = True
break # Break out of the inner loop

bolt_positions.append((edge + (row * gauge),
plate_length / 2 - actual_overlap_length + end + (col * pitch),
(0.5 * plate1_thickness) + plate2_thickness))
count += 1

if exit_loops: # Check flag to break outer loop
break



# Create bolts and nuts at the calculated positions
bolts_models = []
nuts_models = []

bolt_uDir = numpy.array([1.0, 0.0, 0.0])
bolt_shaftDir = numpy.array([0.0, 0.0, -1.0]) # Points downward through both plates
for pos in bolt_positions:
# Start bolts from the top of second plate
bolt = Bolt(bolt_head_radius, bolt_head_thickness, bolt_length, bolt_shaft_radius)
bolt.place(pos, bolt_uDir, bolt_shaftDir)
bolt_model = bolt.create_model()
bolts_models.append(bolt_model)

# Position nuts at the bottom of the first plate
nut_origin = numpy.array([pos[0], pos[1], -0.5*plate1_thickness])
nut_uDir = numpy.array([1.0, 0.0, 0.0])
nut_wDir = numpy.array([0.0, 0.0, -1.0]) # Points downward

nut = Nut(nut_radius, nut_thickness, nut_height, nut_inner_radius)
nut.place(nut_origin, nut_uDir, nut_wDir)
nut_model = nut.create_model()
nuts_models.append(nut_model)

# Use BOPAlgo_Builder for assembly
builder = BOPAlgo_Builder()

# Add all parts to the builder
builder.AddArgument(plate1_model)
builder.AddArgument(plate2_model)

for bolt_model in bolts_models:
builder.AddArgument(bolt_model)

for nut_model in nuts_models:
builder.AddArgument(nut_model)

# Perform the boolean operation
builder.Perform()

# Get the resulting assembly
assembly = builder.Shape()

return assembly, plate1_model, plate2_model, bolts_models, nuts_models

# Main execution
if __name__ == "__main__":
# Create the bolted lap joint
lap_joint, plate1, plate2, bolts, nuts = create_bolted_lap_joint()

# Display the assembly
display, start_display, add_menu, add_function_to_menu = init_display()

# Display individual components with different colors for better visualization
display.DisplayShape(plate1, material=Graphic3d_NOM_ALUMINIUM, update=True)
display.DisplayShape(plate2, update=True)

for bolt in bolts:
display.DisplayShape(bolt, color=Quantity_NOC_SADDLEBROWN, update=True)

for nut in nuts:
display.DisplayShape(nut, color=Quantity_NOC_SADDLEBROWN, update=True)
# Highlight the global origin (0,0,0)
origin_point = BRepPrimAPI_MakeSphere(1).Shape() # Small sphere to mark origin
display.DisplayShape(origin_point, color=Quantity_NOC_RED, update=True)

# Alternative: display the full assembly as a single shape
# display.DisplayShape(lap_joint, update=True)
display.set_bg_gradient_color([51, 51, 102], [150, 150, 170])

display.DisableAntiAliasing()
display.FitAll()
start_display()


# bolt_positions = [
# # Format: (x, y, z)
# # Left side, bottom and top corners of overlap
# (edge, plate_length/2 - actual_overlap_length + end, (0.5*plate1_thickness)+plate2_thickness),
# (edge + gauge, plate_length/2 - actual_overlap_length + end, (0.5*plate1_thickness)+plate2_thickness),
# (edge, plate_length/2 - end, (0.5*plate1_thickness)+plate2_thickness),

# # Right side, bottom and top corners of overlap
# (plate_width - edge, plate_length/2 - actual_overlap_length + end, (0.5*plate1_thickness)+plate2_thickness),
# (plate_width - edge, plate_length/2 - end, (0.5*plate1_thickness)+plate2_thickness)
# ]

122 changes: 121 additions & 1 deletion src/osdag/cad/common_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .items.angle import Angle
from .items.channel import Channel
from .items.Gasset_plate import GassetPlate
from .items.plate_girder import PlateGirder
from .items.stiffener_flange import Stiffener_flange
from .items.rect_hollow import RectHollow
from .items.circular_hollow import CircularHollow
Expand Down Expand Up @@ -52,6 +53,8 @@
from .BBCad.nutBoltPlacement_Web import NutBoltArray_Web
from .BBCad.BBCoverPlateBoltedCAD import BBCoverPlateBoltedCAD

from .SimpleConnections.BoltedLapJoint.bolted_lap_joint import *

from .MomentConnections.BBSpliceCoverlateCAD.WeldedCAD import BBSpliceCoverPlateWeldedCAD
from .MomentConnections.BBEndplate.BBEndplate_cadFile import CADFillet
from .MomentConnections.BBEndplate.BBEndplate_cadFile import CADGroove
Expand Down Expand Up @@ -93,7 +96,7 @@
from .MomentConnections.BCEndplate.BCE_nutBoltPlacement import BCE_NutBoltArray
from ..Common import *
from math import *

from OCC.Core.TopoDS import TopoDS_Shape
# from Connections.Shear.Finplate.colWebBeamWebConnectivity import ColWebBeamWeb as finColWebBeamWeb
# from Connections.Shear.Endplate.colWebBeamWebConnectivity import ColWebBeamWeb as endColWebBeamWeb
# from Connections.Shear.cleatAngle.colWebBeamWebConnectivity import ColWebBeamWeb as cleatColWebBeamWeb
Expand Down Expand Up @@ -1783,6 +1786,35 @@ def createColumnInFrameCAD(self):

return sec

def createBoltedLapJoint(self):

Conn = self.module_class
print("THIS IS CONN")
print(Conn)
for attr in dir(Conn):
if not callable(getattr(Conn, attr)) and not attr.startswith("__"):
print(f"{attr}: {getattr(Conn, attr)}")

print(f"Plate 1 Thickness: {float(Conn.plate1thk)}")
print(f"Plate 2 Thickness: {float(Conn.plate2thk)}")
print(f"Plate Width: {float(Conn.width)}")
print(f"Bolt Diameter: {Conn.bolt.bolt_diameter_provided}")
print(f"Actual Overlap Length: {Conn.len_conn}")
print(f"Bolt Columns: {Conn.cols}")
print(f"Bolt Rows: {Conn.rows}")
print(f"Number of Bolts: {Conn.number_bolts}")
print(f"Pitch: {Conn.final_pitch}")
print(f"Gauge: {Conn.final_gauge}")
print(f"Edge Distance: {Conn.final_edge_dist}")
print(f"End Distance: {Conn.final_end_dist}")

lap_joint, plate1, plate2, bolts, nuts = create_bolted_lap_joint(plate1_thickness = float(Conn.plate1thk), plate2_thickness = float(Conn.plate2thk), plate_width = float(Conn.width), bolt_dia = Conn.bolt.bolt_diameter_provided,
actual_overlap_length=Conn.len_conn,bolt_cols=Conn.cols,bolt_rows=Conn.rows, number_bolts=Conn.number_bolts,
pitch=Conn.final_pitch,gauge=Conn.final_gauge,
edge=Conn.final_edge_dist,end=Conn.final_end_dist)
return lap_joint, plate1, plate2, bolts, nuts


def createSimplySupportedBeam(self):

Flex = self.module_class
Expand Down Expand Up @@ -1951,6 +1983,54 @@ def createStrutsInTrusses(self):
return shape


def createPlateGirder(self): #im working here

# Val_obj = self.module_class
# Val_obj.section_property = Val_obj.section_connect_database(Val_obj, Val_obj.result_designation)

Val_obj = self.module_class
print("THIS IS Val_obj")
print(Val_obj)
for attr in dir(Val_obj):
if not callable(getattr(Val_obj, attr)) and not attr.startswith("__"):
print(f"{attr}: {getattr(Val_obj, attr)}")

design_type = Val_obj.design_type
print("Design type : ", design_type)
length = int(Val_obj.length)
print("Total Length : ", length)

D = int(Val_obj.total_depth)
print("Total Depth : ", D)

tw = int(Val_obj.web_thickness)
print("Web Thickness : ", tw)

B_ft = int(Val_obj.top_flange_width)
print("Top Flange Width : ", B_ft)

T_ft = int(Val_obj.top_flange_thickness)
print("Top Flange Thickness : ", T_ft)

B_fb = int(Val_obj.bottom_flange_width)
print("Bottom Flange Width : ", B_fb)

T_fb = int(Val_obj.bottom_flange_thickness)
print("Bottom Flange Thickness : ", T_fb)

gap = int(Val_obj.c)
print("Gap Between Stiffener : ", gap)




plate_girder_model = PlateGirder(D, tw, length, gap, T_ft, T_fb, B_ft, B_fb)

model = plate_girder_model.createPlateGirder()

return model


def display_3DModel(self, component, bgcolor):

self.component = component
Expand Down Expand Up @@ -2269,6 +2349,20 @@ def display_3DModel(self, component, bgcolor):
if self.component == "Model":
osdag_display_shape(self.display, self.ColObj, update=True)

elif self.mainmodule == 'Lap Joint Bolted Connection':
self.col = self.module_class()
self.assembly,self.plate1_model,self.plate2_model,self.bolt_models,self.nuts_models = self.createBoltedLapJoint()

if self.component == "Model":
osdag_display_shape(self.display, self.plate1_model, update=True, material=Graphic3d_NOM_ALUMINIUM)
osdag_display_shape(self.display, self.plate2_model, update=True)
for bolt in self.bolt_models:
osdag_display_shape(self.display, bolt, update=True,
color=Quantity_NOC_SADDLEBROWN)
for nut in self.nuts_models:
osdag_display_shape(self.display, nut, update=True,
color=Quantity_NOC_SADDLEBROWN)

elif self.mainmodule == 'Flexure Member':
self.flex = self.module_class()
self.FObj = self.createSimplySupportedBeam()
Expand All @@ -2290,6 +2384,14 @@ def display_3DModel(self, component, bgcolor):
if self.component == "Model":
osdag_display_shape(self.display, self.ColObj, update=True)


elif self.mainmodule == KEY_DISP_PLATE_GIRDER_WELDED: #im working here
self.col = self.module_class()
self.ColObj = self.createPlateGirder()

if self.component == "Model":
osdag_display_shape(self.display, self.ColObj, update=True)

else:
if self.connection == KEY_DISP_TENSION_BOLTED:
self.T = self.module_class()
Expand Down Expand Up @@ -2475,6 +2577,24 @@ def call_3DModel(self, flag, module_class): # Done

else:
self.display.EraseAll()
elif self.mainmodule == 'Lap Joint Bolted Connection':
if flag is True:
self.ColObj = self.createBoltedLapJoint()

self.display_3DModel("Model", "gradient_bg")

else:
self.display.EraseAll()

elif self.mainmodule == KEY_DISP_PLATE_GIRDER_WELDED:#im working here
if flag is True:
self.ColObj = self.createPlateGirder()

self.display_3DModel("Model", "gradient_bg")

else:
self.display.EraseAll()

else:
if self.connection == KEY_DISP_TENSION_BOLTED or self.connection == KEY_DISP_TENSION_WELDED:

Expand Down
Loading