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


Python Geometry.deform方法代码示例

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


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

示例1: Geometry

# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import deform [as 别名]
geom = Geometry()
#geom.add(body0,name="cb0")
geom.add(body,name="centerbody")

#params = geom.get_params() #params['centerbody'] = [(0,0),]

print "Bspline Compute Time: ", time.time()-start_time
start_time = time.time()

deltaC_x = np.zeros((n_c,))
deltaC_r = np.zeros((n_c,))
deltaC_r[-1] = 10 #second to last element, set to 10
deltaC = np.array(zip(deltaC_x,deltaC_r))

geom.deform(centerbody=deltaC)

print "Run Time: ", time.time()-start_time
start_time = time.time()
    
geom.writeSTL('new.stl', ascii=False)

print "STL Write Time: ", time.time()-start_time
start_time = time.time()

geom.writeFEPOINT('deform.dat')

print "FEPoint Write Time: ", time.time()-start_time


#geometry.writeSTL('new.stl',body.coords.cartesian,ascii=False)
开发者ID:JustinSGray,项目名称:pyBspline,代码行数:32,代码来源:test_body.py

示例2:

# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import deform [as 别名]
#params = geom.get_params() #params['centerbody'] = [(0,0),]

print "Bspline Compute Time: ", time.time()-start_time
start_time = time.time()

#calculate new P's

deltaC_x = [0,0,0]
deltaC_r = [0,0,0]
deltaC_c = np.array(zip(deltaC_x,deltaC_r))

deltaC_x = [0,0,0]
deltaC_r = [0,1,0]
deltaC_t = np.array(zip(deltaC_x,deltaC_r))

geom.deform(cowl=(deltaC_c, deltaC_t))


print "Run Time: ", time.time()-start_time
start_time = time.time()

geom.writeSTL('new.stl', ascii=False)

print "STL Write Time: ", time.time()-start_time
start_time = time.time()


geom.writeFEPOINT('deform.dat')

print "FEPoint Write Time: ", time.time()-start_time
开发者ID:JustinSGray,项目名称:pyBspline,代码行数:32,代码来源:test_shell.py

示例3: Shell

# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import deform [as 别名]
shroud = Shell(outer_shroud, inner_shroud, n_C, n_C, r_ref=100, x_ref=1000)

geom = Geometry()
geom.add(centerbody, name="centerbody")
geom.add(cowl, name="cowl")
geom.add(shroud, name="shroud")

print "Geom Calc Time: ", time.time()-start_time
start_time = time.time()

deltaC_x = np.zeros((n_C,))
deltaC_x[3:] = 1
deltaC_r = np.zeros((n_C,))
deltaC_r[3] = 1 #second to last element, set to 10
deltaC = np.array(zip(deltaC_x,deltaC_r))
geom.deform(centerbody=deltaC)


deltaC_cx = np.zeros((n_C,))
deltaC_cr = np.zeros((n_C,))
deltaC_cx[2:] = 1 #second to last element, set to 10
deltaC_c = np.array(zip(deltaC_cx,deltaC_cr))
deltaC_tx = np.zeros((n_C,))
deltaC_tr = np.zeros((n_C,))
deltaC_t = np.array(zip(deltaC_tx,deltaC_tr))
geom.deform(cowl=(deltaC_c,deltaC_t))


import pylab as p
profile = geom.project_profile()
for point_set in profile: 
开发者ID:JustinSGray,项目名称:pyBspline,代码行数:33,代码来源:test_combined.py

示例4: Geometry

# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import deform [as 别名]

geom = Geometry()
geom.add(body,name="plug")
geom.add(shell,name="cowl")

orig_points = geom.points.copy()

print "Geometry Object Building: ", time.time()-start_time
start_time = time.time()

deltaC_x = np.zeros((n_c,))
deltaC_r = np.zeros((n_c,))
# deltaC_x[3:] = 2 #second to last element, set to 10
deltaC = np.array(zip(deltaC_x,deltaC_r))
geom.deform(plug=deltaC)


deltaC_cx = np.zeros((n_c,))
deltaC_cr = np.zeros((n_c,))
# deltaC_cr[:] = 3 #second to last element, set to 10
deltaC_c = np.array(zip(deltaC_cx,deltaC_cr))
deltaC_tx = np.zeros((n_c,))
deltaC_tr = np.zeros((n_c,))
# deltaC_tr[:-1] = 1 #second to last element, set to 10
deltaC_t = np.array(zip(deltaC_tx,deltaC_tr))
geom.deform(cowl=(deltaC_c,deltaC_t))


print "Run Time: ", time.time()-start_time
start_time = time.time()
开发者ID:JustinSGray,项目名称:pyBspline,代码行数:32,代码来源:simple_nozzle.py


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