Skip to main content

Pythonic IGES reader

Project description

Python IGES reader with basic functionality to read an IGES file and convert some entities to a pyvista or vtk mesh.

This module can read in and perform basic parsing of all entities and can perform additional parsing and geometry visualization of the following entities:

  • Vertex List (Type 502 Form 1)

  • Edge List

  • Loop (for specifying a bounded face for BREP geometries

  • Face

  • Circular arc

  • Rational B-Spline Surface

  • Rational B-Spline Curve

  • Conic Arc (Type 104)

  • Line

  • Point

Installation

pyiges is offered in a “full” variant including the conversion features and a “pure” parsing module variant. The pure variant has no conversion features, no dependencies to pyvista,geomdl, and can be installed by removing the [full] specificator from the following commands.

Install with pip using:

pip install pyiges[full]

Otherwise, if you want the bleeding edge version, feel free to clone this repo and install with:

git clone https://github.com/pyvista/pyiges
cd pyiges
pip install .[full]

Note that the square brackets might need to be escaped or quoted when using zsh.

Usage

The pyiges module can read in many entities as raw text, but only NURBS surfaces and bsplines can be converted to pyvista meshes.

import pyiges
from pyiges import examples

# load an example impeller
iges = pyiges.read(examples.impeller)

# print an invidiual entity (boring)
print(iges[0])

# convert all lines to a vtk mesh and plot it
lines = iges.to_vtk(bsplines=True, surfaces=False, merge=True)
lines.plot(color='w', line_width=2)

# convert all surfaces to a vtk mesh and plot it
mesh = iges.to_vtk(bsplines=False, surfaces=True, merge=True, delta=0.05)
mesh.plot(color='w', smooth_shading=True)
# control resolution of the mesh by changing "delta"

# save this surface to file
mesh.save('mesh.ply')  # as ply
mesh.save('mesh.stl')  # as stl
mesh.save('mesh.vtk')  # as vtk

Lines

https://github.com/pyvista/pyiges/raw/main/docs/images/impeller_lines.png

Surfaces

https://github.com/pyvista/pyiges/raw/main/docs/images/impeller_surf.png

Acknowledgments

Substantial code was obtained from or inspired by https://github.com/cfinch/IGES-File-Reader

IGES reference definitions were obtained from Eclipse IGES Wiki,

Project details


Download files

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

Source Distribution

pyiges-0.3.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

pyiges-0.3.3-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file pyiges-0.3.3.tar.gz.

File metadata

  • Download URL: pyiges-0.3.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyiges-0.3.3.tar.gz
Algorithm Hash digest
SHA256 f591a59cd5eea94567f487147b1b7277b72439776dc40c1d4cabc4d821cb57d5
MD5 a72e44a0a24c88a23b334fba03f32c77
BLAKE2b-256 b80215bc62beba785e84a77783998c32f12eff71cef4c19c609f602b11418a82

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyiges-0.3.3.tar.gz:

Publisher: testing-and-deployment.yml on pyvista/pyiges

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

File details

Details for the file pyiges-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pyiges-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyiges-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a51cfc6a01416f4bbfb3bd4de75d7c2b680fc826068689b0bda1ae662177ec58
MD5 570fa43a00ab6fb40dd011562a782091
BLAKE2b-256 1033cf2d509926fd31a0d486340c896a1b08af67fcad406dcd541ec20a14851f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyiges-0.3.3-py3-none-any.whl:

Publisher: testing-and-deployment.yml on pyvista/pyiges

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page