>
> Hello, all:

I'm writing a routine that sorts the wires in a compound. I think i have it
right, but I'm not getting the results I'm after.

Here's my code ( this is a consolidated version of other code that is
sprinkled around ):

        compound = { do some code that returns a compound containing two
wires:  }
        dumpTopology(compound);

sf = ShapeAnalysis_FreeBounds();
 inputwires = TopTools.TopTools_HSequenceOfShape();

print "Sorting Wires..."

#add all the wires in the compound to the input wires
texp = TopExp.TopExp_Explorer();
texp.Init(compound,TopAbs.TopAbs_WIRE);

while ( texp.More() ):
wire = ts.Wire(texp.Current());
inputwires.Append(wire);
texp.Next();
 #free memory
texp.Clear();
texp.Destroy();
 print "There are ",inputwires.Length()," wires."
outputwires = TopTools.TopTools_HSequenceOfShape();
print "New list has",outputwires.Length()," wires."


sf.ConnectWiresToWires(inputwires.GetHandle(),0.0001,False,outputwires.GetHandle()
);
return outputwires;

The output of the above print statements is:
    " Sorting Wires...
      There are  2  wires.
      New list has 0  wires.

So apparently I'm not doing something right. I'd expect at a minimum to get
a list of two wires out.  My code crashes later on ( hard crash) but i think
that's a side affect of this somehow..

There is another version of ConnectWiresToWires, but it requires a
complicated looking map of something to something that i dont wnat to
provide.  ShapeAnalysis_WireOrder seems even more pointless, requiring a
list of vertices instead of wires.

thanks for the ideas!
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to