Skip to main content

ANYmesher

Structured meshing for shell and beam finite-element models described by ANYgeometry: edge seeding and local refinement, a built-in mapped (transfinite Coons) mesher, mapped-face decomposition, optional Gmsh meshing, geometry-to-mesh associations, quality metrics, a tkinter mesher and a command-line interface.

After the first package-index release, install with python -m pip install ANYmesher. Until then, use the editable development setup below.

The repository is ANYmesh, but anymesh was already taken on PyPI, so the distribution is ANYmesher and the import package is anymesher.

Quick start

A stiffened panel needs no geometry model:

import anymesher as am

panel = am.StiffenedPanel(
    length=4.0, width=3.0, plate_thickness=0.012,
    num_stiffeners=2, stiffener_spacing=1.0,
    stiffener_height=0.30, stiffener_web_thickness=0.010,
    stiffener_flange_width=0.150, stiffener_flange_thickness=0.015,
)
mesh = am.stiffened_panel_mesh(panel, am.PanelMeshConfig(
    shell_num_divisions_x=8, shell_num_divisions_y=6, beam_num_divisions=8,
))

mesh.num_nodes, len(mesh.quads), len(mesh.beams), len(mesh.couplings)
am.panel_edge_nodes(mesh)["x0"]          # the nodes on the x = 0 edge
am.verify_mesh_quality(mesh).max_aspect_ratio

Anything less regular goes through the shared geometry model:

import anygeometry as ag

model = ag.GeometryModel()
points = model.add_points([(0, 0, 0), (2, 0, 0), (2, 1, 0), (0, 1, 0)])
face = model.add_face(model.add_polyline(points, close=True))

am.punch_circular_hole(model, face, (1.0, 0.5, 0.0), 0.2)
mesh = am.generate_mesh(model, target_size=0.05, order="quadratic")
mesh.nodes_on(ag.EntityRef("edge", 3))   # still addressable after re-meshing

anymesher.geometry remains as a temporary compatibility import. Its classes are the exact ANYgeometry classes, not converted copies, but new code should import geometry directly from anygeometry.

Command line

anymesher panel --length 4 --width 3 --thickness 0.012 --height 0.3 --web-thickness 0.01 --divisions-x 8 --divisions-y 6

panel, plate, beam, quality and backends, each with --json. --output writes the mesh as JSON.

anymesher-gui opens the mesher: enter a panel, plate or beam, watch it re-mesh as you type, read the quality report, and save the result. It is deliberately not a geometry editor — building a BRep interactively is an application's job, and ANYfem already does it.

Applications can put that form behind their own mesh button. Passing a callback adds a Use mesh button and returns the neutral Mesh directly:

from anymesher.gui import open_mesher

window, mesher = open_mesher(root, on_apply=project.replace_mesh)

The host remains responsible for deciding whether a generic neutral mesh is appropriate for its structural model.

What a mesh is here

generate_mesh returns nodes, quadrilaterals, triangles, beams, coupling records, and the association back to the geometry: which node came from which vertex, which nodes lie along which edge, which elements belong to which face.

The association is the point. It is what lets a load or a restraint be named against geometry and survive a re-mesh, and what makes results addressable by the thing the user drew rather than by node number. Primitives fill the same fields against synthetic entity IDs, so a consumer needs one lookup path either way.

Backends

mapped (built in) gmsh ([gmsh] extra)
Structure structured grid per face unstructured
grid_of_face filled empty
Conformity by construction by gmsh
Elements quads only quads, with triangles where recombination cannot pair them
Curved faces meshed exactly refused — planar faces only
Eccentric beams supported not supported
am.generate_mesh(model, backend="gmsh", target_size=0.1)

The two are not interchangeable in what they guarantee, and the differences are recorded rather than smoothed over: an unstructured mesh has no (i, j) index, so that field is left empty instead of filled with something plausible. Planar boundaries may contain ANYgeometry straight lines, circular arcs or Bezier splines; Gmsh receives each as its corresponding exact curve primitive.

Hybrid strategy: Automatic, Mapped, or Native

generate_hybrid_mesh_result is the production shell/beam route. The strategy argument is explicit and is independent of the lower-level triangulator selector:

strategy Behaviour
"auto" Use mapped blocks where qualified; use native faces for the remainder. With structured_options, try the global structured plan first and use the recorded native fallback only when its actual mesh fails quality_v2.
"mapped" Require every selected face to become a qualified mapped block. Any unsupported partition or quality violation blocks the mesh.
"native" Require the unstructured face route. It cannot be combined with structured_options.
result = am.generate_hybrid_mesh_result(
    model,
    target_size=0.1,
    strategy="auto",                 # Automatic
    structured_options={},           # enable global structured planning
)

mapped = am.generate_hybrid_mesh(
    model,
    target_size=0.1,
    strategy="mapped",               # fail closed unless all faces map
    structured_options={},
)

native = am.generate_hybrid_mesh(
    model,
    target_size=0.1,
    strategy="native",
    native_backend="auto",           # compiled triangulator, else Python
)

Every call creates a detached structural closure. On that working copy, ANYmesher uses ANYgeometry's exact public intersection query/plan/apply workflow to connect crossing plates, beam ends and crossings, and beam/shell intersections. The editable source model is unchanged; published mesh associations are remapped to its original entity handles. Passing structural_preparation=False disables automatic relationship creation but still uses a detached clone.

Positive-area coplanar plate overlaps are never assigned to one plate implicitly. Meshing blocks with a diagnostic directing the user to the previewable, undoable Fragment Overlaps geometry command.

plan_structured_layout and apply_structured_layout are public detached preview/application APIs. commit_structured_layout is feature-gated: it is available only when the installed ANYgeometry exposes the exact FeatureHistory.adopt_frozen contract. The qualified base dependency remains ANYgeometry 0.2.2, so ordinary mesh generation never depends on that optional feature-history operation.

Native triangulation

Mapped/native face selection is separate from the triangulator used after a face has selected the native strategy. In 0.2.1, omitted native_backend and planar backend arguments default to "auto": an explicitly registered boundary is preferred, then the built-in compiled boundary, with the deterministic Python reference used only when native capability is absent.

Use "python" to require the compatibility/reference implementation and "native" to require compiled capability without fallback. Import or execution failure from a present but corrupt extension is reported; it is never treated as ordinary absence. ANYfem format 6 persists this selector explicitly, while its format 1-5 migration writes "python" so old projects retain their behavior.

Design notes

One shared geometry authority. ANYmesher never converts a geometry model. It consumes the same GeometryModel and EntityRef objects that applications use for selections and attributes, then records associations to their stable IDs.

Conformity by construction. Node generation order is fixed: one node per used vertex, then n - 1 interior nodes per edge in the edge's own direction, then face interior nodes from the Coons blend. Neighbouring faces look their boundary nodes up from the same registries, so they share the very same nodes. The alternative — meshing faces independently and merging coincident nodes within a tolerance — fails quietly on nearly-coincident geometry and produces a mesh that looks connected and is not.

Coupling records, not constraints. When a stiffener stands off the plating, the mesher records per beam node: the shell element it projects into, the shape weights at that point, and the eccentricity vector. That is a statement about geometry. Deciding it becomes six multi-point constraints is the consuming solver's business. Interpolating through the shape functions is what removes the older requirement that a beam node lie on a shell node row, so the mesh no longer has to be aligned to the stiffeners for the coupling to be exact.

Numbering is a contract. A consumer stores results per node and element ID, so a renumbering that is mathematically irrelevant still invalidates its baselines. The primitives number shell nodes from 1, beam nodes from 10000, beam elements from 20000 and couplings from 30000; the mapped mesher numbers by registry order. Both are documented where they are implemented and asserted by test.

See docs/ARCHITECTURE.md for the layering, and MIGRATION.md for what was extracted from where.

Scope

Out of scope: geometry ownership, elements, materials, assembly and solution. General splitting, trimming, projection, transforms and intersections belong to ANYgeometry. check_mappable, triangle_to_quads and the four-patch butterfly hole decomposition stay here because they exist specifically for mapped quads. The production generate_hybrid_mesh workflow uses ANYgeometry's qualified intersection operations on an immutable working closure; it does not introduce a second geometry kernel or weld nodes by proximity. The older generate_mesh_with_intersections name remains only as a deprecated migration seam for historical models and is never selected automatically. The legacy anymesher.split_face_at, split_face_between and strip_face imports likewise retain their mapped-partition semantics; new neutral geometry code should import the general edit operations from anygeometry. Writing a mesh to a .fem or .inp file belongs to ANYfileio, which depends on this package — so the arrow cannot point back. The JSON in anymesher.serialize is the mesh container written out as itself, not an interchange format.

Units

SI throughout, lengths in m. There is no conversion layer. The mesher window accepts mm because that is how plate and profile dimensions are quoted, and converts at the widget.

Development

python -m pip install --no-deps -e C:\Github\ANYgeometry
python -m pip install -e "C:\Github\ANYmesh[dev,gmsh]"
python -m pytest

To open the mesher straight from a checkout — including an IDE's Run button, with nothing installed — run run_gui.py at the repository root.

python run_gui.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anymesher-0.2.5.tar.gz (258.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

anymesher-0.2.5-cp314-cp314-win_amd64.whl (441.4 kB view details)

Uploaded CPython 3.14Windows x86-64

anymesher-0.2.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (777.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

anymesher-0.2.5-cp314-cp314-macosx_11_0_arm64.whl (249.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

anymesher-0.2.5-cp313-cp313-win_amd64.whl (433.5 kB view details)

Uploaded CPython 3.13Windows x86-64

anymesher-0.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (777.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

anymesher-0.2.5-cp313-cp313-macosx_11_0_arm64.whl (249.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

anymesher-0.2.5-cp312-cp312-win_amd64.whl (433.5 kB view details)

Uploaded CPython 3.12Windows x86-64

anymesher-0.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (777.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

anymesher-0.2.5-cp312-cp312-macosx_11_0_arm64.whl (249.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

anymesher-0.2.5-cp311-cp311-win_amd64.whl (433.4 kB view details)

Uploaded CPython 3.11Windows x86-64

anymesher-0.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (778.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

anymesher-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (247.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file anymesher-0.2.5.tar.gz.

File metadata

  • Download URL: anymesher-0.2.5.tar.gz
  • Upload date:
  • Size: 258.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anymesher-0.2.5.tar.gz
Algorithm Hash digest
SHA256 400d289281dc68598d24d56d0ca3bbc3c6343d12ae291d52ff42ff7ee5c55f6f
MD5 655c857c93e2027696da79e83becb300
BLAKE2b-256 0b1c1977fb906de0b13011573d152fa94b810bf1b0bf5b619ebe695ae75532d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5.tar.gz:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: anymesher-0.2.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 441.4 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anymesher-0.2.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1152efecb94fa9bcdc7aaccff167178f41b2c700220dd3e3aa9e00fbcc41d381
MD5 98f5cda72e62142c393efed904d69523
BLAKE2b-256 e82c805a3e1a0ea9c0ca9b68f9316e4f9e6bb4768d834c88f2d2812e55aa4e1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp314-cp314-win_amd64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7215b88e6174418545be746af15f64fc4977946f4ca472297ab9a0662372b5e
MD5 baf51b81dfde2c78bdf1fde3fda6e3e4
BLAKE2b-256 bf27657bb58fec4d6c2c25c7667011b178e9946abc365cff611fe5a739c8f9c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21fae2359b18ba0676c5427a0e76c20378f9b4f2423d214b10d64a9340f1bca4
MD5 6961425f9f87055f55654bb912bebd73
BLAKE2b-256 f9ef416bd39ecab6ab7820312f3522adb70a9c433fbff0245f612b7fa1636d64

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: anymesher-0.2.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 433.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anymesher-0.2.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8a4fbd499582b13edf6445e9f74cbad7512b08fe189dfbaed8e8450194719142
MD5 a81b41b4167d857914cdf7bd60db3ae9
BLAKE2b-256 13c862d30e54da4ee3ca05e0ac45f616a675794d4da2f65ace20e4c0d958993a

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ba71e57f80d5b2933d83405693ee26f26acd8e5b623f65e0616778cb0eff98cf
MD5 56ccbc12e6d03f42ab08498406aa3806
BLAKE2b-256 992146509cb5ae077ec443501ad7336354f9e5ccaf618e23b7896b67b4ca5fda

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f97c4dac9cdd5561a3d38aafba2bbacd77e6f0a0e88a25786cf82cd029cc4840
MD5 0b65d5e4d3f0ea405e0594c808f856b3
BLAKE2b-256 ee9a07a92f9b71541bd25c9b69b6658f96f6881987b7eb26c2cd1acbb07e4fe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: anymesher-0.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 433.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anymesher-0.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b47b047e3e0e581f822d5c287816611b9457c92a7cdfba11b654c444152205d9
MD5 bf298356fe7aa04fb1499e683fba7200
BLAKE2b-256 dfe853f69315de81fda7953faf5a0fe69bbe74ad91d2241c14380db0f5583748

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4c6ab78be9b9d2d9767c393047bc2e9f4ba6bbcfd7bb1ab11ec001d7a96c971b
MD5 1f15ad8450f637b30f99298de2a15e65
BLAKE2b-256 ce9fa420c447c0c25c96a106e8dfb6f84eca0d02c0d431bf072d711a7148a092

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65321d82272daed496f8e01be9bdbd611804f72ed609623b21e1434fe3a9e9e9
MD5 af00f1c1ba4dca5ea26f48ebc5a70f79
BLAKE2b-256 6f3697c01c98318e7667333f0ebb8f621983750cd7968dd9d3f121a0a7921351

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: anymesher-0.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 433.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anymesher-0.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d564c94142a1e87ce5a8750380c898a164eaad76ec4de1c0f49975368251054e
MD5 9ac168176675091d270d480ae8b72cb4
BLAKE2b-256 22dff896869d61f1f66664bd0a1436dcfb311e255d1492be03ac2519bc35b370

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91bffb8b7916499cd0a59c47d30513b6d0070a423b6e8d8cf5fa4b02791540ff
MD5 ca35189b4119ecfb46e791a478c874a1
BLAKE2b-256 50847554928f5259e465ddfb85d1d116ac2d98f8a95b82cb21d4640f4e04e12b

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anymesher-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anymesher-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a404b481877ff30ab939c07e5c1e04256c81d903e304256798d5e1b932ecdbc4
MD5 cf3059c6cb184004904ed1e227c7b392
BLAKE2b-256 0cf0c266224e44b301c6b65e068770911f5a1dcd6332c118370666295978d4b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for anymesher-0.2.5-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on audunarn/ANYmesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.1

13 files

0.3.0

13 files

This release

0.2.5 This release

13 files

0.2.3

13 files

0.2.1

2 files

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