Hi, all:
I'm struggling with a couple of problems that I presume to be null pointers
that are crashing OCC. I have a feeling this may be related to memory
management.
For example, I've tracked down one crash to one line:
BRepBuilderAPI_MakeOffset.Perform(). I load it with several wires, each of
which I can display successfully immediately before invoking perform. Yet,
Perform() crashes. See example below. I do not believe any object scoping
issues are at play that I can see: all of the objects in question seem to be
in scope when the crash happens.
I am also fairly certain that its something I'm doing: all of the 'simple'
test cases I create work fine.
So my question is: are there any tricks/techniques I can use to isolate the
problem when a crash occurs? Right now i'm using old school print
statements to get to what method call dies, but I still cannot see what
exactly is going wrong. Help is appreciated, this is completely kicking my
butt :(
#offset a face, returning the offset shape
def _offsetFace(self,face,offset ):
brt = BRepTools.BRepTools();
ow = brt.OuterWire(face);
bo = BRepOffsetAPI.BRepOffsetAPI_MakeOffset();
bo.AddWire(ow);
#now get the other wires
te = TopExp.TopExp_Explorer();
te.Init(face,TopAbs.TopAbs_WIRE);
while te.More():
w = ts.Wire(te.Current());
TestDisplay.display.showShape(w); # this line succesfully shows the wires on
screen
if not w.IsSame(ow):
bo.AddWire(w);
te.Next();
te.ReInit();
print "about to offset...";
bo.Perform(offset,0.00001); #this line crashes hard, but only sometimes.
print "done offsetting..";
if not bo.IsDone():
raise Exception, "Offset Was Not Successful.";
else:
return bo.Shape();
_______________________________________________
Pythonocc-users mailing list
[email protected]
https://mail.gna.org/listinfo/pythonocc-users