Skip to content

Commit 90d8d47

Browse files
authored
Merge pull request #31 from ricardoavelino/minthk
Update envelope.thickness
2 parents e77f49b + 0dc248a commit 90d8d47

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

commands/TNA_analysis.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from compas_masonry.session import MasonrySession as Session
1212
from compas_rui import feedback
1313
from compas_tna.diagrams import FormDiagram
14+
from compas_tna.envelope import MeshEnvelope
1415
from compas_tno.analysis import Analysis
1516

1617

@@ -61,6 +62,10 @@ def RunCommand():
6162
analysis = Analysis.create_minthrust_analysis(formdiagram, envelope)
6263

6364
elif objective == "MinimumThickness":
65+
if type(envelope) is MeshEnvelope:
66+
feedback.warn("Minimum thickness analysis is only available for parametric envelopes")
67+
return
68+
6469
analysis = Analysis.create_minthk_analysis(formdiagram, envelope)
6570

6671
elif objective == "MaximumThrust":
@@ -167,6 +172,10 @@ def RunCommand():
167172
print("Optimal Horizontal Thrust Calculated: {0:.3f}".format(fopt))
168173
elif objective == "MinimumThickness":
169174
print("Minimum Thickness Calculated: {0:.3f}".format(fopt))
175+
# Update the envelope for smaller thickness check if it works
176+
if analysis.optimiser.exitflag == 0:
177+
envelope.thickness = fopt
178+
envelope.update_envelope()
170179
elif objective == "SupportDisplacement":
171180
print("Complementary Energy to Assigned Displacements: {0:.3f}".format(fopt))
172181
elif objective == "Bestfit":

0 commit comments

Comments
 (0)