Skip to content

Commit

Permalink
fix: adding support creator from bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Jan 2, 2024
1 parent c5b0270 commit 1bf0094
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LoopStructural/interpolators/supports/_support_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from tkinter.tix import ButtonBox
from LoopStructural.interpolators.supports import support_map, SupportType


Expand All @@ -18,5 +19,18 @@ def from_dict(d):
raise ValueError("No support type specified")
return SupportFactory.create_support(support_type, **d)

@staticmethod
def create_support_from_bbox(
support_type, bounding_box, nelements, element_volume=None
):
if type(support_type) == str:
support_type = SupportType._member_map_[support_type].numerator
bbox = bounding_box.with_buffer(0.2)
bbox.nelements = nelements

return support_map[support_type](
origin=bbox.origin, step_vector=bbox.step_vector, nsteps=bbox.nsteps
)

# @staticmethod
# def create_3d_structured_grid(origin, maximum, step_vector, nsteps)

0 comments on commit 1bf0094

Please sign in to comment.