 |
3D Kuen Surface using interactve JavaView
Source code name: "javaview_kuen_surface.py"
Programming language: Python
Topic: Plots/3D
DMelt Version 2.5. Last modified: 06/22/1974. License: Pro
https://datamelt.org/code/cache/javaview_kuen_surface_4198.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
# Describes parametrized surfaces over a two dimensional domain.
# Parameter domain allows adjustments.
# Konrad Polthier, Sergei Chekanov
from jv.function import PuFunction
from jvx.surface import PgDomainDescr,PgParmSurface
from jhplot import HJavaView
from java.lang import Math
dimOfDomain = 2
numFunctions = 3
m_domain = PgDomainDescr(dimOfDomain)
m_domain.setName("Domain of Kuen")
m_domain.setMaxSize(-10., -10., 10., 10.)
m_domain.setSize(-4.5, 0.05, 4.5, Math.PI-.05)
m_domain.setDiscr(16, 16)
m_domain.init()
m_function = PuFunction(dimOfDomain, numFunctions)
m_parmSurface = PgParmSurface(numFunctions)
m_parmSurface.setName("Kuen Surface")
m_function.setName("Functions of Kuen")
m_function.setExpression(0, "2./(1.+(u*sin(v))^2)*sqrt(1.+u*u)*sin(v)*cos(u-atan(u))")
m_function.setExpression(1, "2./(1.+(u*sin(v))^2)*sqrt(1.+u*u)*sin(v)*sin(u-atan(u))")
m_function.setExpression(2, "log(tan(v/2.))+2./(1.+(u*sin(v))^2)*cos(v)")
m_parmSurface.setFunctionExpr(m_function)
m_parmSurface.setDomainDescr(m_domain)
m_parmSurface.compute()
# add some colors
m_parmSurface.showElementColors(True);
m_parmSurface.showElementBackColor(True);
m_parmSurface.setTransparency(0.2);
m_parmSurface.showTransparency(True);
m_parmSurface.showSmoothElementColors(True);
m_parmSurface.showSmoothLighting(True);
c1=HJavaView()
c1.visible()
c1.draw(m_parmSurface)
You see the box below because you did not login.