Skip to main content

SVG2mesh

Generate finite element meshes from SVG-defined geometry.

SVG2mesh converts 2D geometries stored in SVG files into finite element meshes using Gmsh. The generated mesh can be exported to formats supported by MeshIO and used in finite element analysis and scientific computing workflows.

Features

  • Create FE meshes directly from SVG geometry
  • Mesh generation powered by Gmsh
  • Export meshes through MeshIO
  • Optional generation of periodic meshes
  • Export geometry preview as PNG

Installation

Requirements

  • Python 3.8+
  • NumPy
  • Gmsh
  • MeshIO
  • svgelements

Install from Source

git clone https://github.com/vlukes/svg2mesh.git
cd svg2mesh
pip install .

Install form PyPI

pip install svg2mesh

Usage

Basic Usage

svg2mesh geometry.svg

Specify Output File

svg2mesh geometry.svg -o mesh.vtk

Generate Unit Cell Mesh

svg2mesh geometry.svg -u

Generate Periodic Mesh

svg2mesh geometry.svg -p

Control Mesh Size

svg2mesh geometry.svg -s 0.05

Export PNG Preview

svg2mesh geometry.svg -e

Input Geometry

Each physical (material) group must be defined in a separate SVG group (layer). These groups are used to identify individual material regions in the generated mesh.

All SVG objects should be defined as paths, rectangles, circles or polygons.

Examples

Mesh1 -- multimaterial part

svg2mesh mesh1.svg -s 10

mesh1.png

Mesh2 -- single material part

svg2mesh mesh2.svg -s 5

mesh2.png

Mesh3 -- periodic unit cell

svg2mesh mesh3.svg -u -s "[10, 2]"

mesh3.png

License

SVG2mesh is distributed under the MIT License.

See the LICENSE file for details.

Metadata

Release files for SVG2mesh 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SVG2mesh 1.4.0
File Size Uploaded Provenance Actions
svg2mesh-1.4.0.tar.gz 8.4 kB Without provenance Details for svg2mesh-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SVG2mesh 1.4.0
File Interpreter ABI Platform Actions
svg2mesh-1.4.0-py3-none-any.whl Python 3 none any Details for svg2mesh-1.4.0-py3-none-any.whl

Total release size: 17.1 kB

Release files / svg2mesh-1.4.0.tar.gz

Download URL svg2mesh-1.4.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9d43f72f871fb58b6d3385e4f594a4ef1829242731b4125a0439defa39644181
BLAKE2b-256 checksum
How to use checksums
e4df6aae32a47a32f12994a43a0d8f236a39fa147d9b1c1508be59fecdc7f694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / svg2mesh-1.4.0-py3-none-any.whl

Download URL svg2mesh-1.4.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9d448039341fec7cfb653a70ee3a7db1e38752212b6140d2b508e31d3bf0ab8
BLAKE2b-256 checksum
How to use checksums
961493858747b734986d49f11ee29ee2ce8b3a2765eb58c3074236b57db425b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for SVG2mesh 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page