本文整理汇总了Python中oricrete.folding.CreasePattern.get_line_position方法的典型用法代码示例。如果您正苦于以下问题:Python CreasePattern.get_line_position方法的具体用法?Python CreasePattern.get_line_position怎么用?Python CreasePattern.get_line_position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oricrete.folding.CreasePattern
的用法示例。
在下文中一共展示了CreasePattern.get_line_position方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rhombus_3x1_crane_sticks
# 需要导入模块: from oricrete.folding import CreasePattern [as 别名]
# 或者: from oricrete.folding.CreasePattern import get_line_position [as 别名]
#.........这里部分代码省略.........
cp.grab_pts = [[13, 0],
[14, 7],
[15, 1],
[16, 8],
[17, 2],
[18, 9]
]
cp.cnstr_lhs = [[(19, 2, 1.0)],
[(19, 1, 1.0)],
[(19, 0, 1.0)],
[(20, 1, 1.0)],
[(20, 2, 1.0)],
[(21, 1, 1.0)],
[(21, 2, 1.0)],
[(22, 0, 1.0), (24, 0, -1.0)],
[(22, 0, 1.0), (25, 0, -1.0)],
[(22, 2, 1.0), (24, 2, -1.0)],
[(22, 2, 1.0), (25, 2, -1.0)],
[(19, 0, 1.0), (28, 0, -1.0)],
[(19, 0, 1.0), (29, 0, -1.0)],
[(19, 2, 1.0), (28, 2, -1.0)],
[(19, 2, 1.0), (29, 2, -1.0)],
[(23, 0, 1.0), (26, 0, -1.0)],
[(23, 0, 1.0), (27, 0, -1.0)],
[(23, 2, 1.0), (26, 2, -1.0)],
[(23, 2, 1.0), (27, 2, -1.0)],
[(14, 1, 1.0), (16, 1, -1.0)],
#[(8, 2, 1.0)],
[(11, 1, 1.0)],
#[(9, 2, 1.0)],
[(11, 0, 1.0)],
[(13, 0, 1.0), (14, 0, -1.0)],
[(16, 1, 1.0), (18, 1, -1.0)],
[(2, 2, 1.0), (4, 2, -1.0)],
#[(13, 2, 1.0), (17, 2, -1.0)],
[(13, 1, 1.0), (15, 1, -1.0)]
]
cp.cnstr_rhs = np.zeros((cp.n_dofs,))
cp.cnstr_rhs[0] = dx
X0 = np.zeros((cp.n_dofs,), dtype = float)
X0[2] = 0.00005
X0[5] = 0.00005
X0[20] = 0.00005
X0[23] = 0.00005
X0[35] = 0.0003
X0[8] = 0.00025
X0[11] = 0.00025
X0[14] = 0.00025
X0[17] = 0.00025
X0[32] = 0.00017
X0[38] = 0.00017
X0[41] = 0.00016334
X0[44] = 0.00016334
X0[47] = 0.00028335
X0[50] = 0.00028335
X0[53] = 0.00016334
X0[56] = 0.00016334
X0[59] = 0.00025
X0[66] = 0.0001
X0[68] = 0.00016334
X0[69] = -0.0001
X0[71] = 0.00016334
X0[72] = 0.0001
X0[74] = 0.00016334
X0[75] = 0.0001
X0[77] = 0.00016334
X0[78] = -0.0001
X0[80] = 0.00016334
X0[81] = -0.0001
X0[83] = 0.00016334
X0[86] = 0.00025
X0[89] = 0.00025
X0 *= 1
np.set_printoptions(threshold = 'nan')
print 'dR', cp.get_G_du(X0)
print 'R', cp.get_G(X0)
print 'L_vct', cp.grab_pts_L
print 'n_dofs', cp.n_dofs
print 'n_c', cp.n_c
print 'n_g', cp.n_g
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(X0)
#print'Iterationnodes', cp.iteration_nodes
cp.get_line_position(0)
return cp