From a965dc9a3340904f3604f8e007879bd8e3e9c611 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Thu, 16 Mar 2017 00:34:33 -0700 Subject: [PATCH] fix BREP test after algorithm improvement --- web/test/cases/brep-bool-wizard-based.js | 69 +++++++++++++++++-- .../out.json | 2 +- .../overlap.face.edge1.intersect/out.json | 2 +- .../out.json | 2 +- .../overlap.face.edge2.intersect/out.json | 2 +- .../out.json | 2 +- .../overlap.face.inside.intersect/out.json | 2 +- .../overlap.kiss.edge.half.intersect/out.json | 2 +- .../brep/overlap.kiss.edge.intersect/out.json | 2 +- .../out.json | 4 +- .../overlap.kiss.edge4.intersect/out.json | 4 +- .../cases/data/brep/star.intersect/out.json | 4 +- 12 files changed, 78 insertions(+), 19 deletions(-) diff --git a/web/test/cases/brep-bool-wizard-based.js b/web/test/cases/brep-bool-wizard-based.js index 4281181c..69e116dd 100644 --- a/web/test/cases/brep-bool-wizard-based.js +++ b/web/test/cases/brep-bool-wizard-based.js @@ -27,8 +27,7 @@ export default { cut(app, '0:1', 500); setSketch(win, app, '2:0', {"layers":[{"name":"sketch","data":[{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-379.56770796200084],[51,-40.45650878155793]],[52,[53,-5.818373610536707],[54,-40.45650878155793]]],"children":[55]},{"id":62,"_class":"TCAD.TWO.Segment","points":[[56,[57,-5.818373610536707],[58,-40.45650878155793]],[59,[60,-5.818373610536707],[61,-354.50976889632983]]],"children":[62]},{"id":69,"_class":"TCAD.TWO.Segment","points":[[63,[64,-5.818373610536707],[65,-354.50976889632983]],[66,[67,-379.56770796200084],[68,-354.50976889632983]]],"children":[69]},{"id":76,"_class":"TCAD.TWO.Segment","points":[[70,[71,-379.56770796200084],[72,-354.50976889632983]],[73,[74,-379.56770796200084],[75,-40.45650878155793]]],"children":[76]}]}]}); cut(app, '2:0', 500); - assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,5.818373610536696],[-250,-40.45650878155794,250],[-250,-40.45650878155793,5.818373610536707],[-250,57.176503480539594,-250],[-250,57.176503480539594,-45.42896723585416],[-250,250,-45.42896723585416],[-250,250,250],[-154.2442837314632,-250,-17.236467236467238],[-154.2442837314632,-250,5.818373610536707],[-154.2442837314632,-40.45650878155794,173.69055445978523],[-154.2442837314632,-40.45650878155793,5.818373610536707],[-154.2442837314632,250,-17.236467236467238],[-154.2442837314632,250,173.69055445978523],[148.94075535101177,-250,-17.236467236467238],[148.94075535101177,-250,5.818373610536707],[148.94075535101177,-40.45650878155794,173.69055445978523],[148.94075535101177,-40.45650878155793,5.818373610536707],[148.94075535101177,250,-17.236467236467238],[148.94075535101177,250,173.69055445978523],[250,-250,-250],[250,-250,5.818373610536696],[250,-40.45650878155794,250],[250,-40.45650878155793,5.818373610536707],[250,57.176503480539594,-250],[250,57.176503480539594,-45.42896723585416],[250,250,-45.42896723585416],[250,250,250]],"faces":[[[9,1,0,20,21,15,14,8]],[[23,21,20,24,25,26,27,22]],[[27,26,6,7],[13,12,18,19]],[[1,3,2,7,6,5,4,0]],[[2,22,27,7]],[[0,4,24,20]],[[8,14,18,12]],[[10,11,9,8,12,13]],[[16,10,13,19]],[[17,16,19,18,14,15]],[[6,26,25,5]],[[5,25,24,4]],[[17,15,21,23]],[[9,11,3,1]],[[16,17,23,22,2,3,11,10]]]} - ); + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,5.818373610536696],[-250,-40.45650878155794,250],[-250,-40.45650878155793,5.818373610536707],[-250,57.176503480539594,-250],[-250,57.176503480539594,-45.42896723585416],[-250,250,-45.42896723585416],[-250,250,250],[-154.2442837314632,-250,-17.236467236467238],[-154.2442837314632,-250,5.818373610536707],[-154.2442837314632,-40.45650878155794,173.69055445978523],[-154.2442837314632,-40.45650878155793,5.818373610536707],[-154.2442837314632,250,-17.236467236467238],[-154.2442837314632,250,173.69055445978523],[148.94075535101177,-250,-17.236467236467238],[148.94075535101177,-250,5.818373610536707],[148.94075535101177,-40.45650878155794,173.69055445978523],[148.94075535101177,-40.45650878155793,5.818373610536707],[148.94075535101177,250,-17.236467236467238],[148.94075535101177,250,173.69055445978523],[250,-250,-250],[250,-250,5.818373610536696],[250,-40.45650878155794,250],[250,-40.45650878155793,5.818373610536707],[250,57.176503480539594,-250],[250,57.176503480539594,-45.42896723585416],[250,250,-45.42896723585416],[250,250,250]],"faces":[[[9,1,0,20,21,15,14,8]],[[23,21,20,24,25,26,27,22]],[[27,26,6,7],[13,12,18,19]],[[1,3,2,7,6,5,4,0]],[[2,22,27,7]],[[0,4,24,20]],[[8,14,18,12]],[[10,11,9,8,12,13]],[[16,10,13,19]],[[17,16,19,18,14,15]],[[6,26,25,5]],[[5,25,24,4]],[[17,15,21,23]],[[9,11,3,1]],[[23,22,2,3,11,10,16,17]]]}); env.done(); })); }, @@ -54,18 +53,78 @@ export default { cut(app, '0:2', 500); setSketch(win, app, '1:3', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,20.80092487041237],[30,30.9464504729465]],[31,[32,359.90906163964087],[33,-79.21779295049502]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,359.90906163964087],[37,-79.21779295049502]],[38,[39,-472.1057825646785],[40,-293.4697818232062]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,-472.1057825646785],[44,-293.4697818232062]],[45,[46,20.80092487041237],[47,30.9464504729465]]],"children":[48]}]}]}); cut(app, '1:3', 50); - assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,250,-250],[-250,250,250],[-218.33407620133045,-250,-20.527135369355864],[-218.33407620133045,250,-20.527135369355864],[-100.99700543871825,-250,250],[-100.99700543871825,250,250],[110.75295183637142,-123.92982319147082,250],[110.75295183637142,-22.81078696591853,250],[110.75295183637147,250,250],[110.7529518363715,-250,250],[165.1375816702817,-129.43889625756043,250],[165.1375816702817,-15.860748783049335,250],[175.84726740609295,30.94645047294649,97.86528532562242],[221.8161377952996,30.94645047294649,117.53411739924385],[223.31035144238643,-250,-13.06272250777187],[223.31035144238643,-197.6114609132843,-13.06272250777187],[223.31035144238643,-48.46538501303118,-13.06272250777187],[223.31035144238643,250,-13.06272250777187],[250,-250,-250],[250,-250,250],[250,-215.08287570101118,-75.44024399385171],[250,-184.99101442530412,51.6644051608298],[250,-93.12059491922011,-75.4402439938517],[250,-16.208770773268895,51.664405160829745],[250,250,-250],[250,250,250]],"faces":[[[11,16,4,6,1,0,20,21]],[[20,26,27,21],[23,25,24,22]],[[7,5,19,10,27,26,2,3]],[[2,0,1,3]],[[13,12,8,11,21,27,10,9]],[[1,6,7,3]],[[20,0,2,26]],[[5,7,6,4]],[[14,9,10,19,18]],[[8,17,16,11]],[[22,24,18,17]],[[18,19,5,4,16,17]],[[8,12,23,22,17]],[[13,9,14,15]],[[24,25,15,14,18]],[[12,13,15,25,23]]]}); + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,250,-250],[-250,250,250],[-218.33407620133045,-250,-20.527135369355864],[-218.33407620133045,250,-20.527135369355864],[-100.99700543871825,-250,250],[-100.99700543871825,250,250],[110.75295183637142,-123.92982319147082,250],[110.75295183637142,-22.81078696591853,250],[110.75295183637147,250,250],[110.7529518363715,-250,250],[165.1375816702817,-129.43889625756043,250],[165.1375816702817,-15.860748783049335,250],[175.84726740609295,30.94645047294649,97.86528532562242],[221.8161377952996,30.94645047294649,117.53411739924385],[223.31035144238643,-250,-13.06272250777187],[223.31035144238643,-197.6114609132843,-13.06272250777187],[223.31035144238643,-48.46538501303118,-13.06272250777187],[223.31035144238643,250,-13.06272250777187],[250,-250,-250],[250,-250,250],[250,-215.08287570101118,-75.44024399385171],[250,-184.99101442530412,51.6644051608298],[250,-93.12059491922011,-75.4402439938517],[250,-16.208770773268895,51.664405160829745],[250,250,-250],[250,250,250]],"faces":[[[11,16,4,6,1,0,20,21]],[[20,26,27,21],[23,25,24,22]],[[7,5,19,10,27,26,2,3]],[[2,0,1,3]],[[13,12,8,11,21,27,10,9]],[[1,6,7,3]],[[20,0,2,26]],[[5,7,6,4]],[[14,9,10,19,18]],[[8,17,16,11]],[[22,24,18,17]],[[17,18,19,5,4,16]],[[8,12,23,22,17]],[[13,9,14,15]],[[24,25,15,14,18]],[[12,13,15,25,23]]]}); + env.done() + })); + }, + + test_COMPLEX_NEW_EDGE_SHOULD_SPLIT: function(env) { + test.emptyModeller(env.test((win, app) => { + app.actionManager.actions['BOX'].invoke(app); + app.ui.registeredWizard.okClick(); + setSketch(win, app, '0:2', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-250],[30,-250]],[31,[32,250],[33,-250]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,250],[37,-250]],[38,[39,250],[40,15.803508066603925]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,250],[44,15.803508066603925]],[45,[46,-250],[47,15.803508066603925]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-250],[51,15.803508066603925]],[52,[53,-250],[54,-250]]],"children":[55]}]}]}); + cut(app, '0:2', 250); + setSketch(win, app, '1:2', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-111.52761407003341],[30,-97.98175001294433]],[31,[32,164.8080126945838],[33,-97.98175001294433]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,164.8080126945838],[37,-97.98175001294433]],[38,[39,164.8080126945838],[40,137.7162845804056]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,164.8080126945838],[44,137.7162845804056]],[45,[46,-111.52761407003341],[47,137.7162845804056]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-111.52761407003341],[51,137.7162845804056]],[52,[53,-111.52761407003341],[54,-97.98175001294433]]],"children":[55]}]}]}); + cut(app, '1:2', 500); + setSketch(win, app, '0:1', {"layers":[{"name":"sketch","data":[{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,-250],[44,250]],[45,[46,-165.25156682188998],[47,175.15143027204928]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-165.25156682188998],[51,175.15143027204928]],[52,[53,-15.803508066603925],[54,250]]],"children":[55]},{"id":62,"_class":"TCAD.TWO.Segment","points":[[56,[57,-15.803508066603925],[58,250]],[59,[60,-91.38335492454746],[61,57.11459682784216]]],"children":[62]},{"id":69,"_class":"TCAD.TWO.Segment","points":[[63,[64,-91.38335492454746],[65,57.11459682784216]],[66,[67,-15.803508066603925],[68,0]]],"children":[69]},{"id":76,"_class":"TCAD.TWO.Segment","points":[[70,[71,-15.803508066603925],[72,0]],[73,[74,-250],[75,-250]]],"children":[76]},{"id":83,"_class":"TCAD.TWO.Segment","points":[[77,[78,-250],[79,-250]],[80,[81,-161.44392703336717],[82,47.214733377682855]]],"children":[83]},{"id":90,"_class":"TCAD.TWO.Segment","points":[[84,[85,-161.44392703336717],[86,47.214733377682855]],[87,[88,-250],[89,250]]],"children":[90]}]}]}); + cut(app, '0:1', 500); + // here a new edge should split + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,0,-250],[-250,0,15.803508066603925],[-250,47.214733377682855,161.44392703336717],[-250,57.11459682784216,91.38335492454746],[-250,175.15143027204928,165.25156682188998],[-250,250,15.803508066603925],[-250,250,250],[-164.8080126945838,-250,-97.98175001294433],[-164.8080126945838,-250,137.7162845804056],[-164.8080126945838,-130.13941360453094,137.7162845804056],[-164.8080126945838,0,-97.98175001294433],[-164.8080126945838,0,15.803508066603925],[111.5276140700334,0,15.803508066603925],[111.52761407003341,-250,-97.98175001294433],[111.52761407003341,-250,137.7162845804056],[111.52761407003341,-130.13941360453094,137.7162845804056],[111.52761407003341,0,-97.98175001294433],[250,-250,-250],[250,-250,250],[250,0,-250],[250,0,15.803508066603925],[250,47.214733377682855,161.44392703336717],[250,57.11459682784216,91.38335492454746],[250,175.15143027204928,165.25156682188998],[250,250,15.803508066603925],[250,250,250]],"faces":[[[1,0,19,20],[10,16,15,9]],[[23,27,20]],[[27,25,26]],[[26,24,22]],[[22,20,19,21]],[[8,27,26,7]],[[8,4,1]],[[6,8,7]],[[5,7,3]],[[1,3,2,0]],[[20,27,8,1]],[[19,0,2,21]],[[22,14,13,3,7,26]],[[3,13,12,18,14,22,21,2]],[[12,9,15,18]],[[13,11,10,9,12]],[[11,17,16,10]],[[17,14,18,15,16]],[[23,20,1,4]],[[14,17,11,13,3,1,20,22]],[[13,14,22,24,5,3]],[[24,26,7,5]],[[26,25,6,7]],[[25,27,8,6]],[[27,23,4,8]]]}); + + //add extra cut with corner case + setSketch(win, app, '0:4', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-250],[30,250]],[31,[32,-79.19890760127447],[33,18.27667098490949]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,-79.19890760127447],[37,18.27667098490949]],[38,[39,-250],[40,-250]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,-250],[44,-250]],[45,[46,127.93669689436645],[47,-17.515143027204928]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,127.93669689436645],[51,-17.515143027204928]],[52,[53,-250],[54,250]]],"children":[55]}]}]}); + cut(app, '0:4', 500); + assertScene(app, env,{"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,0,-250],[-250,0,15.803508066603925],[-250,47.214733377682855,161.44392703336717],[-250,57.11459682784216,91.38335492454746],[-250,175.15143027204928,165.25156682188998],[-250,250,15.803508066603925],[-250,250,250],[-194.82982128578166,175.15143027204928,165.25156682188998],[-164.8080126945838,-250,-97.98175001294433],[-164.8080126945838,-250,137.7162845804056],[-164.8080126945838,-197.5948031861442,-97.98175001294433],[-164.8080126945838,-197.5948031861442,137.7162845804056],[-164.8080126945838,-116.18924722371236,-97.98175001294433],[-164.8080126945838,-116.18924722371234,124.64796446730595],[-164.8080126945838,0,-97.98175001294433],[-164.8080126945838,0,15.803508066603925],[-144.25637408730685,175.15143027204928,165.25156682188998],[-107.82597846491458,57.11459682784216,91.38335492454746],[-100.52888197026124,47.214733377682855,161.44392703336717],[-90.83493751835296,0,-250],[-90.83493751835296,0,-97.98175001294433],[-90.83493751835294,0,15.803508066603925],[-79.19890760127447,18.27667098490949,15.80350806660391],[-79.19890760127447,18.27667098490949,39.989059061145895],[-79.19890760127447,18.27667098490949,170.06611455295752],[-79.19890760127447,18.27667098490949,250],[-55.14982911155237,-130.13941360453092,137.7162845804056],[22.502226711741912,57.11459682784216,91.38335492454746],[36.48843194004928,47.214733377682855,161.44392703336717],[103.1918722596688,0,-250],[103.1918722596688,0,-97.98175001294433],[103.1918722596688,0,15.803508066603925],[111.5276140700334,0,15.803508066603925],[111.52761407003341,-250,-97.98175001294433],[111.52761407003341,-250,137.7162845804056],[111.52761407003341,-130.13941360453094,137.7162845804056],[111.52761407003341,-27.60906432359619,41.667292107202755],[111.52761407003341,-27.609064323596158,-97.98175001294433],[111.52761407003341,-5.900292776440324,21.330819545093046],[111.52761407003341,-5.900292776440267,-97.98175001294433],[111.52761407003341,0,-97.98175001294433],[127.93669689436645,-17.515143027204928,-250],[127.93669689436645,-17.515143027204928,32.21144827733622],[127.93669689436645,-17.515143027204928,180.73039911666126],[127.93669689436645,-17.515143027204928,250],[250,-250,-250],[250,-250,250],[250,0,-250],[250,0,15.803508066603925],[250,47.214733377682855,161.44392703336717],[250,57.11459682784216,91.38335492454746],[250,175.15143027204928,165.25156682188998],[250,250,15.803508066603925],[250,250,250]],"faces":[[[48,1,0,47],[10,11,36,35]],[[48,51,55]],[[54,55,53]],[[50,54,52]],[[49,50,48,47]],[[7,8,55,54]],[[1,8,4]],[[7,6,8]],[[3,5,7]],[[0,1,3,2]],[[8,46,1,48,55]],[[1,27,8]],[[21,0,2]],[[0,43,31,49,47]],[[33,7,54,50,34]],[[24,23,17,3,7]],[[31,32,42,34,50,49]],[[22,21,2,3,17,16]],[[32,41,42]],[[39,12,10,35]],[[14,22,16]],[[12,13,11,10]],[[15,14,16,17]],[[13,28,37,36,11]],[[41,40,34,42]],[[38,39,35,36,37]],[[45,30,51,48,1]],[[26,1,4,20]],[[40,44,38,37,28,1,48,50,34]],[[1,15,17,3]],[[29,33,34,50,52]],[[23,25,19,5,3,17]],[[7,29,52,54]],[[19,7,5]],[[18,7,54,53]],[[7,9,6]],[[8,18,53,55]],[[9,8,6]],[[30,8,55,51]],[[8,20,4]],[[8,27,26,20]],[[8,9,7]],[[7,19,25,24]],[[25,23,24]],[[15,1,0,21,22,14]],[[1,26,27]],[[12,39,38,44,43,0,1,28,13]],[[45,1,46]],[[8,30,45,46]],[[18,8,7]],[[29,7,33]],[[44,40,41,32,31,43]]]}); env.done(); })); - } + }, + + test_INWARD_TAPER: function(env) { + test.emptyModeller(env.test((win, app) => { + app.actionManager.actions['BOX'].invoke(app); + app.ui.registeredWizard.okClick(); + setSketch(win, app, '0:2', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-250],[30,250]],[31,[32,250],[33,250]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,250],[37,250]],[38,[39,250],[40,-250]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,250],[44,-250]],[45,[46,-250],[47,-250]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-250],[51,-250]],[52,[53,-250],[54,250]]],"children":[55]}]}]}); + cut(app, '0:2', 250, 0.1); + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,250,-250],[-250,250,250],[-25,0,-25],[-25,0,25],[25,0,-25],[25,0,25],[250,-250,-250],[250,-250,250],[250,250,-250],[250,250,250]],"faces":[[[8,9,1,0]],[[10,11,9,8]],[[0,1,3,2]],[[3,1,9,11]],[[0,2,10,8]],[[10,2,4,6]],[[2,3,5,4]],[[3,11,7,5]],[[11,10,6,7]],[[5,7,6,4]]]}); + env.done(); + })); + }, + + test_MANY_FACES_FOR_EDGE: function(env) { + test.emptyModeller(env.test((win, app) => { + app.actionManager.actions['BOX'].invoke(app); + app.ui.registeredWizard.okClick(); + setSketch(win, app, '0:2', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-250],[30,250]],[31,[32,-117.53266697380634],[33,-64.541059898911]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,-117.53266697380634],[37,-64.541059898911]],[38,[39,250],[40,-250]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,250],[44,-250]],[45,[46,128.40274021993872],[47,53.670986652778616]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,128.40274021993872],[51,53.670986652778616]],[52,[53,-250],[54,250]]],"children":[55]}]}]}); + cut(app, '0:2', 500); + setSketch(win, app, '1:2', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-117.53266697380634],[30,-64.541059898911]],[31,[32,-108.60525475478379],[33,-208.45524324067867]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,-108.60525475478379],[37,-208.45524324067867]],[38,[39,250],[40,-250]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,250],[44,-250]],[45,[46,-197.39904477522555],[47,-230.98501085780566]]],"children":[48]},{"id":55,"_class":"TCAD.TWO.Segment","points":[[49,[50,-197.39904477522555],[51,-230.98501085780566]],[52,[53,-117.53266697380634],[54,-64.541059898911]]],"children":[55]}]}]}); + cut(app, '1:2', 500); + + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,250,-250],[108.60525475478379,-250,-208.45524324067867],[108.60525475478379,250,-208.45524324067867],[117.53266697380634,-250,-64.541059898911],[117.53266697380634,250,-64.541059898911],[197.39904477522555,-250,-230.98501085780566],[197.39904477522555,250,-230.98501085780566],[250,-250,-250],[250,-250,250],[250,250,-250],[250,250,250]],"faces":[[[4,6,0,8,9]],[[2,4,0]],[[8,10,11,9]],[[7,5,11,10,1]],[[5,3,1]],[[8,0,1,10]],[[9,11,5,4]],[[4,5,1,0]],[[7,1,0,6]],[[1,3,2,0]],[[3,5,4,2]],[[5,7,6,4]]]}); + env.done(); + })); + }, + + test_MANY_FACES_FOR_EDGE_2: function(env) { + test.emptyModeller(env.test((win, app) => { + app.actionManager.actions['BOX'].invoke(app); + app.ui.registeredWizard.okClick(); + setSketch(win, app, '0:4', {"layers":[{"name":"sketch","data":[{"id":34,"_class":"TCAD.TWO.Segment","points":[[28,[29,-250],[30,250]],[31,[32,-224.87464027936358],[33,-219.43960365629738]]],"children":[34]},{"id":41,"_class":"TCAD.TWO.Segment","points":[[35,[36,-224.87464027936358],[37,-219.43960365629738]],[38,[39,-178.67682898330096],[40,-207.21077125439845]]],"children":[41]},{"id":48,"_class":"TCAD.TWO.Segment","points":[[42,[43,-178.67682898330096],[44,-207.21077125439845]],[45,[46,-250],[47,250]]],"children":[48]},{"id":62,"_class":"TCAD.TWO.Segment","points":[[56,[57,-250],[58,250]],[59,[60,-146.06660924490384],[61,-197.69945716403262]]],"children":[62]},{"id":69,"_class":"TCAD.TWO.Segment","points":[[63,[64,-146.06660924490384],[65,-197.69945716403262]],[66,[67,-98.51003879307467],[68,-177.31806982753443]]],"children":[69]},{"id":76,"_class":"TCAD.TWO.Segment","points":[[70,[71,-98.51003879307467],[72,-177.31806982753443]],[73,[74,-250],[75,250]]],"children":[76]},{"id":83,"_class":"TCAD.TWO.Segment","points":[[77,[78,-250],[79,250]],[80,[81,-50.953468341245525],[82,-162.3717191141024]]],"children":[83]},{"id":90,"_class":"TCAD.TWO.Segment","points":[[84,[85,-50.953468341245525],[86,-162.3717191141024]],[87,[88,-4.755657045182915],[89,-132.47901768723835]]],"children":[90]},{"id":97,"_class":"TCAD.TWO.Segment","points":[[91,[92,-4.755657045182915],[93,-132.47901768723835]],[94,[95,-250],[96,250]]],"children":[97]},{"id":104,"_class":"TCAD.TWO.Segment","points":[[98,[99,-250],[100,250]],[101,[102,40.08339509511315],[103,-99.86879794884122]]],"children":[104]},{"id":111,"_class":"TCAD.TWO.Segment","points":[[105,[106,40.08339509511315],[107,-99.86879794884122]],[108,[109,88.99872470270884],[110,-42.80091340664624]]],"children":[111]},{"id":118,"_class":"TCAD.TWO.Segment","points":[[112,[113,88.99872470270884],[114,-42.80091340664624]],[115,[116,-250],[117,250]]],"children":[118]},{"id":125,"_class":"TCAD.TWO.Segment","points":[[119,[120,-250],[121,250]],[122,[123,124.32646275263907],[124,7.47317535671601]]],"children":[125]},{"id":132,"_class":"TCAD.TWO.Segment","points":[[126,[127,124.32646275263907],[128,7.47317535671601]],[129,[130,152.86040502373658],[131,69.97609652197718]]],"children":[132]},{"id":139,"_class":"TCAD.TWO.Segment","points":[[133,[134,152.86040502373658],[135,69.97609652197718]],[136,[137,-250],[138,250]]],"children":[139]},{"id":146,"_class":"TCAD.TWO.Segment","points":[[140,[141,-250],[142,250]],[143,[144,161.01295995833584],[145,121.60894444110598]]],"children":[146]},{"id":153,"_class":"TCAD.TWO.Segment","points":[[147,[148,161.01295995833584],[149,121.60894444110598]],[150,[151,165.0892374256355],[152,192.26442054096643]]],"children":[153]},{"id":160,"_class":"TCAD.TWO.Segment","points":[[154,[155,165.0892374256355],[156,192.26442054096643]],[157,[158,-250],[159,250]]],"children":[160]}]}]}); + cut(app, '0:4', 500); + assertScene(app, env, {"format":"LOOPS","vertices":[[-250,-250,-250],[-250,-250,250],[-250,250,-250],[-250,250,250],[-224.87464027936358,-219.43960365629738,-250],[-224.87464027936358,-219.43960365629738,250],[-178.67682898330096,-207.21077125439845,-250],[-178.67682898330096,-207.21077125439845,250],[-146.06660924490384,-197.69945716403262,-250],[-146.06660924490384,-197.69945716403262,250],[-98.51003879307467,-177.31806982753443,-250],[-98.51003879307467,-177.31806982753443,250],[-50.953468341245525,-162.3717191141024,-250],[-50.953468341245525,-162.3717191141024,250],[-4.755657045182915,-132.47901768723835,-250],[-4.755657045182915,-132.47901768723835,250],[40.08339509511315,-99.86879794884122,-250],[40.08339509511315,-99.86879794884122,250],[88.99872470270884,-42.80091340664624,-250],[88.99872470270884,-42.80091340664624,250],[124.32646275263907,7.47317535671601,-250],[124.32646275263907,7.47317535671601,250],[152.86040502373658,69.97609652197718,-250],[152.86040502373658,69.97609652197718,250],[161.01295995833584,121.60894444110598,-250],[161.01295995833584,121.60894444110598,250],[165.0892374256355,192.26442054096643,-250],[165.0892374256355,192.26442054096643,250],[250,-250,-250],[250,-250,250],[250,250,-250],[250,250,250]],"faces":[[[28,29,1,0]],[[30,31,29,28]],[[2,3,31,30]],[[0,1,3,2]],[[15,13,3,11,9,3,7,5,3,1,29,31,3,27,25,3,23,21,3,19,17,3]],[[12,14,2,16,18,2,20,22,2,24,26,2,30,28,0,2,4,6,2,8,10,2]],[[3,5,4,2]],[[5,7,6,4]],[[7,3,2,6]],[[3,9,8,2]],[[9,11,10,8]],[[11,3,2,10]],[[3,13,12,2]],[[13,15,14,12]],[[15,3,2,14]],[[3,17,16,2]],[[17,19,18,16]],[[19,3,2,18]],[[3,21,20,2]],[[21,23,22,20]],[[23,3,2,22]],[[3,25,24,2]],[[25,27,26,24]],[[27,3,2,26]]]}); + env.done(); + })); + }, }; -function cut(app, faceId, depth) { +function cut(app, faceId, depth, prism) { selectFace(app, faceId); app.actionManager.actions['CUT'].invoke(app); app.ui.registeredWizard.setFormField('value', depth); + if (prism !== undefined) { + app.ui.registeredWizard.setFormField('prism', prism); + } app.ui.registeredWizard.okClick(); } diff --git a/web/test/cases/data/brep/overlap.face.edge1.half.intersect/out.json b/web/test/cases/data/brep/overlap.face.edge1.half.intersect/out.json index ec9998cc..46dd195d 100644 --- a/web/test/cases/data/brep/overlap.face.edge1.half.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.edge1.half.intersect/out.json @@ -2,5 +2,5 @@ "format": "LOOPS", "vertices": [ [-200, -200, 0], [-200, -200, 250], [-200, 250, 0], [-200, 250, 250], [200, -200, 0], [200, -200, 250], [200, 250, 0], [200, 250, 250] -], "faces": [[[6, 2, 3, 7]], [[3, 1, 5, 7]], [[4, 5, 1, 0]], [[6, 7, 5, 4]], [[0, 1, 3, 2]], [[0, 2, 6, 4]]] +], "faces": [[[6, 2, 3, 7]], [[3, 1, 5, 7]], [[5, 1, 0, 4]], [[6, 7, 5, 4]], [[3, 2, 0, 1]], [[2, 6, 4, 0]]] } diff --git a/web/test/cases/data/brep/overlap.face.edge1.intersect/out.json b/web/test/cases/data/brep/overlap.face.edge1.intersect/out.json index 917feb01..705e9272 100644 --- a/web/test/cases/data/brep/overlap.face.edge1.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.edge1.intersect/out.json @@ -2,5 +2,5 @@ "format": "LOOPS", "vertices": [ [-200, -200, -250], [-200, -200, 250], [-200, 250, -250], [-200, 250, 250], [200, -200, -250], [200, -200, 250], [200, 250, -250], [200, 250, 250] -], "faces": [[[2, 3, 7, 6]], [[3, 1, 5, 7]], [[0, 2, 6, 4]], [[4, 5, 1, 0]], [[6, 7, 5, 4]], [[0, 1, 3, 2]]] +], "faces": [[[2, 3, 7, 6]], [[3, 1, 5, 7]], [[0, 2, 6, 4]], [[0, 4, 5, 1]], [[6, 7, 5, 4]], [[2, 0, 1, 3]]] } diff --git a/web/test/cases/data/brep/overlap.face.edge2.half.intersect/out.json b/web/test/cases/data/brep/overlap.face.edge2.half.intersect/out.json index ecb3e0f2..79f7b226 100644 --- a/web/test/cases/data/brep/overlap.face.edge2.half.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.edge2.half.intersect/out.json @@ -1,5 +1,5 @@ { "format": "LOOPS", "vertices": [ [0, 0, 0], [0, 0, 250], [0, 250, 0], [0, 250, 250], [250, 0, 0], [250, 0, 250], [250, 250, 0], [250, 250, 250] -], "faces": [[[4, 6, 7, 5]], [[6, 2, 3, 7]], [[3, 1, 5, 7]], [[4, 5, 1, 0]], [[0, 1, 3, 2]], [[0, 2, 6, 4]]] +], "faces": [[[4, 6, 7, 5]], [[6, 2, 3, 7]], [[3, 1, 5, 7]], [[4, 5, 1, 0]], [[3, 2, 0, 1]], [[6, 4, 0, 2]]] } diff --git a/web/test/cases/data/brep/overlap.face.edge2.intersect/out.json b/web/test/cases/data/brep/overlap.face.edge2.intersect/out.json index d1534f4e..aa5ec656 100644 --- a/web/test/cases/data/brep/overlap.face.edge2.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.edge2.intersect/out.json @@ -2,5 +2,5 @@ "format": "LOOPS", "vertices": [ [0, 0, -250], [0, 0, 250], [0, 250, -250], [0, 250, 250], [250, 0, -250], [250, 0, 250], [250, 250, -250], [250, 250, 250] -], "faces": [[[5, 4, 6, 7]], [[2, 3, 7, 6]], [[3, 1, 5, 7]], [[0, 2, 6, 4]], [[4, 5, 1, 0]], [[0, 1, 3, 2]]] +], "faces": [[[5, 4, 6, 7]], [[2, 3, 7, 6]], [[3, 1, 5, 7]], [[0, 2, 6, 4]], [[4, 5, 1, 0]], [[2, 0, 1, 3]]] } diff --git a/web/test/cases/data/brep/overlap.face.inside.half.intersect/out.json b/web/test/cases/data/brep/overlap.face.inside.half.intersect/out.json index 90f84ca5..536f4d70 100644 --- a/web/test/cases/data/brep/overlap.face.inside.half.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.inside.half.intersect/out.json @@ -2,5 +2,5 @@ "format": "LOOPS", "vertices": [ [-100, -100, 0], [-100, -100, 250], [-100, 100, 0], [-100, 100, 250], [100, -100, 0], [100, -100, 250], [100, 100, 0], [100, 100, 250] -], "faces": [[[3, 1, 5, 7]], [[4, 5, 1, 0]], [[6, 7, 5, 4]], [[2, 3, 7, 6]], [[0, 1, 3, 2]], [[0, 2, 6, 4]]] +], "faces": [[[3, 1, 5, 7]], [[5, 1, 0, 4]], [[7, 5, 4, 6]], [[3, 7, 6, 2]], [[1, 3, 2, 0]], [[0, 2, 6, 4]]] } diff --git a/web/test/cases/data/brep/overlap.face.inside.intersect/out.json b/web/test/cases/data/brep/overlap.face.inside.intersect/out.json index f478a1b5..63662f9b 100644 --- a/web/test/cases/data/brep/overlap.face.inside.intersect/out.json +++ b/web/test/cases/data/brep/overlap.face.inside.intersect/out.json @@ -2,5 +2,5 @@ "format": "LOOPS", "vertices": [ [-100, -100, -250], [-100, -100, 250], [-100, 100, -250], [-100, 100, 250], [100, -100, -250], [100, -100, 250], [100, 100, -250], [100, 100, 250] -], "faces": [[[3, 1, 5, 7]], [[0, 2, 6, 4]], [[4, 5, 1, 0]], [[6, 7, 5, 4]], [[2, 3, 7, 6]], [[0, 1, 3, 2]]] +], "faces": [[[3, 1, 5, 7]], [[0, 2, 6, 4]], [[0, 4, 5, 1]], [[4, 6, 7, 5]], [[6, 2, 3, 7]], [[2, 0, 1, 3]]] } diff --git a/web/test/cases/data/brep/overlap.kiss.edge.half.intersect/out.json b/web/test/cases/data/brep/overlap.kiss.edge.half.intersect/out.json index bf4fb299..08716b88 100644 --- a/web/test/cases/data/brep/overlap.kiss.edge.half.intersect/out.json +++ b/web/test/cases/data/brep/overlap.kiss.edge.half.intersect/out.json @@ -1,5 +1,5 @@ { "format": "LOOPS", "vertices": [[-100, 100, 0], [-100, 100, 250], [100, -100, 0], [100, -100, 250], [250, 250, 0], [250, 250, 250]], - "faces": [[[1, 3, 5]], [[4, 5, 3, 2]], [[0, 1, 5, 4]], [[2, 3, 1, 0]], [[2, 0, 4]]] + "faces": [[[1, 3, 5]], [[4, 5, 3, 2]], [[5, 4, 0, 1]], [[3, 1, 0, 2]], [[2, 0, 4]]] } diff --git a/web/test/cases/data/brep/overlap.kiss.edge.intersect/out.json b/web/test/cases/data/brep/overlap.kiss.edge.intersect/out.json index 178943dc..89ac9913 100644 --- a/web/test/cases/data/brep/overlap.kiss.edge.intersect/out.json +++ b/web/test/cases/data/brep/overlap.kiss.edge.intersect/out.json @@ -1,5 +1,5 @@ { "format": "LOOPS", "vertices": [ [-100, 100, -250], [-100, 100, 250], [100, -100, -250], [100, -100, 250], [250, 250, -250], [250, 250, 250] -], "faces": [[[1, 3, 5]], [[2, 0, 4]], [[4, 5, 3, 2]], [[0, 1, 5, 4]], [[2, 3, 1, 0]]] +], "faces": [[[1, 3, 5]], [[2, 0, 4]], [[4, 5, 3, 2]], [[4, 0, 1, 5]], [[0, 2, 3, 1]]] } diff --git a/web/test/cases/data/brep/overlap.kiss.edge4.half.intersect/out.json b/web/test/cases/data/brep/overlap.kiss.edge4.half.intersect/out.json index 4df9ef24..9bf90f80 100644 --- a/web/test/cases/data/brep/overlap.kiss.edge4.half.intersect/out.json +++ b/web/test/cases/data/brep/overlap.kiss.edge4.half.intersect/out.json @@ -4,7 +4,7 @@ [0, -100, 250], [0, 100, 0], [0, 100, 250], [100, 0, 0], [100, 0, 250], [250, -250, 0], [250, -250, 250], [250, 250, 0], [250, 250, 250] ], "faces": [ - [[1, 7, 13, 11, 15, 9, 3, 5]], [[12, 13, 7, 6]], [[10, 11, 13, 12]], [[14, 15, 11, 10]], [[8, 9, 15, 14]], - [[2, 3, 9, 8]], [[4, 5, 3, 2]], [[0, 1, 5, 4]], [[6, 7, 1, 0]], [[6, 0, 4, 2, 8, 14, 10, 12]] + [[1, 7, 13, 11, 15, 9, 3, 5]], [[12, 13, 7, 6]], [[13, 12, 10, 11]], [[14, 15, 11, 10]], [[15, 14, 8, 9]], + [[2, 3, 9, 8]], [[3, 2, 4, 5]], [[0, 1, 5, 4]], [[1, 0, 6, 7]], [[6, 0, 4, 2, 8, 14, 10, 12]] ] } diff --git a/web/test/cases/data/brep/overlap.kiss.edge4.intersect/out.json b/web/test/cases/data/brep/overlap.kiss.edge4.intersect/out.json index 8ff79e99..585fa623 100644 --- a/web/test/cases/data/brep/overlap.kiss.edge4.intersect/out.json +++ b/web/test/cases/data/brep/overlap.kiss.edge4.intersect/out.json @@ -4,7 +4,7 @@ [0, -100, -250], [0, -100, 250], [0, 100, -250], [0, 100, 250], [100, 0, -250], [100, 0, 250], [250, -250, -250], [250, -250, 250], [250, 250, -250], [250, 250, 250] ], "faces": [ - [[1, 7, 13, 11, 15, 9, 3, 5]], [[6, 0, 4, 2, 8, 14, 10, 12]], [[12, 13, 7, 6]], [[10, 11, 13, 12]], - [[14, 15, 11, 10]], [[8, 9, 15, 14]], [[2, 3, 9, 8]], [[4, 5, 3, 2]], [[0, 1, 5, 4]], [[6, 7, 1, 0]] + [[1, 7, 13, 11, 15, 9, 3, 5]], [[6, 0, 4, 2, 8, 14, 10, 12]], [[12, 13, 7, 6]], [[12, 10, 11, 13]], + [[14, 15, 11, 10]], [[14, 8, 9, 15]], [[2, 3, 9, 8]], [[2, 4, 5, 3]], [[0, 1, 5, 4]], [[0, 6, 7, 1]] ] } diff --git a/web/test/cases/data/brep/star.intersect/out.json b/web/test/cases/data/brep/star.intersect/out.json index 7ddd6e44..27dada6f 100644 --- a/web/test/cases/data/brep/star.intersect/out.json +++ b/web/test/cases/data/brep/star.intersect/out.json @@ -4,8 +4,8 @@ [-50, 50, 250], [0, -100, 50], [0, -100, 250], [0, 200, 50], [0, 200, 250], [50, -50, 50], [50, -50, 250], [50, 50, 50], [50, 50, 250], [200, -200, 50], [200, -200, 250], [200, 0, 50], [200, 0, 250] ], "faces": [ - [[19, 15, 11, 7, 3, 5, 1, 9, 17, 13]], [[10, 11, 15, 14]], [[6, 7, 11, 10]], [[2, 3, 7, 6]], [[4, 5, 3, 2]], - [[0, 1, 5, 4]], [[8, 9, 1, 0]], [[16, 17, 9, 8]], [[12, 13, 17, 16]], [[18, 19, 13, 12]], [[14, 15, 19, 18]], + [[19, 15, 11, 7, 3, 5, 1, 9, 17, 13]], [[11, 15, 14, 10]], [[7, 11, 10, 6]], [[3, 7, 6, 2]], [[5, 3, 2, 4]], + [[1, 5, 4, 0]], [[9, 1, 0, 8]], [[17, 9, 8, 16]], [[13, 17, 16, 12]], [[19, 13, 12, 18]], [[15, 19, 18, 14]], [[14, 18, 12, 16, 8, 0, 4, 2, 6, 10]] ] }