Added boundary dressup to restrict path to another shape.

This commit is contained in:
Markus Lampert
2019-11-01 17:37:07 -07:00
parent 17b2cf2e96
commit d0e16a58ef
8 changed files with 612 additions and 6 deletions

View File

@@ -68,15 +68,19 @@ def isSolid(obj):
shape = Part.getShape(obj)
return not shape.isNull() and shape.Volume and shape.isClosed()
def opProperty(op, prop):
'''opProperty(op, prop) ... return the value of property prop of the underlying operation (or None if prop does not exist)'''
if hasattr(op, prop):
return getattr(op, prop)
if hasattr(op, 'Base'):
return opProperty(op.Base, prop)
return None
def toolControllerForOp(op):
'''toolControllerForOp(op) ... return the tool controller used by the op.
If the op doesn't have its own tool controller but has a Base object, return its tool controller.
Otherwise return None.'''
if hasattr(op, 'ToolController'):
return op.ToolController
if hasattr(op, 'Base'):
return toolControllerForOp(op.Base)
return None
return opProperty(op, 'ToolController')
def getPublicObject(obj):
'''getPublicObject(obj) ... returns the object which should be used to reference a feature of the given object.'''