JavaView to show geometry object and 2D function in 3D
Code: "javaview_geom_f2d.groovy". Programming language: Groovy
DMelt Version 2.5. Last modified: 06/29/1974. License: Pro
https://datamelt.org/code/cache/javaview_geom_f2d_8430.groovy
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.
// show how to mix geometry objects and 2D function in the same 3D canvas
import jhplot.*
import jv.geom.PgElementSet
c1= new HJavaView()
obj = new PgElementSet(3)
obj.setName("torus")
obj.computeCone(20, 20, 4.0, 1.0)
f1 = new F2D("0.2*(x*x+y*y)-1", -5.0, 5.0, -5.0, 5.0)
obj1=c1.add(f1)
obj1.setTransparency(0.5);
obj1.showTransparency(true);
obj1.makeElementColorsFromXYZ()
obj1.showElementColors(true)
obj1.setTransparency(0.5)
c1.draw(obj)
c1.draw(obj1)
view=c1.getView()
disp=view.getDisplay()
disp.showAxes(true)
c1.visible()
You see the box below because you did not login.