Test Case Arch->testWindow

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Test Case Arch->testWindow

Post by ickby »

Hello Yorik,

one of the Arch test cases in the Test Workbench, testWindow, does create a cyclic dependency graph. Is there a way to change that? I ask because in my branch I have changed the links a bit so that now cyclic links give an error, and hence this test fails during selftest. I would like to change that.

Here the relevant code:

Code: Select all

import Draft, Arch

FreeCAD.Console.PrintLog ('Checking Arch Window...\n')
l=Draft.makeLine(FreeCAD.Vector(0,0,0),FreeCAD.Vector(-2,0,0))
w = Arch.makeWall(l)
sk = FreeCAD.ActiveDocument.addObject('Sketcher::SketchObject','Sketch001')
sk.Support = (w,["Face3"])
sk.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.80,1.30,0),FreeCAD.Vector(-0.90,1.30,0)))
sk.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.90,1.30,0),FreeCAD.Vector(-0.90,0.25,0)))
sk.addGeometry(Part.LineSegment(FreeCAD.Vector(-0.90,0.25,0),FreeCAD.Vector(-1.80,0.25,0)))
sk.addGeometry(Part.LineSegment(FreeCAD.Vector(-1.80,0.25,0),FreeCAD.Vector(-1.80,1.30,0)))
sk.addConstraint(Sketcher.Constraint('Coincident',0,2,1,1)) 
sk.addConstraint(Sketcher.Constraint('Coincident',1,2,2,1)) 
sk.addConstraint(Sketcher.Constraint('Coincident',2,2,3,1)) 
sk.addConstraint(Sketcher.Constraint('Coincident',3,2,0,1)) 
win = Arch.makeWindow(sk)
Arch.removeComponents(win,host=w)
self.failUnless(win,"Arch Window failed")
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Test Case Arch->testWindow

Post by yorik »

Hi ickby,
good catch... the window system changed a whole ago but the test file didn't :)
it should now be fixed in git commit 1cbe0be416
Post Reply