Skip to content

Commit d131b4f

Browse files
committed
New test case with nested volumes
1 parent a00f246 commit d131b4f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test_link/test_issue208.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,30 @@ def test_issue208_single_sectionByPlane():
5757
assert gm.getNbVolumes() == 3
5858
ctx.redo()
5959
assert gm.getNbVolumes() == 5
60+
61+
def test_issue208_nested_volumes():
62+
ctx = Mgx3D.getStdContext()
63+
ctx.clearSession() # Clean the session after the previous test
64+
gm = ctx.getGeomManager()
65+
66+
# Création de la sphère creuse Vol0000
67+
gm.newHollowSphere (Mgx3D.Point(0, 0, 0), 1, 2, Mgx3D.Portion.ENTIER)
68+
# Création du volume Vol0001
69+
gm.newSphere (Mgx3D.Point(0, 0, 0), 1, Mgx3D.Portion.ENTIER)
70+
# Collage entre Vol0000 Vol0001
71+
gm.glue (["Vol0000","Vol0001"])
72+
# Section par un plan de Vol0000 suivant [ [ 0, 0, -6.64992e-1] , [ 0, 0, 1] ]
73+
gm.sectionByPlane (["Vol0000"], Mgx3D.Plane(Mgx3D.Point(0, 0, -6.64992e-1), Mgx3D.Vector(0, 0, 1)), "")
74+
75+
# Vol0001 se trouve découpé à tort => 4 volumes au lieu de 3
76+
assert gm.getNbVolumes() == 3
77+
assert gm.getNbSurfaces() == 5
78+
79+
# Annulation de : Section par un plan de Vol0000 suivant [ [ 0, 0, -6.64992e-1] , [ 0, 0, 1] ]
80+
ctx.undo()
81+
# Section par un plan entre géométries avec topologies
82+
gm.sectionByPlane (["Vol0000","Vol0001"], Mgx3D.Plane(Mgx3D.Point(0, 0, -6.64992e-1), Mgx3D.Vector(0, 0, 1)), "")
83+
84+
# Des volumes sont créés en double => 6 volumes au lieu de 4
85+
assert gm.getNbVolumes() == 4
86+
assert gm.getNbSurfaces() == 6

0 commit comments

Comments
 (0)