Пример #1
0
def geom_plate(event=None):
    p1,p2,p3,p4,p5 = gp_Pnt(0,0,0),gp_Pnt(0,100,0),gp_Pnt(0,100,100),gp_Pnt(0,0,100),gp_Pnt(50,50,50)
    poly = make_closed_polygon([p1,p2,p3,p4])
    edges = [i for i in Topo(poly).edges()]
    face = make_n_sided(edges, [p5])
    my_renderer = webgl_renderer.WebGlRenderer()
    my_renderer.DisplayShape(face)
Пример #2
0
def geom_plate(event=None):
    p1,p2,p3,p4,p5 = gp_Pnt(0,0,0),gp_Pnt(0,100,0),gp_Pnt(0,100,100),gp_Pnt(0,0,100),gp_Pnt(50,50,50)
    poly = make_closed_polygon([p1,p2,p3,p4])
    edges = [i for i in Topo(poly).edges()]
    face = make_n_sided(edges, [p5])
    my_renderer = webgl_renderer.WebGlRenderer()
    my_renderer.DisplayShape(face)
Пример #3
0
def geom_plate(event=None):
    display.EraseAll()
    p1,p2,p3,p4,p5 = gp_Pnt(0,0,0),gp_Pnt(0,10,0),gp_Pnt(0,10,10),gp_Pnt(0,0,10),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)
Пример #4
0
def geom_plate(event=None):
    display.EraseAll()
    p1,p2,p3,p4,p5 = gp_Pnt(0,0,0),gp_Pnt(0,10,0),gp_Pnt(0,10,10),gp_Pnt(0,0,10),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)
Пример #5
0
def n_sided_patch(event=None):

    # 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),
    )

    # rechts
    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)
Пример #6
0
def n_sided_patch(event=None):

    # 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),
           )

    # rechts
    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)