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


Python CreasePattern.line_pts方法代码示例

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


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

示例1: BeispielCode4

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import line_pts [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

示例2: halfcrane_2sticks

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import line_pts [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

示例3: rhombus_3x1_crane_sticks

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

    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.666, 0],
                [1.5, 0.5, 1.0],
                [0, 0.5, 1],
                [3, 0.5, 1],
                [0.5, 0.5, 1.0],
                [2.5, 0.5, 1.0],
                [0.5, 0.333, 1.0],
                [0.5, 0.667, 1.0],
                [2.5, 0.333, 1.0],
                [2.5, 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],
                       [22, 24],
                       [22, 25],
                       [19, 28],
                       [19, 29],
                       [23, 26],
                       [23, 27],
                       [13, 24],
                       [14, 25],
                       [15, 28],
                       [16, 29],
                       [17, 26],
                       [18, 27],
                       [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],
                   [23, 27]]

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

示例4: rhombus_3x2_crane

# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import line_pts [as 别名]

#.........这里部分代码省略.........
                [48, 50],
                [48, 51],
                [49, 52],
                [49, 53],
                [45, 54],
                [45, 55],
                [50, 24],
                [51, 25],
#                [52, 32],
#                [53, 33],
                [54, 28],
                [55, 29],
                [46, 13],
                [47, 15],
                [35, 12],
                [36, 14]
                ]

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

    cp.grab_pts = [[22, 0],
                   [23, 14],
                   [26, 2],
                   [27, 16],
                   [30, 4],
                   [31, 18],
                   [24, 1],
                   [25, 15],
                   [28, 3],
                   [29, 17],
                   [32, 5],
                   [33, 19]
                   ]
    cp.line_pts = [[37, 49],
                   [38, 50],
                   [48, 63],
                   [49, 64]
                   ]


    cp.cnstr_lhs = [[(34, 2, 1.0)],
                    [(34, 0, 1.0)],
                    [(34, 2, 1.0), (45, 2, -1.0)],
                    [(34, 2, 1.0), (43, 2, -1.0)],
                    [(34, 2, 1.0), (44, 2, -1.0)],
                    [(34, 0, 1.0), (43, 0, -1.0)],
                    [(34, 0, 1.0), (44, 0, -1.0)],
                    [(37, 2, 1.0), (39, 2, -1.0)],
                    [(37, 2, 1.0), (40, 2, -1.0)],
                    [(37, 0, 1.0), (39, 0, -1.0)],
                    [(37, 0, 1.0), (40, 0, -1.0)],
                    [(38, 2, 1.0), (41, 2, -1.0)],
                    [(38, 2, 1.0), (42, 2, -1.0)],
                    [(38, 0, 1.0), (41, 0, -1.0)],
                    [(38, 0, 1.0), (42, 0, -1.0)],
                    [(35, 2, 1.0)],
                    [(36, 2, 1.0)],
                    [(34, 1, 1.0), (36, 1, -1.0)],
                    [(34, 1, 1.0), (35, 1, -1.0)],

                    [(45, 0, 1.0)],
                    [(45, 2, 1.0), (54, 2, -1.0)],
                    [(45, 2, 1.0), (55, 2, -1.0)],
                    [(45, 0, 1.0), (54, 0, -1.0)],
                    [(45, 0, 1.0), (55, 0, -1.0)],
                    [(48, 2, 1.0), (50, 2, -1.0)],
开发者ID:simvisage,项目名称:oricrete,代码行数:70,代码来源:ex06_line_pts.py

示例5: line_test_crane

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

    """

    """

    cp = CreasePattern(n_steps = n_steps)

    cp.nodes = [[0.75, 0.333, 0],
                [0.75, 0.667, 0],
                [2.25, 0.333, 0],
                [2.25, 0.667, 0],
                [1.5, 0.5, 1.5],
                [0, 0.5, 1],
                [3, 0.5, 1],
                [0.8, 0.5, 1.266],
                [2.2, 0.5, 1.266]
#                [0.8, 0.333, 1.0533],
#                [0.8, 0.667, 1.0533],
#                [2.2, 0.333, 1.0533],
#                [2.2, 0.667, 1.0533],
                ]

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

#                       [ 0, 9 ],
#                       [ 1, 10],
#                       [ 2, 11],
#                       [ 3, 12]]

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

    cp.grab_pts = []

    cp.line_pts = [[7, 0],
                   [8, 1]]

    cp.cnstr_lhs = [[(4, 2, 1.0)],
                    #[(0, 1, 1.0)],
                    [(4, 0, 1.0)],
                    #[(4, 1, 1.0)],
                    [(5, 1, 1.0)],
                    [(5, 2, 1.0)],
                    [(6, 1, 1.0)],
                    [(6, 2, 1.0)],
#                    [(7, 2, 1.0), (9, 2, -1.0)],
#                    [(7, 0, 1.0), (9, 0, -1.0)],
#                    [(7, 2, 1.0), (10, 2, -1.0)],
#                    [(7, 0, 1.0), (10, 0, -1.0)],
#                    [(8, 2, 1.0), (11, 2, -1.0)],
#                    [(8, 0, 1.0), (11, 0, -1.0)],
#                    [(8, 2, 1.0), (12, 2, -1.0)],
#                    [(8, 0, 1.0), (12, 0, -1.0)],
                    [(0, 2, 1.0), (1, 2, -1.0)],
                    [(0, 1, 1.0), (1, 1, -1.0)],
                    [(0, 0, 1.0), (1, 0, -1.0)],
                    [(2, 2, 1.0), (3, 2, -1.0)],
                    [(2, 0, 1.0), (3, 0, -1.0)],
                    [(2, 1, 1.0), (3, 1, -1.0)],
                    [(0, 0, 1.0)],
                    [(2, 1, 1.0)],
                    [(0, 1, 1.0)],
                    [(2, 0, 1.0)],
                    [(0, 2, 1.0)],
                    [(2, 2, 1.0)],
                   # [(0, 1, 1.0)],

                    ]

    cp.cnstr_rhs = np.zeros((cp.n_dofs,))
    cp.cnstr_rhs[0] = dx

    X = np.zeros((cp.n_dofs,), dtype = float)
    X[14] = 0.0001
    X[2] = 0.0001
   # X[10] = 0.01
  #  X[11] = 0.01

    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)
    cp.show_iter = True
    X = cp.solve(X)

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


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