Skip to content

Commit

Permalink
[geom] Fix Cylinder.bounding_half_extent for non-matching dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Holl committed Dec 4, 2024
1 parent 1dcf735 commit 2394456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phi/geom/_cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def bounding_half_extent(self, epsilon=1e-5):
if self.rotation is not None:
tip = abs(self.up) * .5 * self.depth
return tip + self.radius * sqrt(maximum(epsilon, 1 - self.up**2))
return ncat([.5*self.depth, expand(self.radius, channel(vector=self.radial_axes))], self._center.shape['vector'])
return ncat([.5*self.depth, expand(self.radius, channel(vector=self.radial_axes))], self._center.shape['vector'], expand_values=True)

def at(self, center: Tensor) -> 'Geometry':
return Cylinder(center, self.radius, self.depth, self.rotation, self.axis, self.variable_attrs, self.value_attrs)
Expand Down

0 comments on commit 2394456

Please sign in to comment.