Skip to content
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

Graphics3d breaking changes #1492

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 0 additions & 17 deletions mathics/builtin/box/graphics3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,6 @@ def calc_dimensions(final_pass=True):
light["target"][j] * boxscale[j] for j in range(3)
]

# Rescale viewpoint
self.viewpoint = [
vp * max([xmax - xmin, ymax - ymin, zmax - zmin])
for vp in self.viewpoint
]

w = 0 if (xmin is None or xmax is None) else xmax - xmin
h = 0 if (ymin is None or ymax is None) else ymax - ymin

Expand Down Expand Up @@ -363,9 +357,6 @@ def boxes_to_json(self, leaves=None, **options):

elements._apply_boxscaling(boxscale)

xmin, xmax, ymin, ymax, zmin, zmax, boxscale, w, h = calc_dimensions()
elements.view_width = w

# FIXME: json is the only thing we can convert MathML into.
# Handle other graphics formats.
format_fn = lookup_method(elements, "json")
Expand All @@ -384,14 +375,6 @@ def boxes_to_json(self, leaves=None, **options):
"ticks": ticks,
"ticks_style": js_ticks_style,
},
"extent": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just ignore it in the other side?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but why keep it there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. It will change and should. But not before the Mathics-Django release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good way to approach this is to start going over the API doc in mathics-threejs-backend review that and then come back here to make it match that specification.

But all of this is major API upheaval. I'd like to have at least one more stable release before that.

"xmin": xmin,
"xmax": xmax,
"ymin": ymin,
"ymax": ymax,
"zmin": zmin,
"zmax": zmax,
},
"lighting": self.lighting,
"viewpoint": self.viewpoint,
}
Expand Down