Skip to content

fixed html export of lines #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions meshplot/Viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,13 @@ def to_html(self, imports=True, html_frame=True):
diag = np.linalg.norm(ma-mi)
mean = (ma - mi) / 2 + mi
for r, obj in enumerate(self.__objects):
v = self.__objects[obj]["geometry"].attributes["position"].array
v -= mean
try:
v = self.__objects[obj]["geometry"].attributes["position"].array
v -= mean
except:
v = self.__objects[obj]["geometry"].positions
v -= mean


scale = self.__s["scale"] * (diag)
self._orbit.target = [0.0, 0.0, 0.0]
Expand Down Expand Up @@ -495,8 +500,12 @@ def to_html(self, imports=True, html_frame=True):

# Revert changes
for r, obj in enumerate(self.__objects):
v = self.__objects[obj]["geometry"].attributes["position"].array
v += mean
try:
v = self.__objects[obj]["geometry"].attributes["position"].array
v += mean
except:
v = self.__objects[obj]["geometry"].positions
v += mean
self.__update_view()

return s
Expand Down