Giter VIP home page Giter VIP logo

pyiges's Introduction

pyIGES

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,

pyiges's People

Contributors

akaszynski avatar banesullivan avatar mikamove avatar robertoost avatar tormodlandet avatar pre-commit-ci[bot] avatar alejandrofernandezluces avatar germa89 avatar henrikheien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.