예제 #1
0
def makeFace(event=None):
    global myFaceProfile
    myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile)
    if myFaceProfile.IsDone():
        bottomFace = myFaceProfile.Face()
    display.DisplayShape(bottomFace, color='YELLOW', transparency=0.6)
    display.Repaint()
    win.statusBar().showMessage('Make face complete')
예제 #2
0
파일: __init__.py 프로젝트: ocastrup/OCX
 def __init__(self, wire: TopoDS_Wire):
     super().__init__()
     mkface = BRepBuilderAPI_MakeFace(wire)
     if not mkface.IsDone():
         OCCWrapper.OccError('OccFaceFromWire', mkface)
     else:
         self.done = True
         self.face = mkface.Face()
     return
예제 #3
0
def holes_in_face():
    aPlane = gp_Pln()
    print(type(gp_Pln()))
    print(type(gp_XOY()))

    aCircle1 = gp_Circ(gp_XOY(), 1.0)
    aCircle2 = gp_Circ(gp_XOY(), 1.0)
    aCircle3 = gp_Circ(gp_XOY(), 1.0)

    aCircle1.SetLocation(gp_Pnt(3.0, 3.0, 0.0))
    aCircle2.SetLocation(gp_Pnt(7.0, 3.0, 0.0))
    aCircle3.SetLocation(gp_Pnt(3.0, 7.0, 0.0))

    anEdgeMaker1 = BRepBuilderAPI_MakeEdge(aCircle1)
    anEdgeMaker2 = BRepBuilderAPI_MakeEdge(aCircle2)
    anEdgeMaker3 = BRepBuilderAPI_MakeEdge(aCircle3)

    aWireMaker1 = BRepBuilderAPI_MakeWire(anEdgeMaker1.Edge())
    aWireMaker2 = BRepBuilderAPI_MakeWire(anEdgeMaker2.Edge())
    aWireMaker3 = BRepBuilderAPI_MakeWire(anEdgeMaker3.Edge())

    aFaceMaker = BRepBuilderAPI_MakeFace(aPlane, 0.0, 10.0, 0.0, 10.0)

    if aWireMaker1.IsDone():
        aWire1 = aWireMaker1.Wire()
        aWire1.Reverse()  # Makes this a hole in outer profile
        aFaceMaker.Add(aWire1)

    if aWireMaker2.IsDone():
        aWire2 = aWireMaker2.Wire()
        aWire2.Reverse()  # Makes this a hole in outer profile
        aFaceMaker.Add(aWire2)

    if aWireMaker3.IsDone():
        aWire3 = aWireMaker3.Wire()
        aWire3.Reverse()  # Makes this a hole in outer profile
        aFaceMaker.Add(aWire3)

    if not aFaceMaker.IsDone():
        raise AssertionError("shape not Done.")

    return aFaceMaker.Shape()
예제 #4
0
    bound_poly_1 = proj.Current()

    axis_2 = axis.Transformed(trsf)
    axis_2.Translate(gp_Pnt(0, 0, 0), gp_Pnt(0, 2, 0))
    poly_2 = obj.make_PolyWire(num=10, axs=axis_2)
    proj = BRepProj_Projection(poly_2, face, axis.Direction())
    bound_poly_2 = proj.Current()

    proj = BRepProj_Projection(poly_0, face, axis.Direction())
    bound_poly = proj.Current()
    print(bound_poly)
    print(surf)
    api = BRepBuilderAPI_MakeFace(surf, 1.0)
    api.Add(bound_poly)
    bound_face = api.Face()
    print(api.IsDone())
    #api = BRepBuilderAPI_MakeFace(bound_face, bound_poly_1)
    #bound_face = api.Face()

    print(face.Location().Transformation())
    obj.display.DisplayShape(face, color="BLUE", transparency=0.9)
    obj.display.DisplayShape(bound_face, color="RED", transparency=0.9)
    obj.display.DisplayShape(poly_0)
    obj.display.DisplayShape(poly_1)
    obj.display.DisplayShape(poly_2)
    obj.display.DisplayShape(bound_poly_0)
    obj.display.DisplayShape(bound_poly_1)
    obj.display.DisplayShape(bound_poly_2)
    obj.display.DisplayShape(bound_poly)

    #write_step_file(face, obj.tempname + "_org.stp")
예제 #5
0
def make_face(*args):
    face = BRepBuilderAPI_MakeFace(*args)
    assert face.IsDone()
    result = face.Face()
    return result
예제 #6
0
def make_face(*args):
    face = BRepBuilderAPI_MakeFace(*args)
    if not face.IsDone():
        raise AssertionError("Face not done")
    result = face.Face()
    return result
예제 #7
0
 def makeWpBorder(self, size):
     wireProfile = self.makeSqProfile(size)
     myFaceProfile = BRepBuilderAPI_MakeFace(wireProfile)
     if myFaceProfile.IsDone():
         border = myFaceProfile.Face()
     return border  # TopoDS_Face
예제 #8
0
def makeFace():
    global myFaceProfile
    myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile)
    if myFaceProfile.IsDone():
        bottomFace = myFaceProfile.Face()
    return bottomFace