Skip to content

Commit

Permalink
updated oxDNA export to use cubic bounding box (taking all three side…
Browse files Browse the repository at this point in the history
…s to be max of computed bounding box)
  • Loading branch information
dave-doty committed Jul 30, 2021
1 parent 9760f5a commit 7bee4b1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scadnano/scadnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -6539,7 +6539,7 @@ def join(self, other: "_OxdnaStrand") -> "_OxdnaStrand":
class _OxdnaSystem:
strands: List[_OxdnaStrand] = field(default_factory=list)

def compute_bounding_box(self) -> _OxdnaVector:
def compute_bounding_box(self, cubic: bool = True) -> _OxdnaVector:
min_vec = None
max_vec = None

Expand All @@ -6555,7 +6555,11 @@ def compute_bounding_box(self) -> _OxdnaVector:
if min_vec is not None and max_vec is not None:
# 5 is arbitrarily chosen so that the box has a bit of wiggle room
# 1.5 multiplier is to make all crossovers appear (advice from Oxdna authors)
return 1.5 * (max_vec - min_vec + _OxdnaVector(5, 5, 5)) # changed
box = 1.5 * (max_vec - min_vec + _OxdnaVector(5, 5, 5))
if cubic: # oxDNA requires cubic bounding box with default simulation options
max_side = max(box.x, box.y, box.z)
box = _OxdnaVector(max_side, max_side, max_side)
return box
else:
return _OxdnaVector(1, 1, 1)

Expand Down

0 comments on commit 7bee4b1

Please sign in to comment.