0% found this document useful (0 votes)
13 views2 pages

Plot3D Curves

The document describes methods to display 3D curves and surfaces in a JavaFX or Java3D scene. It contains methods to display a surface of revolution, helix, and curve individually in a JavaFX scene, as well as a method to display multiple curves and surfaces together with assigned colors in a JavaFX scene. A separate method displays a bounded curve on a surface of revolution in a Java3D scene.

Uploaded by

Hien Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Plot3D Curves

The document describes methods to display 3D curves and surfaces in a JavaFX or Java3D scene. It contains methods to display a surface of revolution, helix, and curve individually in a JavaFX scene, as well as a method to display multiple curves and surfaces together with assigned colors in a JavaFX scene. A separate method displays a bounded curve on a surface of revolution in a Java3D scene.

Uploaded by

Hien Nguyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

private static void displayCurves(SurfaceOfRevolution sor, Helix3D spiral, Curve3D

applx)
{

com.anca.gui.editor3d.javafx.JavaFXScene scene = new


com.anca.gui.editor3d.javafx.JavaFXScene();
com.anca.gui.editor3d.javafx.JavaFXPanel viewer = new
com.anca.gui.editor3d.javafx.JavaFXPanel(scene);

javax.swing.JFrame frame = new javax.swing.JFrame();


frame.add(viewer);
frame.setSize(1000, 1000);
frame.setVisible(true);

scene.addModel(com.anca.maths.geometry.Frame3D.BASEFRAME);
scene.addModel(sor).setTransparencyValue(0.5);
scene.addModel(spiral.getCurve()).setColor(Color.BLACK);
scene.addModel(applx).setColor(Color.WHITE);
viewer.autoFitScene(new com.anca.maths.vectors.Vector3D(-1.0, 1.0, -
1.0), com.anca.maths.vectors.Vector3D.ZDirection);

private void displayObjects(ArrayList<CurveOrSurfaceOrSolid3D> surfaceList,


ArrayList<CurveOrSurfaceOrSolid3D> curveList)
{
Color [] colors = {Color.RED, Color.GREEN, Color.BLUE, Color.PINK,
Color.MAGENTA, Color.YELLOW,
Color.WHITE, Color.GRAY, Color.BLUE, Color.PINK,
Color.MAGENTA, Color.YELLOW};

com.anca.gui.editor3d.javafx.JavaFXScene scene = new


com.anca.gui.editor3d.javafx.JavaFXScene();
com.anca.gui.editor3d.javafx.JavaFXPanel viewer = new
com.anca.gui.editor3d.javafx.JavaFXPanel(scene);

javax.swing.JFrame frame = new javax.swing.JFrame();


frame.add(viewer);
frame.setSize(1000, 1000);
frame.setVisible(true);

scene.addModel(com.anca.maths.geometry.Frame3D.BASEFRAME);
//scene.addModel(concialSOR).setTransparencyValue(0.5);
//scene.addModel(workpieceBoundSOR).setColor(Color.GREEN);
// scene.addModel(spineCircle).setColor(Color.RED);

for(int i = 0; i < surfaceList.size(); i++)


{
if(i == 0)
{
scene.addModel(surfaceList.get(i)).setTransparencyValue(0.5);
}
else
{
scene.addModel(surfaceList.get(i)).setColor(colors[i]);
}
}
for(int i = 0; i < curveList.size(); i++)
{

scene.addModel(curveList.get(i)).setColor(colors[i]);
}

viewer.autoFitScene(new com.anca.maths.vectors.Vector3D(-1.0, 1.0, -1.0),


com.anca.maths.vectors.Vector3D.ZDirection);
}

private static void displayCurves(BoundedCurveOnSOR cuttingEdge)


{

com.anca.gui.editor3d.java3d.Java3DScene scene = new


com.anca.gui.editor3d.java3d.Java3DScene();
com.anca.gui.editor3d.java3d.Java3DViewer viewer = new
com.anca.gui.editor3d.java3d.Java3DViewer(scene);
SurfaceOfRevolution sor = cuttingEdge.getBaseSOR();

scene.addObject(com.anca.maths.geometry.Frame3D.BASEFRAME);
scene.addObject(sor).setTransparencyValue(0.5);
scene.addObject(cuttingEdge.asBoundedCurve()).setColor(Color.BLACK);

MainFrame frame = new MainFrame(scene);


}

You might also like