def segmentHoseNozzle(point1):

    inputObj = om.findObjectByName('pointcloud snapshot')
    polyData = inputObj.polyData

    searchRegion = cropToSphere(polyData, point1, 0.10)
    updatePolyData(searchRegion, 'nozzle search region', parent=getDebugFolder(), visible=False)

    xaxis = [1,0,0]
    yaxis = [0,-1,0]
    zaxis = [0,0,-1]
    origin = point1

    t = getTransformFromAxes(xaxis, yaxis, zaxis)
    t.PostMultiply()
    t.Translate(point1)

    nozzleRadius = 0.0266
    nozzleLength = 0.042
    nozzleTipRadius = 0.031
    nozzleTipLength = 0.024


    d = DebugData()
    d.addLine(np.array([0,0,-nozzleLength/2.0]), np.array([0,0,nozzleLength/2.0]), radius=nozzleRadius)
    d.addLine(np.array([0,0,nozzleLength/2.0]), np.array([0,0,nozzleLength/2.0 + nozzleTipLength]), radius=nozzleTipRadius)

    obj = showPolyData(d.getPolyData(), 'hose nozzle', cls=FrameAffordanceItem, color=[0,1,0], visible=True)
    obj.actor.SetUserTransform(t)
    obj.addToView(app.getDRCView())
    frameObj = showFrame(t, 'nozzle frame', parent=obj, visible=False)
    frameObj.addToView(app.getDRCView())

    params = dict(origin=origin, xaxis=xaxis, yaxis=yaxis, zaxis=zaxis, xwidth=0.1, ywidth=0.1, zwidth=0.1, friendly_name='firehose', otdf_type='firehose')
    obj.setAffordanceParams(params)
    obj.updateParamsFromActorTransform()
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/segmentHoseNozzle/original