当前位置: 首页>>代码示例>>Python>>正文


Python CreasePattern.crease_lines方法代码示例

本文整理汇总了Python中oricrete.folding.CreasePattern.crease_lines方法的典型用法代码示例。如果您正苦于以下问题:Python CreasePattern.crease_lines方法的具体用法?Python CreasePattern.crease_lines怎么用?Python CreasePattern.crease_lines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oricrete.folding.CreasePattern的用法示例。


在下文中一共展示了CreasePattern.crease_lines方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: BeispielCode2

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def BeispielCode2():    
    cp = CreasePattern()

    cp.nodes = [[0, 0, 0],
                [1, 0, 0],
                [1, 1, 0]]

    cp.crease_lines = [[0, 1],
                       [1, 2],
                       [2, 0]]
    cp.facets = [[0, 1, 2]]
    cp.cnstr_lhs = [[(0, 0, 1.0)],
                    [(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(1, 2, 1.0)],
                    [(2, 2, 1.0)]]

    cp.cnstr_rhs = [0, 0, 0, 0, 0, 0.5]

    X0 = [0, 0, 0, 0, 0, 0, 0, 0, 0.1]

    X = cp.solve(X0)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:27,代码来源:Beispielcode+2.py

示例2: BeispielCode3

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def BeispielCode3():    
    cp = CreasePattern()

    cp.nodes = [[0, 0, 0],
                [1, 0, 0],
                [1, 1, 0],
                [0.5, 0.3, 0]] #Knoten fuer Grabpoint Element
    cp.crease_lines = [[0, 1],
                       [1, 2],
                       [2, 0]]
    
    cp.facets = [[0, 1, 2]]
    
    cp.grab_pts = [[3, 0]]
    
    cp.cnstr_lhs = [[(0, 0, 1.0)],
                    [(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(2, 1, 1.0)],
                    [(3, 2, 1.0)]]

    cp.cnstr_rhs = [0, 0, 0, 0, 0, 0.3]

    X0 = [0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0]

    X = cp.solve(X0)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:31,代码来源:Beispielcode3.py

示例3: BeispielCode4

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def BeispielCode4():    
    cp = CreasePattern()

    cp.nodes = [[ 0, 0, 1.0 ],
                [ 1, 0, 1.5 ],
                [ 0.5, 0.0, 0.0],
                [ 0.1, 0, 1.05]]

    cp.crease_lines = [[ 0, 1 ],
                       [ 2, 3 ]]
    
    cp.facets = [[0, 1, 3]]

    cp.line_pts = [[3, 0]]
    
    cp.cnstr_lhs = [[(3, 0, 1.0)],
                    [(1, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(0, 1, 1.0)],
                    [(2, 0, 1.0)],
                    [(2, 1, 1.0)],
                    [(0, 0, 1.0)]]

    cp.cnstr_rhs = [1.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    
    X0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0, 0]

    X = cp.solve(X0)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:33,代码来源:Beispielcode4.py

示例4: twotriangle_stick_cnstr

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def twotriangle_stick_cnstr(n_steps = 10, dx = -0.3299999999999):
    """
        This example shows the use of Grabpoints an Sticks in a more complex creasepattern.
    """

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ],
                [ 1, 1, 0],
                [0.667, 0.333, 0],
                [0.66, 0.33, 1],
                [ 0, 1, 0]]

    cp.crease_lines = [[ 0, 1 ],
                       [ 1, 2 ],
                       [ 2, 0 ],
                       [ 3, 4],
                       [ 0, 5],
                       [ 5, 2]]

    cp.facets = [[0, 1, 2 ],
                 [2, 5, 0]]

    cp.grab_pts = [[3, 0]  ]

    cp.cnstr_lhs = [
                    [(0, 0, 1.0)],
                    [(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(1, 2, 1.0)],
                    [(4, 2, 1.0)],
                    [(4, 0, 1.0)],
                    [(4, 1, 1.0)],
                    [(5, 2, 1.0)]]

    cp.cnstr_rhs = [0.0, 0.0, 0.0, 0.0, 0.0
                    , dx, 0.0, 0.0, 0.0
                    ]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[1] = 0.01

    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_G(X)
    print 'initial G_du\n', cp.get_G_du(X)

    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:61,代码来源:ex05_triangle.py

示例5: triangle_cp_cnstr

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def triangle_cp_cnstr(n_steps = 10, dx = -0.3299999999999):

    """
        This example demonstrates the main funtions of Grabpoints.
        Two Grabpoints are integrated in a single triangle.
        Grabpoint one is used as regulare constrain moved in z-direction.
        Grabpoint two is used as control point, which gives back the coordinations of
        an exact point on the face in every iteration step.

    """

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ],
                [ 1, 1, 0],
                [0.667, 0.333, 0],
                [0.2, 0.1, 0]]

    cp.crease_lines = [[ 0, 1 ],
                       [ 1, 2 ],
                       [ 2, 0 ]]

    cp.facets = [[0, 1, 2 ]]

    cp.grab_pts = [[3, 0],
                   [4, 0]]

    cp.cnstr_lhs = [[(0, 0, 1.0)],
                    [(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(1, 2, 1.0)],
                    [(3, 2, 1.0)]]

    cp.cnstr_rhs = [0.0, 0.0, 0.0, 0.0, 0.0
                    , dx, 0.0, 0.0]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[1] = 0.01

    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors
    print 'initial R\n', cp.get_G(X)
    print 'initial G_du\n', cp.get_G_du(X)

#    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:57,代码来源:ex05_triangle.py

示例6: triangle_stick_cnstr

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def triangle_stick_cnstr(n_steps = 10, dx = -0.3299999999999):
    """
        This example shows new options of lines, as beams connected to grabpoints.
        This could be usefull for simulation the crane lifting up the oricrete construction.

    """
    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ],
                [ 1, 1, 0],
                [0.667, 0.333, 0],
                [0.1, 0.05, 0],
                [0.66, 0.33, 2]]

    cp.crease_lines = [[ 0, 1 ],
                       [ 1, 2 ],
                       [ 2, 0 ],
                       [ 3, 5]]

    cp.facets = [[0, 1, 2 ]]

    cp.grab_pts = [[3, 0],
                   [4, 0]]

    cp.cnstr_lhs = [[(0, 0, 1.0)],
                    [(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 1, 1.0)],
                    [(1, 2, 1.0)],
                    [(5, 2, 1.0)],
                    [(5, 0, 1.0)],
                    [(5, 1, 1.0)]]

    cp.cnstr_rhs = [0.0, 0.0, 0.0, 0.0, 0.0
                    , dx, 0.0, 0.0]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[1] = 0.01

    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_G(X)
    print 'initial G_du\n', cp.get_G_du(X)

    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:57,代码来源:ex05_triangle.py

示例7: halfcrane_2sticks

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def halfcrane_2sticks(n_steps = 10, dx = 1.5):

    """

    """

    cp = CreasePattern(n_steps = n_steps, MAX_ITER = 5000)

    cp.nodes = [[ 0, 0, 1.0 ],
                [ 1, 0, 1.15 ],
                [ 0.5, 0.5, -0.5],
                [ 0.5, -0.5, -0.5],
               # [ 0.5, 0, 0.75],
                [ 0.5, 0, 1.075]]

    cp.crease_lines = [[ 0, 1 ],
                       [ 2, 4 ],
                       [ 3, 4]]

    cp.facets = [[0, 1, 4]]

    cp.grab_pts = []

    cp.line_pts = [[4, 0],
                   #[4, 0]
                   ]

    cp.cnstr_lhs = [[(1, 2, 1.0)],
                    [(1, 0, 1.0)],
                    [(1, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(0, 1, 1.0)],
                    [(2, 0, 1.0), (3, 0, -1.0) ],
                    [(2, 1, 1.0), (3, 1, -1.0)],
                    [(2, 2, 1.0), (3, 2, -1.0)],
                    [(3, 2, 1.0)],
                    [(3, 0, 1.0)]]

    cp.cnstr_rhs = [dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[5] = 0.0001
    X[9] = 0.0001
   # X[10] = 0.01
  #  X[11] = 0.01
    X *= 1
    print 'necessary constraints', cp.n_dofs - cp.n_c - cp.n_g * cp.n_d - cp.n_l * 2
    print 'cnstr', len(cp.cnstr_lhs)

    print 'initial R\n', cp.get_G(X)
    print 'initial dR\n', cp.get_G_du(X)
    #cp.show_iter = True
    X = cp.solve(X)

    return cp
开发者ID:simvisage,项目名称:oricrete,代码行数:57,代码来源:ex06_line_pts.py

示例8: moving_truss_cp_square

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def moving_truss_cp_square(n_steps = 40):

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 2, 0 ],
                [ 0, 0, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]

    face_z_0 = CF(Rf = z_ - 0)
    face_x_0 = CF(Rf = x_ - 0)
#    face_xy_135 = CF(Rf = x_ + y_ - 1.0)
#    face_xy_round = CF(Rf = x_**2 + (y_)**2 - 1.0)
#    face_x_1_t = CF(Rf = x_ - 1.0 + 1.99 * t_)
#    argument =  2*3.14159*t_   
#    face_x_1_t = CF(Rf = y_ + 3 + sp.sin(argument))
    face_x_1_t = CF(Rf = y_ - 1.0 * (t_ - 1) * sp.Heaviside(t_ - 1)
                    + 1.0 * (t_ - 3) * sp.Heaviside(t_ - 3)
                    + 1.0 * (t_ - 5) * sp.Heaviside(t_ - 5)
                    - 1.0 * (t_ - 7) * sp.Heaviside(t_ - 7))

    face_y_1_t = CF(Rf = x_ + 1.0 * t_ * sp.Heaviside(t_)
                    - 1.0 * (t_ - 1) * sp.Heaviside(t_ - 1)
                    - 1.0 * (t_ - 3) * sp.Heaviside(t_ - 3)
                    + 1.0 * (t_ - 5) * sp.Heaviside(t_ - 5)
                    + 1.0 * (t_ - 7) * sp.Heaviside(t_ - 7)
                    - 1.0 * (t_ - 8) * sp.Heaviside(t_ - 8))
# +3.14159/2.0    
#    face_x_1_t = CF(Rf = y_ - 1.99 * t_)
    cp.cf_lst = [(face_z_0, [0, 1]),
                    (face_x_0, [0]),
                    (face_x_1_t, [1]),
                    (face_y_1_t, [1])]

    X = np.zeros((cp.n_dofs,), dtype = float)
#    X[1] = 0.01
#    X[0] = 0.01


    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_G(X)
    print 'initial dR\n', cp.get_G_du(X)

    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:56,代码来源:ex01_moving_truss.py

示例9: moving_truss_cp_circle

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def moving_truss_cp_circle(n_steps = 40):

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 1, 0 ],
                [ 0, -1, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]

    face_z_0 = FF(Rf = z_ - 0)
    face_x_0 = FF(Rf = x_ - 0)
#    face_xy_135 = FF(Rf = x_ + y_ - 1.0)
#    face_xy_round = FF(Rf = x_**2 + (y_)**2 - 1.0)
#    face_x_1_t = FF(Rf = x_ - 1.0 + 1.99 * t_)
#    argument =  2*3.14159*t_   
#    face_x_1_t = FF(Rf = y_ + 3 + sp.sin(argument))
    face_x_1_t = FF(Rf = y_ + sp.cos(1.0 * t_))
    face_y_1_t = FF(Rf = x_ + sp.sin(1.0 * t_))
# +3.14159/2.0    
#    face_x_1_t = FF(Rf = y_ - 1.99 * t_)
    cp.cnstr_lst = [(face_z_0, [0, 1]),
                    (face_x_0, [0]),
                    (face_x_1_t, [1]),
                    (face_y_1_t, [1])]

    X = np.zeros((cp.n_dofs,), dtype = float)
#    X[1] = 0.01
#    X[0] = 0.01


    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_R(X)
    print 'initial dR\n', cp.get_dR(X)

    X = cp.solve_ff(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:MatthiasSch,项目名称:local,代码行数:47,代码来源:ex01_moving_truss.py

示例10: BeispielCode5

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def BeispielCode5():    
    cp = CreasePattern()

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]
    
    cp.cnstr_lhs = [[(0, 1, 1.0)],
                    [(0, 2, 1.0)],
                    [(0, 0, 1.0)],
                    [(1, 2, 1.0)],
                    [(0, 1, 0.5), (1, 1, -1.0)]]

    cp.cnstr_rhs = [1.0, 0.0, 0.0, 0.0, 0.0]
    
    X0 = [0, 0, 0, 0, 0.1, 0]

    X = cp.solve(X0)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:23,代码来源:Beispielcode5.py

示例11: moving_truss_cp_ff_cnstr

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def moving_truss_cp_ff_cnstr(n_steps = 10, dx = -1.99):

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]

    face_z_0 = CF(Rf = z_ - 0)
    face_x_0 = CF(Rf = x_ - 0)
    face_x_1_t = CF(Rf = x_ - 1.0 + 1.99 * t_)
    cp.cf_lst = [(face_z_0, [0, 1]),
                    (face_x_0, [0]),
                    (face_x_1_t, [1])]

    cp.cnstr_lhs = [
                    [(1, 0, 1.0), (1, 1, 1.0)],
                    ]

    cp.cnstr_rhs = [0]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[1] = 0.01

    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_G(X)
    print 'initial dR\n', cp.get_G_du(X)

    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:42,代码来源:ex01_moving_truss.py

示例12: moving_truss_cp_cnstr

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def moving_truss_cp_cnstr(n_steps = 10, dx = -1.99):

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]

    cp.cnstr_lhs = [
                    [(0, 0, 1.0)],
                    [(0, 2, 1.0)],
                    [(1, 0, 1.0)],
                    [(1, 0, 1.0), (1, 1, 1.0)],
                    [(1, 2, 1.0)]
                    ]

    cp.cnstr_rhs = [0.0, 0.0, dx, 0.0, 0.0]

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[1] = 0.01

    print 'initial lengths\n', cp.c_lengths
    print 'initial vectors\n', cp.c_vectors

    print 'initial R\n', cp.get_G(X)
    print 'initial dR\n', cp.get_G_du(X)

    X = cp.solve(X)

    print '========== results =============='
    print 'solution X\n', X
    print 'final positions\n', cp.get_new_nodes(X)
    print 'final vectors\n', cp.get_new_vectors(X)
    print 'final lengths\n', cp.get_new_lengths(X)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:39,代码来源:ex01_moving_truss.py

示例13: BeispielCode6

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def BeispielCode6():
    cp = CreasePattern()

    cp.nodes = [[ 0, 0, 0 ],
                [ 1, 0, 0 ]]

    cp.crease_lines = [[ 0, 1 ]]

    face_z_0 = CF(Rf = z_ - 0)
    face_x_0 = CF(Rf = x_ - 0)
    face_x_1_t = CF(Rf = x_ - 1.0 + 1. * t_)
    cp.cf_lst = [(face_z_0, [0, 1]),
                    (face_x_0, [0]),
                    (face_x_1_t, [1])]

    cp.cnstr_lhs = [[(1, 1, 1.0)]]

    cp.cnstr_rhs = [0]

    X0 = [0, 0, 0, 0, 0.01, 0]

    X = cp.solve_CF(X0)

    return cp
开发者ID:kelidas,项目名称:oricrete,代码行数:26,代码来源:Beispielcode6.py

示例14: rhombus_3x1_crane

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def rhombus_3x1_crane(n_steps = 10, dx = 1.0):
    '''
        This is a first modell of the which should lift the creasepattern.
        It shows a configuration of constrains in which the crane will lift the pattern
        in the expectet form. NOTE: There is no influence of gravity.
    '''

    cp = CreasePattern(n_steps = n_steps, MAX_ITER = 500)

    cp.nodes = [[0, 0, 0], #0
                [0, 1, 0],
                [1, 0, 0],
                [1, 1, 0],
                [2, 0, 0],
                [2, 1, 0], #5
                [3, 0, 0],
                [3, 1, 0],
                [0, 0.5, 0],
                [3, 0.5, 0],
                [0.5, 0.5, 0], #10
                [1.5, 0.5, 0],
                [2.5, 0.5, 0],
                [0.5, 0.333, 0], #13
                [0.5, 0.667, 0],
                [1.5, 0.333, 0],
                [1.5, 0.667, 0],
                [2.5, 0.333, 0],
                [2.5, 0.667, 0],
                [1.5, 0.5, 1.0],
                [0, 0.5, 1], #20
                [3, 0.5, 1],
                [0, 0.333, 1.0],
                [0, 0.667, 1.0],
                [3, 0.333, 1.0],
                [3, 0.667, 1.0],
                [1.5, 0.333, 1.0],
                [1.5, 0.667, 1.0]
                ]

    cp.crease_lines = [[0, 2], #0
                       [0, 8],
                       [0, 10],
                       [1, 3],
                       [1, 8],
                       [1, 10],
                       [2, 4],
                       [2, 10],
                       [2, 11],
                       [3, 5],
                       [3, 10], #10
                       [3, 11],
                       [4, 6],
                       [4, 11],
                       [4, 12],
                       [5, 7],
                       [5, 11],
                       [5, 12],
                       [6, 9],
                       [6, 12],
                       [7, 9], #20
                       [7, 12],
                       [8, 10],
                       [9, 12],
                       [10, 11],
                       [11, 12],

                       [19, 20], #26
                       [19, 21],
                       [20, 22],
                       [20, 23],
                       [19, 26],
                       [19, 27],
                       [21, 24],
                       [21, 25],
                       [13, 22],
                       [14, 23],
                       [15, 26],
                       [16, 27],
                       [17, 24],
                       [18, 25],
                      # [20, 8],
                      # [9, 21]
                       ]

    cp.facets = [[0, 2, 10],
                 [2, 4, 11],
                 [4, 6, 12],
                 [2, 11, 10],
                 [4, 11, 12],
                 [0, 8, 10],
                 [6, 9, 12],
                 [1, 3, 10],
                 [3, 5, 11],
                 [5, 7, 12],
                 [3, 10, 11],
                 [5, 11, 12],
                 [1, 8, 10],
                 [7, 9, 12]
                 ]
    #cp.line_pts = [[22, 26],
#.........这里部分代码省略.........
开发者ID:simvisage,项目名称:oricrete,代码行数:103,代码来源:ex08_crane_model_3.py

示例15: rhombus_3x2_crane

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import crease_lines [as 别名]
def rhombus_3x2_crane(n_steps = 10, dx = 1):
    """
        This example shows a 3x2 rhombus creasepattern.

    """
    cpr = YoshimuraCreasePattern(n_steps = n_steps,
                              L_x = 3,
                              L_y = 2,
                              n_x = 3,
                              n_y = 4,
                              MAX_ITER = 5000)

    X_rcp = cpr.generate_X0()
    X_rcp = X_rcp.reshape((-1, 3))
    X_rcp[:, 2] += -0.1559

    cp = CreasePattern(n_steps = n_steps, MAX_ITER = 500)

    cp.nodes = cpr.nodes

    cp.crease_lines = cpr.crease_lines

    cp.facets = cpr.facets

    grab_nodes = [[0.5, 0.333, 0],
                  [0.5, 0.667, 0],
                  [0.5, 1.333, 0],
                  [0.5, 1.667, 0],
                  [1.5, 0.333, 0],
                  [1.5, 0.667, 0],
                  [1.5, 1.333, 0],
                  [1.5, 1.667, 0],
                  [2.5, 0.333, 0],
                  [2.5, 0.667, 0],
                  [2.5, 1.333, 0],
                  [2.5, 1.667, 0]]#33

    crane_nodes = [[1.5, 0.5, 1.0], #34
                   [0.5, 0.5, 1],
                   [2.5, 0.5, 1],
                   [0.5, 0.333, 1.0],
                   [0.5, 0.667, 1.0], #38
                   [2.5, 0.333, 1.0],
                   [2.5, 0.667, 1.0],
                   [1.5, 0.333, 1.0],
                   [1.5, 0.667, 1.0],

                   [1.5, 1.5, 1.0], #43
                   [0.5, 1.5, 1],
                   [2.5, 1.5, 1],
                   [0.5, 1.333, 1.0], #46
                   [0.5, 1.667, 1.0],
                   [2.5, 1.333, 1.0],
                   [2.5, 1.667, 1.0],
                   [1.5, 1.333, 1.0],
                   [1.5, 1.667, 1.0], #51
                   ]

    cp.nodes = np.vstack([cp.nodes, grab_nodes])
    cp.nodes = np.vstack([cp.nodes, crane_nodes])


    crane_cl = [#crane 1
                [34, 35], #49
                [34, 36],
                [35, 37],
                [35, 38],
                [36, 39],
                [36, 40],
                [34, 41], #55
                [34, 42],

                [37, 22],
                [38, 23], #60
                [39, 30],
                [40, 31],
                [41, 26],
                [42, 27],
                #crane 2
                [43, 44], #65
                [43, 45],
                [44, 46],
                [44, 47],
                [45, 48],
                [45, 49],
                [43, 50],
                [43, 51],
                [46, 24],
                [47, 25],
                [48, 32],
                [49, 33],
                [50, 28],
                [51, 29],

                ]

    cp.crease_lines = np.vstack([cp.crease_lines, crane_cl])

    cp.grab_pts = [[22, 0],
                   [23, 14],
#.........这里部分代码省略.........
开发者ID:simvisage,项目名称:oricrete,代码行数:103,代码来源:ex08_crane_model_3.py


注:本文中的oricrete.folding.CreasePattern.crease_lines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。