def geom_plate(event=None):
    display.EraseAll()
    p1 = gp_Pnt(0, 0, 0)
    p2 = gp_Pnt(0, 10, 0)
    p3 = gp_Pnt(0, 10, 10)
    p4 = gp_Pnt(0, 0, 10)
    p5 = gp_Pnt(5, 5, 5)
    poly = make_closed_polygon([p1, p2, p3, p4])
    edges = [i for i in Topo(poly).edges()]
    face = make_n_sided(edges, [p5])
    display.DisplayShape(edges)
    display.DisplayShape(make_vertex(p5))
    display.DisplayShape(face, update=True)
def geom_plate(event=None):
    display.EraseAll()
    p1 = gp_Pnt(0, 0, 0)
    p2 = gp_Pnt(0, 10, 0)
    p3 = gp_Pnt(0, 10, 10)
    p4 = gp_Pnt(0, 0, 10)
    p5 = gp_Pnt(5, 5, 5)
    poly = make_closed_polygon([p1, p2, p3, p4])
    edges = [i for i in Topo(poly).edges()]
    face = make_n_sided(edges, [p5])
    display.DisplayShape(edges)
    display.DisplayShape(make_vertex(p5))
    display.DisplayShape(face, update=True)
Beispiel #3
0
def n_sided_patch():

    # left
    pts1 = (
        gp_Pnt(0, 0, 0.0),
        gp_Pnt(0, 1, 0.3),
        gp_Pnt(0, 2, -0.3),
        gp_Pnt(0, 3, 0.15),
        gp_Pnt(0, 4, 0),
    )
    # front
    pts2 = (
        gp_Pnt(0, 0, 0.0),
        gp_Pnt(1, 0, -0.3),
        gp_Pnt(2, 0, 0.15),
        gp_Pnt(3, 0, 0),
        gp_Pnt(4, 0, 0),
    )
    # back
    pts3 = (
        gp_Pnt(0, 4, 0),
        gp_Pnt(1, 4, 0.3),
        gp_Pnt(2, 4, -0.15),
        gp_Pnt(3, 4, 0),
        gp_Pnt(4, 4, 1),
    )
    # right
    pts4 = (
        gp_Pnt(4, 0, 0),
        gp_Pnt(4, 1, 0),
        gp_Pnt(4, 2, 0.3),
        gp_Pnt(4, 3, -0.15),
        gp_Pnt(4, 4, 1),
    )

    spl1 = points_to_bspline(pts1)
    spl2 = points_to_bspline(pts2)
    spl3 = points_to_bspline(pts3)
    spl4 = points_to_bspline(pts4)

    edges = map(make_edge, [spl1, spl2, spl3, spl4])
    verts = map(make_vertex, chain(pts1, pts2, pts3, pts4))
    f1 = make_n_sided(edges, [])

    display.DisplayShape(edges)
    display.DisplayShape(verts)
    display.DisplayShape(f1, update=True)
def n_sided_patch():

    # left
    pts1 = (gp_Pnt(0, 0, 0.0),
            gp_Pnt(0, 1, 0.3),
            gp_Pnt(0, 2, -0.3),
            gp_Pnt(0, 3, 0.15),
            gp_Pnt(0, 4, 0),
            )
    # front
    pts2 = (gp_Pnt(0, 0, 0.0),
            gp_Pnt(1, 0, -0.3),
            gp_Pnt(2, 0, 0.15),
            gp_Pnt(3, 0, 0),
            gp_Pnt(4, 0, 0),
            )
    # back
    pts3 = (gp_Pnt(0, 4, 0),
            gp_Pnt(1, 4, 0.3),
            gp_Pnt(2, 4, -0.15),
            gp_Pnt(3, 4, 0),
            gp_Pnt(4, 4, 1),
            )
    # right
    pts4 = (gp_Pnt(4, 0, 0),
            gp_Pnt(4, 1, 0),
            gp_Pnt(4, 2, 0.3),
            gp_Pnt(4, 3, -0.15),
            gp_Pnt(4, 4, 1),
            )

    spl1 = points_to_bspline(pts1)
    spl2 = points_to_bspline(pts2)
    spl3 = points_to_bspline(pts3)
    spl4 = points_to_bspline(pts4)

    edges = map(make_edge, [spl1, spl2, spl3, spl4])
    verts = map(make_vertex, chain(pts1, pts2, pts3, pts4))
    f1 = make_n_sided(edges, [])

    display.DisplayShape(edges)
    display.DisplayShape(verts)
    display.DisplayShape(f1, update=True)