Source

igakit / demo / refine.py

from igakit.cad import *

# create two quarter circles
R0 = 1.0
R1 = 2.0
C0 = circle(radius=R0, angle=Pi/2)
C1 = circle(radius=R1, angle=Pi/2)

# 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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.