You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a custom Geometry class for Polygon that would convert a shapely polygon to a geometry for phi flow, but I am getting a bit stuck on what methods and properties need to be implemented, my class is below:
Now when I try to plot a group of polygons I get the following error:
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis.py", line 385, in
subplots = {pos: _space(*fields, ignore_dims=animate, log_dims=log_dims, errs=[err[i] for i in indices[pos]]) for pos, fields in positioning.items()}
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis.py", line 498, in _space
for dim in get_default_limits(f, None, log_dims, e).vector.item_names:
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis_base.py", line 538, in get_default_limits
center = f.center
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/field/_field.py", line 133, in center
return slice_off_constant_faces(self._geometry.center, self._geometry.boundary_elements, self.extrapolation)
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/geom/_geom.py", line 99, in boundary_elements
raise NotImplementedError(self.class)
NotImplementedError: <class 'main.Polygon'>
Any help is greatly appreciated!
The text was updated successfully, but these errors were encountered:
Honestly just being able to pass a polygon to generate a geometry for use in phiflow would be fantastic, let me try to use mesh_from_numpy as you've shown above and see if that does the trick.
I'm trying to write a custom Geometry class for Polygon that would convert a shapely polygon to a geometry for phi flow, but I am getting a bit stuck on what methods and properties need to be implemented, my class is below:
Now when I try to plot a group of polygons I get the following error:
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis.py", line 385, in
subplots = {pos: _space(*fields, ignore_dims=animate, log_dims=log_dims, errs=[err[i] for i in indices[pos]]) for pos, fields in positioning.items()}
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis.py", line 498, in _space
for dim in get_default_limits(f, None, log_dims, e).vector.item_names:
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/vis/_vis_base.py", line 538, in get_default_limits
center = f.center
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/field/_field.py", line 133, in center
return slice_off_constant_faces(self._geometry.center, self._geometry.boundary_elements, self.extrapolation)
File "/Users/will/miniconda3/envs/grow/lib/python3.9/site-packages/phi/geom/_geom.py", line 99, in boundary_elements
raise NotImplementedError(self.class)
NotImplementedError: <class 'main.Polygon'>
Any help is greatly appreciated!
The text was updated successfully, but these errors were encountered: