mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-24 01:22:05 +05:00
Corrected for new version of PartitionAlgo.
This commit is contained in:
parent
45553ea796
commit
bb799cae63
@ -1344,6 +1344,21 @@ def MakeFuse(s1, s2):
|
|||||||
def MakeSection(s1, s2):
|
def MakeSection(s1, s2):
|
||||||
return MakeBoolean(s1, s2, 4)
|
return MakeBoolean(s1, s2, 4)
|
||||||
|
|
||||||
|
## Perform explode of compound
|
||||||
|
# Auxilary method for MakePartition
|
||||||
|
def ExplodeCompound(aComp):
|
||||||
|
ResListShapes = []
|
||||||
|
shapes = SubShapeAll(aComp,ShapeType["SHAPE"])
|
||||||
|
nbss = len(shapes)
|
||||||
|
for i in range(0,nbss):
|
||||||
|
if shapes[i].GetShapeType()==GEOM.COMPOUND:
|
||||||
|
ResListShapes.extend(ExplodeCompound(shapes[i]))
|
||||||
|
else:
|
||||||
|
ResListShapes.append(shapes[i])
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
return ResListShapes
|
||||||
|
|
||||||
## Perform partition operation.
|
## Perform partition operation.
|
||||||
# @param ListShapes Shapes to be intersected.
|
# @param ListShapes Shapes to be intersected.
|
||||||
# @param ListTools Shapes to intersect theShapes.
|
# @param ListTools Shapes to intersect theShapes.
|
||||||
@ -1373,22 +1388,20 @@ def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=
|
|||||||
NewListShapes = []
|
NewListShapes = []
|
||||||
nbs = len(ListShapes)
|
nbs = len(ListShapes)
|
||||||
for i in range(0,nbs):
|
for i in range(0,nbs):
|
||||||
if ListShapes[i].GetShapeType()==ShapeType["COMPOUND"]:
|
if ListShapes[i].GetShapeType()==GEOM.COMPOUND:
|
||||||
# need to explode
|
# need to explode
|
||||||
shapes = SubShapeAll(ListShapes[i],ShapeType["SHAPE"])
|
NewListShapes.extend(ExplodeCompound(ListShapes[i]))
|
||||||
nbss = len(shapes)
|
else: NewListShapes.append(ListShapes[i])
|
||||||
for j in range(0,nbss): NewListShapes.append(shapes[j])
|
pass
|
||||||
else: NewListShapes.append(ListShapes[i])
|
|
||||||
|
|
||||||
NewListTools = []
|
NewListTools = []
|
||||||
nbs = len(ListTools)
|
nbs = len(ListTools)
|
||||||
for i in range(0,nbs):
|
for i in range(0,nbs):
|
||||||
if ListTools[i].GetShapeType()==ShapeType["COMPOUND"]:
|
if ListTools[i].GetShapeType()==GEOM.COMPOUND:
|
||||||
# need to explode
|
# need to explode
|
||||||
shapes = SubShapeAll(ListTools[i],ShapeType["SHAPE"])
|
NewListTools.extend(ExplodeCompound(ListTools[i]))
|
||||||
nbss = len(shapes)
|
else: NewListTools.append(ListTools[i])
|
||||||
for j in range(0,nbss): NewListShapes.append(shapes[j])
|
pass
|
||||||
else: NewListTools.append(ListTools[i])
|
|
||||||
|
|
||||||
return MakePartitionNonSelfIntersectedShape(NewListShapes, NewListTools,
|
return MakePartitionNonSelfIntersectedShape(NewListShapes, NewListTools,
|
||||||
ListKeepInside, ListRemoveInside,
|
ListKeepInside, ListRemoveInside,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user