-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Hi,
I was trying to use the Jupyter Notebook tutorial you provide in the examples folder.
The data.npz file is correctly loaded, but the execution of the mp.ploy(v,f) command end with the following error ValueError: Out of range float values are not JSON compliant, raised when the OrbitControls are created by the Viewer.
I also report the whole stack trace below.
How can this error be solved?
Thank you in advance!
ValueError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_6436/3157376963.py in
----> 1 mp.plot(v, f)
~\miniconda3\envs\meshplot\lib\site-packages\meshplot\plot.py in plot(v, f, c, uv, n, shading, plot, return_plot, filename, texture_data)
79 def plot(v, f=None, c=None, uv=None, n=None, shading={}, plot=None, return_plot=True, filename="", texture_data=None):#, return_id=False):
80 if not plot:
---> 81 view = Viewer(shading)
82 else:
83 view = plot
~\miniconda3\envs\meshplot\lib\site-packages\meshplot\Viewer.py in init(self, settings)
16 self._cam = p3s.PerspectiveCamera(position=[0, 0, 1], lookAt=[0, 0, 0], fov=self.__s["fov"],
17 aspect=self.__s["width"]/self.__s["height"], children=[self._light])
---> 18 self._orbit = p3s.OrbitControls(controlling=self._cam)
19 self._scene = p3s.Scene(children=[self._cam, self._light2], background=self.__s["background"])#"#4c4c80"
20 self._renderer = p3s.Renderer(camera=self._cam, scene = self._scene, controls=[self._orbit],
~\miniconda3\envs\meshplot\lib\site-packages\pythreejs\controls\OrbitControls_autogen.py in init(self, controlling, **kwargs)
27 def init(self, controlling=None, **kwargs):
28 kwargs['controlling'] = controlling
---> 29 super(OrbitControls, self).init(**kwargs)
30
31 _model_name = Unicode('OrbitControlsModel').tag(sync=True)
~\miniconda3\envs\meshplot\lib\site-packages\pythreejs\controls\Controls_autogen.py in init(self, **kwargs)
28
29 def init(self, **kwargs):
---> 30 super(Controls, self).init(**kwargs)
31
32 _model_name = Unicode('ControlsModel').tag(sync=True)
~\miniconda3\envs\meshplot\lib\site-packages\pythreejs_base\Three.py in init(self, **kwargs)
15
16 def init(self, **kwargs):
---> 17 super(ThreeWidget, self).init(**kwargs)
18 self.on_msg(self._on_potential_ret_val)
19
~\miniconda3\envs\meshplot\lib\site-packages\ipywidgets\widgets\widget.py in init(self, **kwargs)
413
414 Widget._call_widget_constructed(self)
--> 415 self.open()
416
417 def del(self):
~\miniconda3\envs\meshplot\lib\site-packages\ipywidgets\widgets\widget.py in open(self)
436 args['comm_id'] = self._model_id
437
--> 438 self.comm = Comm(**args)
439
440 @observe('comm')
~\miniconda3\envs\meshplot\lib\site-packages\ipykernel\comm\comm.py in init(self, target_name, data, metadata, buffers, **kwargs)
55 if self.primary:
56 # I am primary, open my peer.
---> 57 self.open(data=data, metadata=metadata, buffers=buffers)
58 else:
59 self._closed = False
~\miniconda3\envs\meshplot\lib\site-packages\ipykernel\comm\comm.py in open(self, data, metadata, buffers)
89 comm_manager.register_comm(self)
90 try:
---> 91 self._publish_msg('comm_open',
92 data=data, metadata=metadata, buffers=buffers,
93 target_name=self.target_name,
~\miniconda3\envs\meshplot\lib\site-packages\ipykernel\comm\comm.py in publish_msg(self, msg_type, data, metadata, buffers, **keys)
64 metadata = {} if metadata is None else metadata
65 content = json_clean(dict(data=data, comm_id=self.comm_id, **keys))
---> 66 self.kernel.session.send(self.kernel.iopub_socket, msg_type,
67 content,
68 metadata=json_clean(metadata),
~\miniconda3\envs\meshplot\lib\site-packages\jupyter_client\session.py in send(self, stream, msg_or_type, content, parent, ident, buffers, track, header, metadata)
828 if self.adapt_version:
829 msg = adapt(msg, self.adapt_version)
--> 830 to_send = self.serialize(msg, ident)
831 to_send.extend(buffers)
832 longest = max([len(s) for s in to_send])
~\miniconda3\envs\meshplot\lib\site-packages\jupyter_client\session.py in serialize(self, msg, ident)
702 content = self.none
703 elif isinstance(content, dict):
--> 704 content = self.pack(content)
705 elif isinstance(content, bytes):
706 # content is already packed, as in a relayed message
~\miniconda3\envs\meshplot\lib\site-packages\jupyter_client\session.py in json_packer(obj)
93
94 def json_packer(obj):
---> 95 return jsonapi.dumps(
96 obj,
97 default=json_default,
~\miniconda3\envs\meshplot\lib\site-packages\zmq\utils\jsonapi.py in dumps(o, **kwargs)
23 Keyword arguments are passed along to :py:func:json.dumps.
24 """
---> 25 return json.dumps(o, **kwargs).encode("utf8")
26
27
~\miniconda3\envs\meshplot\lib\json_init.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
232 if cls is None:
233 cls = JSONEncoder
--> 234 return cls(
235 skipkeys=skipkeys, ensure_ascii=ensure_ascii,
236 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
~\miniconda3\envs\meshplot\lib\json\encoder.py in encode(self, o)
197 # exceptions aren't as detailed. The list call should be roughly
198 # equivalent to the PySequence_Fast that ''.join() would do.
--> 199 chunks = self.iterencode(o, _one_shot=True)
200 if not isinstance(chunks, (list, tuple)):
201 chunks = list(chunks)
~\miniconda3\envs\meshplot\lib\json\encoder.py in iterencode(self, o, _one_shot)
255 self.key_separator, self.item_separator, self.sort_keys,
256 self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)
258
259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
ValueError: Out of range float values are not JSON compliant