Skip to content

Commit 5ccd0d7

Browse files
committed
Add test for CommandCommon2D
1 parent 1a5ce89 commit 5ccd0d7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test_link/test_command_edit_geom.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,36 @@ def test_command_common(capfd):
190190
assert gm.getNbSurfaces()==11
191191
assert gm.getNbCurves()==20
192192

193+
def test_command_common2d(capfd):
194+
ctx = Mgx3D.getStdContext()
195+
ctx.clearSession() # Clean the session after the previous test
196+
gm = ctx.getGeomManager ()
197+
tm = ctx.getTopoManager()
198+
199+
# Création d'une boite avec une topologie
200+
tm.newBoxWithTopo (Mgx3D.Point(0, 0, 0), Mgx3D.Point(1, 1, 1), 10, 10, 10)
201+
# Création d'une boite avec une topologie
202+
tm.newBoxWithTopo (Mgx3D.Point(.2, .2, .2), Mgx3D.Point(.8, .8, .8), 10, 10, 10)
203+
# Création d'une boite avec une topologie
204+
tm.newBoxWithTopo (Mgx3D.Point(.2, .8, .2), Mgx3D.Point(.8, 1.4, .8), 10, 10, 10)
205+
# Collage entre géométries avec topologies
206+
gm.glue (["Vol0001","Vol0002"])
207+
assert gm.getNbSurfaces()==17
208+
assert gm.getNbCurves()==32
209+
210+
# Intersection booléenne entre 2 géométries 1D ou 2D avec topologies
211+
gm.common2D("Surf0003", "Surf0016", "")
212+
assert gm.getNbSurfaces()==15
213+
assert gm.getNbCurves()==25
214+
# Annulation de : Intersection booléenne entre 2 géométries 1D ou 2D, sans destruction
215+
ctx.undo()
216+
assert gm.getNbSurfaces()==17
217+
assert gm.getNbCurves()==32
218+
# Rejeu de : Intersection booléenne entre 2 géométries 1D ou 2D, sans destruction
219+
ctx.redo()
220+
assert gm.getNbSurfaces()==15
221+
assert gm.getNbCurves()==25
222+
193223
def assertPoint(gm, point, x, y, z):
194224
p = gm.getCoord(point)
195225
assert p.getX() == x

0 commit comments

Comments
 (0)