Geometry Entities¶
The pyiges.Iges
class stores each individual IGES entity
seperately and each entity of an pyiges.Iges
object can be
accessed either via indexing or by querying for a specific type of entity
>>> import pyiges
>>> from pyiges import examples
>>> iges = pyiges.read(examples.impeller)
>>> type(iges[0])
pyiges.entity.Entity
>>> lines = iges.lines()
>>> print(lines[0])
--- Line ---
----- Entity -----
110
1213
0
...
0
From point 0.0, 0.0, -997.963013157
To point 0.0, 0.0, 2.036986843
Many of the entities are not yet fully supported, and those entities
are represented as a generic pyiges.geometry.Entity
object.
However, many entities are supported, including:
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
Entity Definitions¶
-
class
pyiges.entity.
Entity
(iges)¶ Generic IGES entity
Examples
>>> import pyiges >>> from pyiges import examples >>> iges = pyiges.read(examples.impeller) >>> entity = iges[0] >>> entity.parameters [['314', '75.2941176470588', '75.2941176470588', '75.2941176470588', '']]
>>> print(entity) ----- Entity ----- 314 1 0 Default 0 None None 0 200 0 8 1 0
-
class
pyiges.geometry.
Point
(iges)¶ IGES Point
-
property
coordinate
¶ Coordinate of the point as a numpy array
-
to_vtk
()¶ Point represented as a
pyvista.PolyData
Mesh- Returns
mesh –
pyvista
mesh- Return type
pyvista.PolyData
-
property
x
¶ X coordinate
-
property
y
¶ Y coordinate
-
property
z
¶ Z coordinate
-
property
-
class
pyiges.geometry.
Line
(iges)¶ IGES Straight line segment
-
property
coordinates
¶ Starting and ending point of the line as a
numpy
array
-
to_vtk
(resolution=1)¶ Line represented as a
pyvista.PolyData
Mesh- Returns
mesh –
pyvista
mesh- Return type
pyvista.PolyData
-
property
-
class
pyiges.geometry.
ConicArc
(iges)¶ Conic Arc (Type 104) Arc defined by the equation:
A*x**2 + B*x*y + C*y**2 + D*x + E*y + F = 0
with a Transformation Matrix (Entity 124). Can define an ellipse, parabola, or hyperbola.
-
class
pyiges.geometry.
RationalBSplineCurve
(iges)¶ Rational B-Spline Curve IGES Spec v5.3 p. 123 Section 4.23 See also Appendix B, p. 545
-
to_vtk
(delta=0.01)¶ Set evaluation delta (controls the number of curve points)
-
-
class
pyiges.geometry.
RationalBSplineSurface
(iges)¶ Rational B-Spline Surface
Examples
>>> import pyiges >>> from pyiges import examples >>> iges = pyiges.read(examples.impeller) >>> bsurfs = igs.bspline_surfaces() >>> bsurf = bsurfs[0] >>> print(bsurf) Rational B-Spline Surface Upper index of first sum: 3 Upper index of second sum: 3 Degree of first basis functions: 3 Degree of second basis functions: 3 Open in the first direction Open in the second direction Polynomial Periodic in the first direction Periodic in the second direction Knot 1: [0. 0. 0. 0. 1. 1. 1. 1.] Knot 2: [0. 0. 0. 0. 1. 1. 1. 1.] u0: 1.000000 u1: 0.000000 v0: 1.000000 v1: 128.000000 Control Points: 16
>>> bsurf.control_points array([[-26.90290533, -16.51153913, -8.87632351], [-25.85182035, -15.86644037, -21.16779478], [-25.99572556, -15.95476156, -33.51982653], [-27.33276363, -16.77536276, -45.77299513], [-28.23297477, -14.34440426, -8.87632351], [-27.12992455, -13.78397453, -21.16779478], [-27.28094438, -13.86070358, -33.51982653], [-28.6840851 , -14.57360111, -45.77299513], [-29.29280315, -12.03305788, -8.87632351], [-28.14834588, -11.56293146, -21.16779478], [-28.3050348 , -11.62729699, -33.51982653], [-29.76084756, -12.22532372, -45.77299513], [-30.06701039, -9.61104189, -8.87632351], [-28.89230518, -9.2355426 , -21.16779478], [-29.05313537, -9.28695263, -33.51982653], [-30.54742519, -9.76460843, -45.77299513]])
-
control_points
()¶ Control points
-
property
flag1
¶ Closed in the first direction
-
property
flag2
¶ Closed in the second direction
-
property
flag3
¶ Polynominal
False
- rationalTrue
- polynomial
-
property
flag4
¶ First direction periodic
-
property
flag5
¶ Second direction Periodic
-
property
k1
¶ Upper index of first sum
-
property
k2
¶ Upper index of second sum
-
property
knot1
¶ First Knot Sequences
-
property
knot2
¶ Second Knot Sequences
-
property
m1
¶ Degree of first basis functions
-
property
m2
¶ Degree of second basis functions
-
to_geomdl
()¶ Return a
geommdl.BSpline.Surface
-
to_vtk
(delta=0.025)¶ Return a pyvista.PolyData Mesh
- Parameters
delta (float, optional) – Resolution of the surface. Higher number result in a denser mesh at the cost of compute time.
- Returns
mesh –
pyvista
mesh- Return type
pyvista.PolyData
Examples
>>> mesh = bsurf.to_vtk() >>> mesh.plot()
-
property
u0
¶ Start first parameter value
-
property
u1
¶ End first parameter value
-
property
v0
¶ Start second parameter value
-
property
v1
¶ End second parameter value
-
property
weights
¶ First Knot Sequences
-
-
class
pyiges.geometry.
CircularArc
(iges)¶ Circular Arc
Type 100: Simple circular arc of constant radius. Usually defined with a Transformation Matrix Entity (Type 124).
-
to_vtk
(resolution=20)¶ Circular arc represented as a
pyvista.PolyData
Mesh- Returns
mesh –
pyvista
mesh- Return type
pyvista.PolyData
-
-
class
pyiges.geometry.
Face
(iges)¶ Defines a bound portion of three dimensional space (R^3) which has a finite area. Used to construct B-Rep Geometries.
-
class
pyiges.geometry.
EdgeList
(iges)¶ Provides a list of edges, comprised of vertices, for specifying B-Rep Geometries.
-
class
pyiges.geometry.
VertexList
(iges)¶ Vertex List (Type 502 Form 1)