本文整理汇总了Python中geometry.Geometry.add方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.add方法的具体用法?Python Geometry.add怎么用?Python Geometry.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.Geometry
的用法示例。
在下文中一共展示了Geometry.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: STL
# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import add [as 别名]
#centerbody= STL('nozzle/Centerbody.stl')
centerbody= STL('NozzleSurfacesBin/Centerbody_Bin.stl')
print "STL Load Time: ", time.time()-start_time
start_time = time.time()
n_c = 3
body = Body(centerbody,controls=n_c) #just makes n_C evenly spaced points
#body = Body(centerbody,C,name="centerbody") #uses given tuples of points
body0 = body.copy()
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()
示例2: Body
# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import add [as 别名]
#set up thickness control points
#NOTE: all control points fixed in x
#NOTE: first and last control point fixed in r
n_C = 3 #number control points
C_x = np.linspace(x_min,x_max,n_C)
C_r = np.zeros((n_C,))
C_thickness = np.array(zip(C_x,C_r))
#body = Body(centerbody,n_C=10) #just makes n_C evenly spaced points
shell = Shell(ocowl, icowl, C_centerline, C_thickness, name="cowl") #uses given tuples of points
shell0 = shell.copy()
geom = Geometry()
geom.add(shell0,name="c0")
geom.add(shell,name="cowl")
#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]
示例3: Body
# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import add [as 别名]
#set up control points
X = centerbody.points[:,0]
x_max = np.max(X)
x_min = np.min(X)
n_C = 5 #10 control points
C_x = np.linspace(x_min,x_max,n_C)
C_r = np.zeros((n_C,))
C = np.array(zip(C_x,C_r))
centerbody = Body(centerbody, controls=n_C, r_ref=100, x_ref=1000)
cowl = Shell(outer_cowl, inner_cowl, n_C, n_C, r_ref=100, x_ref=1000)
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,))
示例4: STL
# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import add [as 别名]
cowl = STL('nozzle/cowl.stl')
print "STL Load Time: ", time.time()-start_time
start_time = time.time()
n_c = 10
body = Body(plug, controls=n_c, x_ref=10) #just makes n_C evenly spaced points
shell = Shell(cowl, cowl.copy(), n_c, n_c)
print "Bspline Compute Time: ", time.time()-start_time
start_time = time.time()
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,))