The 3D well rendering module is based on a dedicated data API represented by the interface : cg3DWellData
This interface describes the well with the following information :
A name
A list of log curve (represented by the cgWellLogData interface which is also used by JWellLog 2D rendering)
A trajectory (an implementation of the cg3DWellTrajectory interface)
The trajectory described by the cg3DWellTrajectory interface is mainly a list of points where each point is formed by 4 coordinates :
X
Y
MD (Measured depth)
TVD (True vertical depth)
Note: the the curve data define logs by associated values to MDs.
The cylindrical rendering is the easiest way to visualize a well in a 3D view. It can be achieved by using the cgJOGL3DWellNode class.
In this mode, the well is rendered with :
A point at the beginning of the trajectory
A polyline following the trajectory
A cylinder following the trajectory.
The width of the cylinder varies following a given well log curve.
The color of the cylinder varies following a second well log curve.
The following code shows how to create a synthetic well data.
Simple well data creation
// Trajectory coordinates// The points are composed with (in order) : X coordinate, Y coordinate, Measured Depth, True Vertical Detph Point4d[] points = new Point4d[] { new Point4d(90., 90., 0., 10.), new Point4d(50., 70., 5., 40.), new Point4d(10., 10., 10., 90.) }; // Create a trajectory data structure cgDefaultTrajectory trajectory = new cgDefaultTrajectory(points); // Array of the curve's measured depth double[] depths = new double[] { 0.2, 1.6, 2.4, 3.8, 4.5, 5., 6.3, 7.1, 8.4, 9.8 }; // Array of the curve's values double[] values = new double[] { 105.34, 149.84, 137.64, 106.84, 132.12, 101.78, 147.956, 123.456, 135.14, 118.951 }; // The null value of the curve double nullValue = -123.456; // The minimal value of the curve which will be use for treatment double minLogValue = 105.34; // The maximal value of the curve which will be use for treatment double maxLogValue = 149.84; // Create a log curve data structure cgDoubleArrayData logCurve = new cgDoubleArrayData("MyLog", depths, values, nullValue); // Create a well data structure and add the trajectory and the log curve cgDefaultWellData wellData = new cgDefaultWellData("MyWellData"); wellData.setTrajectory(trajectory); wellData.addLogData(logCurve.getDataName(), logCurve);
With valid 3D well data, it is extremely easy to create a 3D well node.
Well node initialization
// Initialize and set up the well node // The well data is given in parameter _well = new cgJOGL3DWellNode(wellData); // Set the color map (an array of Color) _well.setColorMap(cm); // Set the radius scale range (minimum and maximum) _well.setRadiusScale(1, 2); // Set the log curve use for the coloration of the well _well.setLogColor("MyLog"); // Set the log curve use for the radius calculation of the well _well.setLogRadius("MyLog");
3D track rendering is an advanced mode to visualize a well in 3D. It allows you to visualize several log curves along a trajectory as well as lithology data or markers. It is implemented by the cgJOGL3DWellTrackContainerNode2 class.
In this mode, the well is rendered with :
A polyline following the trajectory
A set of tracks which follow the trajectory.
Each track can contain a list of visual (curve, fill, lithology).
Track initialization
// Initialize and set up the well node// The well data is given in parameter _well = new cgJOGL3DWellTrackContainerNode2(wellData); rootNode.addNode(_well); //-----FILL----- //create a new track (width = 50) cgJOGL3DWellTrackContainerNode2.cgJOGL3DTrackNode track = _well.addTrack(50, false); track.setBackground(new Color(0.2f,0.2f,0.2f,0.2f)); //add a fill from the reference value 0 to the given log data cgJOGL3DWellLogFill fill = new cgJOGL3DWellLogFill(0, cosCurve); fill.setRenderingMode(RenderingMode.PATTERN_FILL); //add the fill visual to the track. track.addVisual(fill); //-----CURVE----- //create a second track smaller than the first one. track = _well.addTrack(25, false); track.setBackground(new Color(0.2f,0.2f,1f,0.2f)); //create a log curve cgJOGL3DWellLogCurve curve = new cgJOGL3DWellLogCurve(sinCurve); curve.setLineColor(Color.green); curve.setLineWidth(4); //add the curve to the track. track.addVisual(curve); //-----LITHOLOGY-----//yet another track track = _well.addTrack(25, false); track.setBackground(new Color(1f,1f,1f,1f)); //create a lithology visual from MD=200 to MD = 2000 cgJOGL3DWellLogLithology litho = new cgJOGL3DWellLogLithology(200, 2000); //add the lithology to the track track.addVisual(litho);
In the screenshot above, an icon as been attached to the well top. This icon can be used as a button to show / hide the tracks.
Use a button to show/hide the tracks
//add a button on top of the well to show/hide tracks Icon icon = TutorialImageLoader.loadIcon("copy.png"); cgJOGL3DToggleButtonNode button = new cgJOGL3DToggleButtonNode(icon, 0,0,icon.getIconWidth(), icon.getIconHeight()); button.setLocation(new Point3d(459717.05900, 6787169.2730, 0)); button.setLocationInModelSpace(true); button.setButtonSelected(true); cgGraphicAttribute ga = new cgGraphicAttribute(); ga.setFillColor(new Color(0,0,0,0)); ga.setLineStyle(cgGraphicAttribute.CG_LS_EMPTY); button.setGraphicAttribute(ga); button.setSelectedGraphicAttribute(ga); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { _well.setTracksVisible(!_well.areTracksVisible()); } }); rootNode.addNode(button);