Thanks guys.
However - the presented solution got some shortcomings in respect to support for groups.
This following snippet is a pythonSOP that outputs a mix of polySplines and NURBS to maintain the point ordering.
In H11 hou.Face.positionAt could probably be used to sample nurbsCurves at the fillets to output a homogeneous polySpline. In H10 the SOP outputs a mix of polySplines and Nurbs. H10 requires a resampleSOP and fuse.
Inputs:
group (string)
optFillet (float)
optFit (float)
# This code is called when instances of this SOP cook.
geo = hou.pwd().geometry()
# Add code to modify the contents of geo.
grpParmValue = hou.evalParm('group').strip()
inputPoints = geo.points()
inputPnums = [ p.number() for p in inputPoints ]
nPoints = len( inputPoints )
grpParmValue = hou.evalParm('group').strip()
if len( grpParmValue ) == 0:
grpPoints = inputPoints
grpPoints = inputPnums
else:
grpPoints = geo.globPoints( grpParmValue )
grpPnums = [ p.number() for p in grpPoints ]
poly = geo.createPolygon()
poly.setIsClosed( False )
for n in range( 0, nPoints ):
if n == 0 or n == nPoints -1 or not n in grpPnums:
np = geo.createPoint()
np.setPosition( inputPoints[n].position() )
poly.addVertex( np )
else:
fillet = geo.createNURBSCurve( 4, False )
tmp = (( inputPoints[n].position() - inputPoints[ n-1].position() ) * 0.5 )
fillet.vertices()[0].point().setPosition( inputPoints[n].position() - tmp.normalized() * min(tmp.length(), hou.evalParm( 'optFillet' ) ) )
np = geo.createPoint( )
np.setPosition( fillet.vertices()[0].point().position() )
poly.addVertex( np )
fillet.vertices()[1].point().setPosition( inputPoints[n].position() - tmp.normalized() * min(tmp.length(), hou.evalParm( 'optFillet' ) ) * hou.evalParm( 'optFit' ) )
tmp = (( inputPoints[ n + 1 ].position() - inputPoints[n].position()) * 0.5 )
fillet.vertices()[2].point().setPosition( inputPoints[n].position() + tmp.normalized() * min(tmp.length(), hou.evalParm( 'optFillet' ) ) * hou.evalParm( 'optFit' ) )
fillet.vertices()[3].point().setPosition( inputPoints[n].position() + tmp.normalized() * min(tmp.length(), hou.evalParm( 'optFillet' ) ) )
poly = geo.createPolygon()
poly.setIsClosed( False )
np = geo.createPoint()
np.setPosition( fillet.vertices()[3].point().position() )
poly.addVertex( np )
geo.deletePoints( inputPoints )
Edited by rdg, 25 October 2010 - 09:53 PM.