Skip to content

Commit

Permalink
add euler_characteristic genus and to_reeb_graph() methods merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Apr 5, 2024
2 parents 1a89d82 + c13e2f7 commit 290cd1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- add `mesh.extrude_and_trim_with()` method out of #1077
- fix reset clipping range in thumbnail generation as per #1085
- add `mesh.euler_characteristic()`, `mesh.genus()` and `mesh.to_reeb_graph()` as per #1084

- fix `reset_camera()` by @sergei9838 and Eric


## Soft-breaking Changes
Expand Down
8 changes: 4 additions & 4 deletions vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,14 +1344,14 @@ def reset_camera(self, tight=None) -> "Plotter":
self.renderer.ResetCamera()
else:
x0, x1, y0, y1, z0, z1 = self.renderer.ComputeVisiblePropBounds()

cam = self.renderer.GetActiveCamera()
cam = self.camera

self.renderer.ComputeAspect()
aspect = self.renderer.GetAspect()
angle = np.pi * cam.GetViewAngle() / 180.0
dx, dy = (x1 - x0) * 0.999, (y1 - y0) * 0.999
dist = max(dx / aspect[0], dy) / np.sin(angle / 2) / 2
dx = x1 - x0
dy = y1 - y0
dist = max(dx / aspect[0], dy) / np.tan(angle / 2) / 2

cam.SetViewUp(0, 1, 0)
cam.SetPosition(x0 + dx / 2, y0 + dy / 2, dist * (1 + tight))
Expand Down

0 comments on commit 290cd1d

Please sign in to comment.