Example #1
0
    def __init__(self):
        plotocc.__init__(self)
        self.shell = read_step_file(self.tmpdir + "SurfUV.stp")
        print(self.shell)
        top = TopExp_Explorer(self.shell, TopAbs_FACE)
        self.face = top.Current()
        print(top.Depth())
        print(self.face)
        self.surf = BRep_Tool.Surface(self.face)

        u0, u1, v0, v1 = shapeanalysis_GetFaceUVBounds(self.face)
        print(u0, u1, v0, v1)
        sas = ShapeAnalysis_Surface(self.surf)
        print(sas.Value(u0, v0))
        print(sas.Value(u0, v1))
        print(sas.Value(u1, v0))
        print(sas.Value(u1, v1))

        u = u0
        while u <= u1:
            v = v0
            while v <= v1:
                p = sas.Value(u, v)
                self.display.DisplayShape(p, update=False)
                v += 1 / 3
            u += 1 / 4
Example #2
0
        while sol_exp.More():
            num += 1
            self.display.DisplayShape(sol_exp.Current(),
                                      color=colors[num % len(colors)],
                                      transparency=0.5)
            sol_exp.Next()
        self.ShowOCC()


if __name__ == "__main__":
    obj = CovExp(touch=False)
    obj.split_run(4)
    # obj.prop_solids()

    sol_exp = TopExp_Explorer(obj.splitter.Shape(), TopAbs_SOLID)
    print(sol_exp.Depth())
    sol_exp.Next()
    sol_exp.Next()
    sol_exp.Next()
    obj.prop_soild(sol_exp.Current())

    obj.display.DisplayShape(obj.splitter.Shape(),
                             color="BLUE",
                             transparency=0.9)
    obj.display.DisplayShape(sol_exp.Current(), transparency=0.5)
    obj.ShowOCC()

    # print(obj.cal_vol())
    # obj.prop_soild(obj.base)

    # sobj.fileout()