def calcPointNi3s(chunk): data = chunk.data cnt, o = getInt(data, 0) list = [] try: while (o < len(data)): p = PointNi3s() l, o = getInt(data, o) p.points, o = getInts(data, o, l) p.flags, o = getShort(data, o) if ((p.flags & 0x01) != 0): p.f1, o = getInt(data, o) if ((p.flags & 0x08) != 0): p.fH, o = getShort(data, o) if ((p.flags & 0x10) != 0): p.f2, o = getInt(data, o) if ((p.flags & 0x20) != 0): p.fA, o = getInts(data, o, 2 * (l - 3)) if (len(p.points) > 0): list.append(p) except Exception as e: FreeCAD.Console.PrintError(traceback.format_exc()) FreeCAD.Console.PrintError('\n') FreeCAD.Console.PrintError("%s: o = %d\n" % (e, o)) raise e return list
def getNGonsInts(chunk): o = 0 list = [] data = chunk.data while (o < len(data)): cnt, o = getInt(data, o) points, o = getInts(data, o, cnt) list.append(points) return list
def getNGons5i(data): count, o = getInt(data, 0) ngons = [] while count > 0: p, o = getInts(data, o, 3) o += 8 ngons.append(p) count -= 1 return ngons
def getNGons6i(data): cnt, o = getInt(data, 0) list = [] while (o < len(data)): l, o = getInts(data, o, 6) i = 5 while ((i > 3) and (l[i] < 0)): i -= 1 if (i > 2): list.append(l[1:i]) return list