fix for drilling in Compound objects.
Better check of hole face ordering.
This commit is contained in:
parent
fe11942afb
commit
18ea91cc25
|
@ -189,15 +189,26 @@ class ObjectDrilling:
|
||||||
drillable = False
|
drillable = False
|
||||||
if obj.ShapeType == 'Vertex':
|
if obj.ShapeType == 'Vertex':
|
||||||
drillable = True
|
drillable = True
|
||||||
elif obj.ShapeType == 'Solid':
|
elif obj.ShapeType in['Solid', 'Compound']:
|
||||||
if sub[0:4] == 'Face':
|
if sub[0:4] == 'Face':
|
||||||
subobj = obj.getElement(sub)
|
subobj = obj.getElement(sub)
|
||||||
if isinstance(subobj.Edges[0].Curve, Part.Circle):
|
if isinstance(subobj.Edges[0].Curve, Part.Circle):
|
||||||
drillable = True
|
drillable = True
|
||||||
if str(subobj.Surface) == "<Cylinder object>":
|
if str(subobj.Surface) == "<Cylinder object>":
|
||||||
drillable = True
|
drillable = True
|
||||||
if len(subobj.Edges[0].Vertexes) > 1:
|
if len(subobj.Edges) == 3:
|
||||||
drillable = False
|
cedge = []
|
||||||
|
ledge = []
|
||||||
|
for e in subobj.Edges:
|
||||||
|
if isinstance (e.Curve, Part.Circle):
|
||||||
|
cedge.append(e)
|
||||||
|
elif isinstance (e.Curve, Part.Line):
|
||||||
|
ledge.append(e)
|
||||||
|
if len(cedge) == 2 and len(ledge) == 1:
|
||||||
|
drillable = True
|
||||||
|
else:
|
||||||
|
#if len(subobj.Edges[0].Vertexes) > 1:
|
||||||
|
drillable = False
|
||||||
if sub[0:4] == 'Edge':
|
if sub[0:4] == 'Edge':
|
||||||
o = obj.getElement(sub)
|
o = obj.getElement(sub)
|
||||||
if isinstance(o.Curve, Part.Circle) and len(o.Vertexes) == 1:
|
if isinstance(o.Curve, Part.Circle) and len(o.Vertexes) == 1:
|
||||||
|
|
|
@ -100,7 +100,7 @@ class DRILLGate:
|
||||||
return False
|
return False
|
||||||
if obj.ShapeType == 'Vertex':
|
if obj.ShapeType == 'Vertex':
|
||||||
drillable = True
|
drillable = True
|
||||||
elif obj.ShapeType == 'Solid':
|
elif obj.ShapeType in['Solid', 'Compound']:
|
||||||
if sub[0:4] == 'Face':
|
if sub[0:4] == 'Face':
|
||||||
subobj = obj.getElement(sub)
|
subobj = obj.getElement(sub)
|
||||||
drillable = isinstance(subobj.Edges[0].Curve, Part.Circle)
|
drillable = isinstance(subobj.Edges[0].Curve, Part.Circle)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user