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

Add support for visualizing 2D meshes as svg #560

Merged
merged 6 commits into from
Feb 13, 2021
Merged

Conversation

kinnala
Copy link
Owner

@kinnala kinnala commented Feb 13, 2021

This PR enables visualizing 2D meshes as SVG without matplotlib and its now used by default in a Jupyter notebook:
Kuvakaappaus - 2021-02-13 15-21-34

@kinnala kinnala merged commit c986540 into master Feb 13, 2021
@kinnala kinnala deleted the add-svg-mesh2d branch February 13, 2021 17:37
@gdmcbain
Copy link
Contributor

How does this compare with meshio.svg?

@kinnala
Copy link
Owner Author

kinnala commented Feb 14, 2021

Some points:

@gdmcbain
Copy link
Contributor

Thanks.

I didn't know about the rich display feature of notebooks; that is an enticing feature. I wonder whether _repr_javascript_ would extend that to something like femgl for three-dimensional meshes.

@gdmcbain
Copy link
Contributor

It might be possible to factor meshio.svg.write (over there) to construct the string and then write that string to a file, as we did here in skfem.io.meshio, but I see that that's partly hindered by mesho.svg.write using xml.etree.ElementTree.write which writes to ‘a file name, or a file object opened for writing’, although perhaps the latter could be an io.StringIO.

However, extension to ‘high-order meshes, curved boundaries, etc.’ I would think rather beyond meshio; I don't think there's enough common ground to support these features between mesh file formats.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants