Members
(constant) colors
An HEX array used as a color library for random generation.
- Source:
(constant) meshConstraints :object
Constant used in
Phantom.addFiber
and Phantom.addIsotropicRegion
for defining segments in meshes.
Used as a parameter for WEBGL stability.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
maxTotalAxialSegments |
Number | Maximum number of Axial Segments in fiber tube mesh to appear in the scene |
maxMeshAxialSegments |
Number | Maximum number of Axial Segments to feature in a fiber tube mesh |
maxTotalRadialSegments |
Number | Maximum number of Radial Segments in fiber tube mesh to appear in the scene |
maxMeshRadialSegments |
Number | Maximum number of Radial Segments to feature in a fiber tube mesh |
maxTotalLineSegments |
Number | Maximum number of Line Segments to appear in the scene |
maxMeshLineSegments |
Number | Maximum number of Line Segments to feature in a single skeleton line |
maxTotalSkeletonSphereSegments |
Number | Maximum number of Radial Segments in skeleton control points to appear in the scene |
maxMeshSkeletonSphereSegments |
Number | Maximum number of Radial Segments to feature in a single control point sphere mesh |
maxTotalIsotropicRegionSegments |
Number | Maximum number of Radial Segments in Isotropic Regions to appear in the scene |
maxMeshIsotropicRegionSegments |
Number | Maximum number of Radial Segments in Isotropic Regions to appear in a single mesh |
- Source:
(constant) precision :Number
Number of decimal digits present in all values given. Used in
roundToPrecision
.
Type:
- Number
- Source:
Methods
animate()
Called recursively. Updates the controls as well.
- Source:
buildAxes(length)
Returns axes to be added to the scene.
Parameters:
Name | Type | Description |
---|---|---|
length |
number | The axis radius |
- Source:
Returns:
The axis geometry ready to be added to the scene
dragAndDrop()
Builds or resets Drag and Drop interactive controls in the scene.
- Source:
init()
To be called when page is loaded, initialises the app. Starting from a XMLHttpRequest,
calls
show()
and setupGUI()
.
- Source:
loadPhantom(string) → {Phantom}
Loads a Phantom contained in a JSON file and puts it into the scene.
Contains all the functions necessary to translate Phantomas' JSON structure to
Contains all the functions necessary to translate Phantomas' JSON structure to
FiberSource
parameters.
Parameters:
Name | Type | Description |
---|---|---|
string |
String | The string containing the parsed phantom variable. |
- Source:
Returns:
The phantom ready to be added to the scene.
- Type
- Phantom
pushDownload(content)
Pushes to the navigator the download of a string as a ddmmyyyyhhmm-phantom_save.JSON file.
Requires an <a> element in the HTML with id="downloadAnchorElem".
Requires an <a> element in the HTML with id="downloadAnchorElem".
Parameters:
Name | Type | Description |
---|---|---|
content |
string | A string containing the content to be included in the file. |
- Source:
render()
Renders the scene. Must be called anytime the scene is changed.
- Source:
roundToPrecision(number) → {Number}
Applies precision to any value. Uses
precision
constant.
Parameters:
Name | Type | Description |
---|---|---|
number |
Number | String | Number to round |
- Source:
Returns:
The rounded number
- Type
- Number
show()
Initialises everything regarding the THREE.js environtment. Adds window events.
- Source:
Requires:
- module:THREE.js
- module:TrackballControls.js