Skip to content

Commit 87cbd6e

Browse files
committed
Implemented new feature: Mohr-Coulomb theory
Enables the calculation of shear and bending strength using the Mohr-Coulomb theory and makes it stress-related. This method is recommended for masonry structures in earthquake scenarios.
1 parent 4ba4435 commit 87cbd6e

File tree

6 files changed

+364
-92
lines changed

6 files changed

+364
-92
lines changed

kk_bullet_constraints_builder.zip

1.4 KB
Binary file not shown.

kk_bullet_constraints_builder/global_props.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ class bcb_props(bpy.types.PropertyGroup):
219219
exec("elemGrp_%d_EGSidxTl2R" %i +" = float_(name='2nd Rot. Tol.', default=presets[j][EGSidxTl2R], min=-1.0, max=pi, description='Second deformation tolerance limit for angular change in radian for connection removal. The Formula Assistant might set this to 0 which means that this tolerance will be calculated later during the constraint building phase individually for each connection using Formula Assistant settings, there is no need to change it back then')")
220220
exec("elemGrp_%d_EGSidxPrio" %i +" = int_(name='Connection Priority', default=presets[j][EGSidxPrio], min=1, max=9, description='Changes the connection priority for this element group which will override that the weaker breaking threshold of two elements is preferred for an connection. Lower Strength Priority has similar functionality but works on all groups, however, it is ignored if the priority here is different for a particular connection')")
221221
exec("elemGrp_%d_EGSidxFric" %i +" = float_(name='Friction', default=presets[j][EGSidxFric], min=0.0, max=100000, description='Coefficient of friction for the given material (dimensionless)')")
222+
exec("elemGrp_%d_EGSidxMCTh" %i +" = bool_(name='Mohr-Coulomb Theory', default=presets[j][EGSidxMCTh], description='Enables the calculation of shear and bending strength using the Mohr-Coulomb theory and makes it stress-related. This method is recommended for masonry structures in earthquake scenarios')")
222223
exec("elemGrp_%d_EGSidxScal" %i +" = float_(name='Rescale Factor', default=presets[j][EGSidxScal], min=0.0, max=10.0, description='Applies scaling factor on elements to avoid `Jenga´ effect (undesired stability increase caused by incompressible rigid bodies). This has no influence on breaking threshold and mass calculations')")
223224
exec("elemGrp_%d_EGSidxNoHo" %i +" = bool_(name='No Horizontal Connections', default=presets[j][EGSidxNoHo], description='Removes horizontal connections between elements of different element groups. This can be useful for masonry walls touching a framing structure without a particular fixation')")
224225
exec("elemGrp_%d_EGSidxNoCo" %i +" = bool_(name='No Connections At All', default=presets[j][EGSidxNoCo], description='Removes connections between elements of different element groups if priorities of the groups are equal, only when priorities are different then this setting will be ignored. This can be useful for rigs with predefined constraints where groups should stay completely detached from another even when they are actually touching or overlapping')")
@@ -268,6 +269,7 @@ def props_update_menu(self):
268269
exec("self.elemGrp_%d_EGSidxTl2R" %i +" = elemGrps[i][EGSidxTl2R]")
269270
exec("self.elemGrp_%d_EGSidxPrio" %i +" = elemGrps[i][EGSidxPrio]")
270271
exec("self.elemGrp_%d_EGSidxFric" %i +" = elemGrps[i][EGSidxFric]")
272+
exec("self.elemGrp_%d_EGSidxMCTh" %i +" = elemGrps[i][EGSidxMCTh]")
271273
exec("self.elemGrp_%d_EGSidxScal" %i +" = elemGrps[i][EGSidxScal]")
272274
exec("self.elemGrp_%d_EGSidxNoHo" %i +" = elemGrps[i][EGSidxNoHo]")
273275
exec("self.elemGrp_%d_EGSidxNoCo" %i +" = elemGrps[i][EGSidxNoCo]")
@@ -328,6 +330,7 @@ def props_update_globals(self):
328330
elemGrps[i][EGSidxTl2R] = eval("self.elemGrp_%d_EGSidxTl2R" %i)
329331
elemGrps[i][EGSidxPrio] = eval("self.elemGrp_%d_EGSidxPrio" %i)
330332
elemGrps[i][EGSidxFric] = eval("self.elemGrp_%d_EGSidxFric" %i)
333+
elemGrps[i][EGSidxMCTh] = eval("self.elemGrp_%d_EGSidxMCTh" %i)
331334
elemGrps[i][EGSidxScal] = eval("self.elemGrp_%d_EGSidxScal" %i)
332335
elemGrps[i][EGSidxNoHo] = eval("self.elemGrp_%d_EGSidxNoHo" %i)
333336
elemGrps[i][EGSidxNoCo] = eval("self.elemGrp_%d_EGSidxNoCo" %i)

kk_bullet_constraints_builder/global_vars.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@
3535
################################################################################
3636

3737
### Vars:
38-
bcb_version = (3, 5, 6)
38+
bcb_version = (3, 5, 7)
3939

4040
### Customizable element group presets
4141
presets = [
42-
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
43-
# Name RVP Mat.preset Density CT BTC BTT BTS BTS90 BTB BTB90 BTP T1D T1R T2D T2R Bev. Scale Facing F.Assist.+Data Cyl PLen BTX Prio Load NoHo Fric NoCo Iter DClP BLC BLT BLS BLS9 BLB BLB9 BTI DCor
44-
[ "", 1, "Uncategorized", 2400, 15, "35", "5.2", "155", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
45-
[ "Base", 1, "Uncategorized", 2000, 0, "0", "0", "0", "", "0", "", "0", 0, 0, 0, 0, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
46-
[ "Victims", 1, "Uncategorized", 1060, 20, "13", "15", "7", "", "0.2", "", "15", .1, .2, .6, 3.14, 0, 1.0, 0, "None", 0, .001, 1, 5, 0, 0, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
47-
[ "Concrete", 1, "Concrete", 2400, 15, "35", "3.5", "0.9", "", "1.0", "", "0", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
48-
[ "RC Columns", 1, "Concrete", 2400, 15, "35", "5.2", "155", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
49-
[ "RC Walls", 1, "Concrete", 2400, 15, "35", "5.2", "0.9", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
50-
[ "RC Slabs", 1, "Concrete", 2400, 15, "35", "5.2", "0.9", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
51-
[ "Masonry Walls", 1, "Masonry", 1800, 15, "10", "2", "0.3", "", "0.3", "", "0", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
52-
[ "Timber Spruce", 1, "Timber", 470, 15, "40", "80", "7.5", "", "68", "", "80", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
53-
[ "Timber Larch", 1, "Timber", 590, 15, "48", "105", "9", "", "93", "", "105", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
54-
[ "Timber Ash", 1, "Timber", 690, 15, "50", "130", "13", "", "105", "", "130", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
55-
[ "I-Beams #1 Screwed", 1, "Steel", 7800, 22, "250", "61.84","37.1", "", "6.18", "", "123.7",.1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
56-
[ "I-Beams #1 Welded", 1, "Steel", 7800, 22, "250", "250", "150", "", "16.67","", "500", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
57-
[ "I-Beams #2 Screwed", 1, "Steel", 7800, 22, "350", "94.5", "56.7", "", "45.15","", "135", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
58-
[ "I-Beams #2 Welded", 1, "Steel", 7800, 22, "350", "350", "210", "", "71.11","", "500", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
59-
[ "HSS-Beams Welded", 1, "Steel", 7800, 22, "250", "250", "150", "", "29.17","", "500", .1, .2, .2, .8, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]
42+
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
43+
# Name RVP Mat.preset Density CT BTC BTT BTS BTS90 BTB BTB90 BTP T1D T1R T2D T2R Bev. Scale Facing F.Assist.+Data Cyl PLen BTX Prio Load NoHo Fric NoCo Iter DClP BLC BLT BLS BLS9 BLB BLB9 BTI DCor MCTh
44+
[ "", 1, "Uncategorized", 2400, 15, "35", "5.2", "155", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
45+
[ "Base", 1, "Uncategorized", 2000, 0, "0", "0", "0", "", "0", "", "0", 0, 0, 0, 0, 0, .95, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
46+
[ "Victims", 1, "Uncategorized", 1060, 20, "13", "15", "7", "", "0.2", "", "15", .1, .2, .6, 3.14, 0, 1.0, 0, "None", 0, .001, 1, 5, 0, 0, .5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
47+
[ "Concrete", 1, "Concrete", 2400, 15, "35", "3.5", "0.9", "", "1.0", "", "0", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
48+
[ "RC Columns", 1, "Concrete", 2400, 15, "35", "5.2", "155", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
49+
[ "RC Walls", 1, "Concrete", 2400, 15, "35", "5.2", "0.9", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
50+
[ "RC Slabs", 1, "Concrete", 2400, 15, "35", "5.2", "0.9", "", "1.0", "", "1.3", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
51+
[ "Masonry Walls", 1, "Masonry", 1800, 15, "10", "0.2", "0.5", "", "0.1", "", "0.1", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ],
52+
[ "Timber Spruce", 1, "Timber", 470, 15, "40", "80", "7.5", "", "68", "", "80", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
53+
[ "Timber Larch", 1, "Timber", 590, 15, "48", "105", "9", "", "93", "", "105", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
54+
[ "Timber Ash", 1, "Timber", 690, 15, "50", "130", "13", "", "105", "", "130", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
55+
[ "I-Beams #1 Screwed", 1, "Steel", 7800, 22, "250", "61.84","37.1", "", "6.18", "", "123.7",.1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
56+
[ "I-Beams #1 Welded", 1, "Steel", 7800, 22, "250", "250", "150", "", "16.67","", "500", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
57+
[ "I-Beams #2 Screwed", 1, "Steel", 7800, 22, "350", "94.5", "56.7", "", "45.15","", "135", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
58+
[ "I-Beams #2 Welded", 1, "Steel", 7800, 22, "350", "350", "210", "", "71.11","", "500", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
59+
[ "HSS-Beams Welded", 1, "Steel", 7800, 22, "250", "250", "150", "", "29.17","", "500", .1, .2, .2, .8, 0, 1.0, 0, "None", 0, 0, 1, 5, 0, 0, .8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ]
6060
] # Empty name means this group is to be used when element is not part of any element group
6161

6262
# Actual element group list (for elements of different conflicting groups the weaker thresholds is used, also the type is changed accordingly)
@@ -94,6 +94,7 @@
9494
EGSidxTl2R = 15 # Tolerance 2nd Def.Rot. | For baking: Second deformation tolerance limit for angular change in radian for connection removal
9595
EGSidxPrio = 23 # Connection Priority | Changes the connection priority for this element group which will override that the weaker breaking threshold of two elements is preferred for an connection. Lower Strength Priority has similar functionality but works on all groups, however, it is ignored if the priority here is different for a particular connection.
9696
EGSidxFric = 26 # Friction | Coefficient of friction for the given material (dimensionless).
97+
EGSidxMCTh = 38 # Mohr-Coulomb Theory | Enables the calculation of shear and bending strength using the Mohr-Coulomb theory and makes it stress-related. This method is recommended for masonry structures in earthquake scenarios.
9798
EGSidxScal = 17 # Scale | Apply scaling factor on elements to avoid `Jenga
9899
EGSidxNoHo = 25 # No Horizontal Connect. | Removes horizontal connections between elements of different element groups. This can be useful for masonry walls touching a framing structure without a particular fixation.
99100
EGSidxNoCo = 27 # No Connections At All | Removes connections between elements of different element groups. This can be useful for rigs with predefined constraints where groups should stay completely detached from another even when they are actually touching or overlapping.
@@ -104,7 +105,7 @@
104105
EGSidxDCor = 37 # Displacement Correction | Enables the correction of initial displacements. This can compensate for sagging structures such as bridges that would otherwise require a very high solver step count to be straight. To do this, the simulation must be run twice. On the first run, the displacements are saved into an external file when the warm-up period ends. In the second run (rebuilding required), the differences are integrated into the mesh. Delete the external file to reset.
105106
EGSidxDClP = 29 # Dis. Col. Permanently | Disables collisions between initially connected elements of this element group permanently (overrides global setting).
106107
EGSidxIter = 28 # Const. Solver Iterations | Overrides the Constraint Solver Iterations value of the scene for constraints of this element group if set to a value greater 0. Higher numbers can help to reduce solver induced deformation on elements bearing extreme loads.
107-
# !!! Last ID: 37 !!! (Can be different from above line because list is not in order!)
108+
# !!! Last ID: 38 !!! (Can be different from above line because list is not in order!)
108109
# To add further element group variables add them here but also above in the presets at the correct index.
109110
# Aside from creating a corresponding UI property in global_props.py and gui.py no extra storage handling is needed like for global settings.
110111

kk_bullet_constraints_builder/gui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ def draw(self, context):
920920
row = col.row(align=1)
921921
if props.menu_gotData: row.enabled = 0
922922
row.prop(props, "elemGrp_%d_EGSidxFric" %i)
923+
row.prop(props, "elemGrp_%d_EGSidxIter" %i)
924+
925+
row = col.row(align=1)
926+
if props.menu_gotData: row.enabled = 0
927+
row.prop(props, "elemGrp_%d_EGSidxMCTh" %i)
923928
row.prop(props, "elemGrp_%d_EGSidxCyln" %i)
924929

925930
row = col.row(align=1)
@@ -943,9 +948,6 @@ def draw(self, context):
943948
row.prop(props, "elemGrp_%d_EGSidxDCor" %i)
944949
row.prop(props, "elemGrp_%d_EGSidxDClP" %i)
945950

946-
row = col.row(align=1)
947-
row.prop(props, "elemGrp_%d_EGSidxIter" %i)
948-
949951
else: # Message if no element group is selected
950952
row = layout.row(align=1); row.alignment = 'CENTER'
951953
row.label(text="No element group", icon="INFO")

kk_bullet_constraints_builder/gui_buttons.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,11 @@ def execute(self, context):
232232

233233
###### Building FM
234234
build_fm(use_handler=self.use_handler)
235-
236-
if not self.use_handler and asciiExportName +".txt" in bpy.data.texts:
237-
try: bpy.data.texts.remove(bpy.data.texts[asciiExportName +".txt"], do_unlink=1)
238-
except: bpy.data.texts.remove(bpy.data.texts[asciiExportName +".txt"])
235+
236+
# # Remove export data for Fracture Modifier (commented out because we need it for the monitor in some cases)
237+
# if not self.use_handler and asciiExportName +".txt" in bpy.data.texts:
238+
# try: bpy.data.texts.remove(bpy.data.texts[asciiExportName +".txt"], do_unlink=1)
239+
# except: bpy.data.texts.remove(bpy.data.texts[asciiExportName +".txt"])
239240

240241
if props.menu_gotData:
241242
if props.automaticMode and props.postprocTools_aut:

0 commit comments

Comments
 (0)