This module is for showing 3D Wells
npm install @corva/well3dviewappjavascript
yarn add @corva/well3dviewapp
`
How to Import #
`javascript
import Well3DApp from '@corva/well3dviewapp';
`
INITIALIZATION ##
Import Well3DApp component and add it to the DOM Element. Example:
`javascript
import Well3DApp from '@corva/well3dviewapp';
this.well3DViewer = new Well3DApp(root, config);
this.well3DViewer.attach();
`
#### Parameters ####
root: ID of the element which you want to add the Well3DViewer
config: Initial configuration of the 3DViewer
Example:
`javascript
{
soil,
initAnimation: true,
wells,
unit: 'ft',
zoomSpeed: 3,
tooltipFormatter: (name, type, point, unit) => ,
mainWellId: 'well_002'
}
`
soil: Array
The array of the information of the soil
`javascript
[
...
{
"name": "T/ Porous Sd",
"top": 0,
"bottom": 775,
"color": "49a3a2"
},
...
]
`
initAnimation: Boolean
The flag for animation of the AntiCollision Indicator when initialize the 3DViewer
wells: Array
Array of the data of the wells. (Main Well, Offset Wells, ...)
`javascript
[
...
{
id: 'well_001',
name: 'Main Well',
color: '0xFF0000',
data: tube1,
antiCollisionIndicator: {
enable: true
}
},
...
]
`
unit: String
The Unit of the depth. Ex: "ft", "km", ...
unit: String
The speed of zoom when using mouse wheel
tooltipFormatter: String
The formatter function of the well's tooltip.
`javascript
(name, type, point, unit) =>
name: String
Name of the object
yype: String
Type of the object. (It should be "Well" and "Survey" for now)
point: Point
Point of the object. Ex: { x, y, z }
unit: String
Unit of the distance. (It should be "ft", "m", and "Km")
`
mainWellId: String
The ID of the main well. It will have the AntiCollisionIndicator.
#### Sample: How to use Well3DApp in React project ####
Please take a look at this sample
Methods ##
$3
#### addNewWell(newWell) ####
Add a new well to the existing 3D Viewer.
newWell: Object
The data of the new well which you want to add to the 3D Viewer
`javascript
{
id: 'well_001',
name: 'Main Well',
color: '0xFF0000',
data: tube1,
antiCollisionIndicator: {
enable: true
}
}
`
config: Object
Same as the constructor of the Well3DApp
#### updateWellData(wellId, newPoints) ####
Replace the all points of the existing well with new points.
wellId: String
The ID of the well which you want to update
newPoints: Array
The array of points of the well which you want to update.
`javascript
[
...,
{x, y, z},
...
]
`
$3
#### ####
#### Controll the camera by Mouse ####
1. Zoom In: You can zoom in by scrolling up the Mouse Wheel.
2. Zoom Out: You can zoom out by scrolling down the Mouse Wheel.
3. Zoom In and Out: You can zoom in and out with clicking the Mouse Wheel button and moving the mouse(up and down) at the same time.
4. Rotate: You can rotate the camera by clicking the Mouse Right button and moving the mouse at the same time.
5. Zoom to a point of the well: You can zoom to a point of the well by clicking a point of the well in the scene. (When you mouse over on the wellbore, it will show a tooltip.)
#### resetCamera() ####
Reset the view of camera to the initial view.
#### rotateYAxisCamera(step, angle) ####
Rotate the camera by the Y Axis around the AntiCollisionIndicator.
step: Float
The value of radian which you want to rotate for every call
This is Optional parameter and the default value is 0.2.
angle: Float
The value of radian which you want to rotate the camera to the target angle.
This is Optional parameter.
#### rotateXAxisCamera(step, angle) ####
Rotate the camera by the X Axis around the AntiCollisionIndicator.
The parameters are same as above.
#### zoomToIndicator() ####
Zoom in the camera for the AntiCollisonIndicator.
#### zoomToMainWell() ####
Zoom in camera to fit to the main wellbore.
#### zoomIn() ####
Zoom in the camera.
#### zoomOut() ####
Zoom out the camera.
#### setIndicatorTracker (shouldTrackIndicator) ####
If shouldTrackIndicator is true, it will track the Anti Collision Indicator in real-time when move the indicator.
If shouldTrackIndicator is false, it cancels tracking the Anti Collision Indicator.
$3
#### allowPan(isAllow) ####
Allow to move the scene by mouse click and move.
isAllow: Boolean
#### updateCombo(alpha) ####
Move the AntiCollisionIndicator on the path of the well with the Camera. Camera will zoom to the AntiCollisionIndicator during the movement.
alpha: Float
Position of the AntiCollisionIndicator. [0, 1]
#### changeSoilVisibility(isSoil) ####
Change visibility of the soil levels.
isSoil: Boolean
#### showOnlyActiveSoil(visible) ####
Change the opacity of the soil levels which aren't contain the Anti Collision Indicator.
visible`: Boolean