pyg4ometry.features.algos

Classes

Line

Line class taking a point and dir(ection)

Plane

Plane class taking a point on plane and normal

CoordinateSystem

vtkViewer

Simple visualiser for feature extraction only

FeatureData

Functions

vtkLoadStl(fname)

Load the given STL file, and return a vtkPolyData object for it.

vtkPolydataToActor(polydata)

Wrap the provided vtkPolyData object in a mapper and an actor, returning the actor.

vtkPolydataToConnectedEdges(polydata[, angle])

_vtkPolydataToConnectedEdges(polydata[, angle])

Feature extract from polydata given an angular cut

vtkPolydataEdgeInformation(polydata[, bPlot])

Calculate path information for 2D vtkPolydata lines

_vtkPolydataEdgeInformation(polydata[, bPlot])

Calculate path information for 2D vtkPolydata lines

pyg4PlaneToVtkPlane(pyg4Plane)

Convert Plane to vtkPlane

pyg4ArrayToVtkPolydataLine(pyg4Array)

Convert data array to vtkPolydata

vtkCutterPlane(plane, polydata)

Calculate path information for 2D vtkPolydata lines

_vtkCutterPlane(plane, polydata)

Cutter plane on polydata

extract(inputFileName[, angle, planeQuality, ...])

test(fileName[, featureIndexList, planeQuality, ...])

Module Contents

class pyg4ometry.features.algos.Line(point, dir)

Line class taking a point and dir(ection)

Parameters:

dir (list or array - 3 values) – direction

point
dir
eval(par)
intersectPlane(plane)

Intersection of line (self) with plane (unimplemented)

Parameters:

plane (Plane) – plane object

Returns:

Point of intersection between plane and line

Return type:

list or array

__repr__()
__iter__()
__next__()
flatten()
class pyg4ometry.features.algos.Plane(point, normal, e2=None, e3=None)

Plane class taking a point on plane and normal

Parameters:
  • point (list, array) – point on plane

  • normal (list, array) – vector of normal

point
normal
intersect(object)

Intersection between Line or Plane

Parameters:

object (Line or Plane) – Object to intersect with Plane (either Line or Plane)

intersectLine(line)

Intersection between plane (self) and line

intersectPlane(plane)

Compute intersection between two planes self and plane

angleBetween(plane)

Compute angle between two planes (self and plane)

Parameters:

plane (Plane) – Plane to intersect with self

Returns:

angle between two planes

Return type:

float

__repr__()
__iter__()
__next__()
flatten()
class pyg4ometry.features.algos.CoordinateSystem(origin=[0, 0, 0], e1=[1, 0, 0], e2=[0, 1, 0])
origin
e1
e2
_commonInit()
makeFromPlanes(p1, p2, p3)
coordinateSystem(rotX=0.0, rotY=0.0, rotZ=0.0)
plane(rotX=0.0, rotY=0.0, rotZ=0.0)
transform(points)
__repr__()
class pyg4ometry.features.algos.vtkViewer

Simple visualiser for feature extraction only

polydataD
mapperD
actorD
ren
renWin
iren
style
_polyDataToActor(polydata, colour=[0, 0, 0, 1], lineWidth=5)

Wrap the provided vtkPolyData object in a mapper and an actor, returning the actor.

addPolydata(key, polydata, colour=[0, 0, 0, 1], lineWidth=5, label=None, labelPos=[0, 0, 0])
addAxis(origin, length=[1, 1, 1], rotation=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], label=False, disableCone=False)
addPlane(point, p1, p2, length=1)
addLine(line)
view(interactive=True)
pyg4ometry.features.algos.vtkLoadStl(fname)

Load the given STL file, and return a vtkPolyData object for it.

pyg4ometry.features.algos.vtkPolydataToActor(polydata)

Wrap the provided vtkPolyData object in a mapper and an actor, returning the actor.

pyg4ometry.features.algos.vtkPolydataToConnectedEdges(polydata, angle=89)
pyg4ometry.features.algos._vtkPolydataToConnectedEdges(polydata, angle=89)

Feature extract from polydata given an angular cut

Parameters:

angle (float) – Angle between plane > angle is returned

Returns:

Connected boundaries with > angle

Return type:

list of vtkPolydata

pyg4ometry.features.algos.vtkPolydataEdgeInformation(polydata, bPlot=False)

Calculate path information for 2D vtkPolydata lines

Parameters:

polydata (vtkPlydata or list of vtkPolydata) – Geometry to extract information

Returns:

Information on each boundary

Return type:

list of information dict

pyg4ometry.features.algos._vtkPolydataEdgeInformation(polydata, bPlot=False)

Calculate path information for 2D vtkPolydata lines

pyg4ometry.features.algos.pyg4PlaneToVtkPlane(pyg4Plane)

Convert Plane to vtkPlane

pyg4ometry.features.algos.pyg4ArrayToVtkPolydataLine(pyg4Array)

Convert data array to vtkPolydata

pyg4ometry.features.algos.vtkCutterPlane(plane, polydata)

Calculate path information for 2D vtkPolydata lines

Parameters:

polydata (vtkPlydata or list of vtkPolydata) – Geometry to extract information

Returns:

Information on each boundary

Return type:

list of information dict

pyg4ometry.features.algos._vtkCutterPlane(plane, polydata)

Cutter plane on polydata

pyg4ometry.features.algos.extract(inputFileName, angle=89, planeQuality=0.1, circumference=300, outputFileName=None, planes=[], bViewer=False, bViewerInteractive=False)
class pyg4ometry.features.algos.FeatureData
features = []
cutters = []
readFile(fileName)
plotFeature(iFeature)
plotCutter(iCutter)
pyg4ometry.features.algos.test(fileName, featureIndexList=[], planeQuality=0.1, circumference=300, bPlotRadii=False)