def AddPlot(self, plot_cmd):
     if plot_cmd == "cplot":
         plt.cplot(self.nurbs)
     elif plot_cmd == "kplot":
         plt.kplot(self.nurbs)
     elif plot_cmd == "plot":
         plt.plot(self.nurbs)
     elif plot_cmd == "curve":
         plt.curve(self.nurbs)
     elif plot_cmd == "surface":
         plt.surface(self.nurbs)
     elif plot_cmd == "cpoint":
         plt.cpoint(self.nurbs)
     elif plot_cmd == "cwire":
         plt.cwire(self.nurbs)
     elif plot_cmd == "kpoint":
         plt.kpoint(self.nurbs)
     elif plot_cmd == "kwire":
         plt.kwire(self.nurbs)
示例#2
0
文件: ruled.py 项目: ramosapf/igakit
from igakit.cad import *

c1 = line().reverse()
c2 = circle(center=(0, 1), angle=Pi)
S = ruled(c1, c2)

# ---

from igakit.plot import plt
import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass
#plt.use('mayavi')
#plt.use('matplotlib')

plt.figure()
plt.curve(c1, color=(1, 0, 0))
plt.curve(c2, color=(1, 0, 0))
plt.cplot(S)
plt.plot(S)

plt.show()
示例#3
0
import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

vol = make_vol()

plt.figure()
plt.cpoint(vol)
plt.cwire(vol)

plt.figure()
plt.kpoint(vol)
plt.kwire(vol)

plt.figure()
plt.curve(vol)

plt.figure()
plt.surface(vol)

plt.figure()
plt.cplot(vol)
plt.kplot(vol)
plt.plot(vol)

plt.show()
示例#4
0
Lx = LargoX      	#  Horizontal length of the rectangle
Nx = nx    #  number of elements in the horizontal direction (x direction)
p = 1         	#  Order of the basis functions
C = 0         	#  Inter-element continuity

#geom = bilinear([[[ 0.,  0.],[ 0., Ly]],[[ Lx,  0.],[ Lx, Ly]]])
#geom = bilinear([[[ -Lx/2.0,  -Ly/2.0],[ -Lx/2.0, Ly/2.0]],[[ Lx/2.0, -Ly/2.0],[ Lx/2.0, Ly/2.0]]])

points = np.zeros((2,2), dtype='d')
points[0,0] = -Lx/2.0
points[1,0] = +Lx/2.0

geom = linear(points)

geom = refine( geom, factor=1, degree=p)

geom = refine( geom, factor=Nx )

#geom.unclamp(0)
#geom.unclamp(1)


PetIGA().write(fileName, geom, nsd=1)

if 0:
    from igakit.plot import plt
    plt.figure()
    plt.cplot(geom)
    plt.kplot(geom)
    plt.show()
示例#5
0
文件: ruled.py 项目: girving/igakit
from igakit.cad import *

c1 = line().reverse()
c2 = circle(center=(0,1), angle=Pi)
S = ruled(c1, c2)

# ---

from igakit.plot import plt
import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass
#plt.use('mayavi')
#plt.use('matplotlib')

plt.figure()
plt.curve(c1, color=(1,0,0))
plt.curve(c2, color=(1,0,0))
plt.cplot(S)
plt.plot(S)

plt.show()
示例#6
0
from igakit.cad import *

c1 = circle(radius=1, angle=Pi / 2)
c2 = c1.copy().unclamp(0)

from igakit.plot import plt
import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

plt.figure()
plt.cplot(c1)
plt.kplot(c1)

plt.figure()
plt.cplot(c2)
plt.kplot(c2)

plt.show()
示例#7
0
文件: unclamp.py 项目: girving/igakit
from igakit.cad import *

c1 = circle(radius=1, angle=Pi/2)
c2 = c1.copy().unclamp(0)

from igakit.plot import plt
import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

plt.figure()
plt.cplot(c1)
plt.kplot(c1)

plt.figure()
plt.cplot(c2)
plt.kplot(c2)

plt.show()
示例#8
0
文件: refine.py 项目: girving/igakit
# make a ruled surface out of the two arcs
srf = ruled(C0, C1)

# make the radial direction first
srf.transpose()

# refine the surface to have:
#  * 3x6 nonempty knot spans
#  * degree two in both directions
#  * maximum allowable continuity
srf1 = refine(srf, factor=[3,6], degree=2)

# refine the surface to have:
#  * 5x10 nonempty knot spans
#  * degree three in both directions
#  * C^0 continuity
srf2 = refine(srf, factor=[5,10], degree=3, continuity=0)

import sys
from igakit.plot import plt
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass
for nrb in (srf, srf1, srf2):
    plt.figure()
    plt.cplot(nrb)
    plt.kplot(nrb)
plt.show()
示例#9
0
         1, 1, 1, 1,]
    crv = NURBS([U], C)
    return crv

import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

crv = make_crv()

plt.figure()
plt.cpoint(crv)
plt.cwire(crv)

plt.figure()
plt.kpoint(crv)
plt.kwire(crv)

plt.figure()
plt.curve(crv)

plt.figure()
plt.cplot(crv)
plt.kplot(crv)
plt.plot(crv)

plt.show()
示例#10
0
#nrb2 = nrb.clone().refine([],[0.5],[0.25, 0.5, 0.75])

import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass
#plt.use('mayavi')
#plt.use('matplotlib')

plt.figure()
plt.cpoint(nrb)
plt.cwire(nrb)

plt.figure()
plt.kpoint(nrb)
plt.kwire(nrb)

plt.figure()
plt.curve(nrb)
plt.figure()
plt.surface(nrb)

plt.figure()
plt.cplot(nrb)
plt.kplot(nrb)
plt.plot(nrb)

plt.show()
示例#11
0
    return srf

import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

srf = make_srf()

plt.figure()
plt.cpoint(srf)
plt.cwire(srf)

plt.figure()
plt.kpoint(srf)
plt.kwire(srf)

plt.figure()
plt.curve(srf)
plt.figure()
plt.surface(srf)

plt.figure()
plt.cplot(srf)
plt.kplot(srf)
plt.plot(srf)

plt.show()
示例#12
0

import sys
try:
    backend = sys.argv[1]
    plt.use(backend)
except IndexError:
    pass

srf = make_srf()

plt.figure()
plt.cpoint(srf)
plt.cwire(srf)

plt.figure()
plt.kpoint(srf)
plt.kwire(srf)

plt.figure()
plt.curve(srf)
plt.figure()
plt.surface(srf)

plt.figure()
plt.cplot(srf)
plt.kplot(srf)
plt.plot(srf)

plt.show()