Esempio n. 1
0
 def onDiskGlyph():
     result = segmentation.applyDiskGlyphs(pointCloudObj.polyData)
     obj = vis.showPolyData(result, 'disks', color=[0.8,0.8,0.8])
     om.setActiveObject(obj)
     pickedObj.setProperty('Visible', False)
Esempio n. 2
0
    numPoints = polyData.GetNumberOfPoints()

    polyData = segmentation.thresholdPoints(polyData, 'normals_valid', [1, 1])
    vis.showPolyData(polyData,
                     'cloud normals',
                     colorByName='curvature',
                     visible=True)

    print 'number of filtered points:', numPoints - polyData.GetNumberOfPoints(
    )

    if showGlyphs:
        polyData.GetPointData().SetNormals(
            polyData.GetPointData().GetArray('normals'))
        arrows = segmentation.applyArrowGlyphs(polyData, computeNormals=False)
        disks = segmentation.applyDiskGlyphs(polyData, computeNormals=False)
        polyData.GetPointData().SetNormals(None)

        vis.showPolyData(arrows, 'arrows')
        vis.showPolyData(disks, 'disks')

        #arrows2 = segmentation.applyArrowGlyphs(polyData)
        #vis.showPolyData(arrows2, 'arrows pcl normals')


def getMergedConvexHullsMesh(chulls):
    d = DebugData()
    for i, chull in enumerate(chulls):
        d.addPolyData(chull.convexHull, color=segmentation.getRandomColor())
    return d.getPolyData()
 def onDiskGlyph():
     result = segmentation.applyDiskGlyphs(pointCloudObj.polyData)
     obj = vis.showPolyData(result, 'disks', color=[0.8, 0.8, 0.8])
     om.setActiveObject(obj)
     pickedObj.setProperty('Visible', False)
    normalsValid = np.any(normals, axis=1)
    vnp.addNumpyToVtk(polyData, np.array(normalsValid, dtype=np.int32), 'normals_valid')

    vis.showPolyData(polyData, 'scene points', colorByName='normals_valid', visible=False)

    numPoints = polyData.GetNumberOfPoints()

    polyData = segmentation.thresholdPoints(polyData, 'normals_valid', [1, 1])
    vis.showPolyData(polyData, 'cloud normals', colorByName='curvature', visible=True)

    print 'number of filtered points:', numPoints - polyData.GetNumberOfPoints()

    if showGlyphs:
        polyData.GetPointData().SetNormals(polyData.GetPointData().GetArray('normals'))
        arrows = segmentation.applyArrowGlyphs(polyData, computeNormals=False)
        disks = segmentation.applyDiskGlyphs(polyData, computeNormals=False)
        polyData.GetPointData().SetNormals(None)

        vis.showPolyData(arrows, 'arrows')
        vis.showPolyData(disks, 'disks')

        #arrows2 = segmentation.applyArrowGlyphs(polyData)
        #vis.showPolyData(arrows2, 'arrows pcl normals')


def getMergedConvexHullsMesh(chulls):
    d = DebugData()
    for i, chull in enumerate(chulls):
        d.addPolyData(chull.convexHull, color=segmentation.getRandomColor())
    return d.getPolyData()