Constructor
new Phantom()
Properties:
Name | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fibers |
Object | Contains all objects for Fiber definition and representation.
Properties
|
|||||||||||||
isotropicRegions |
Object | Contains all objects for Isotropic Region definition and representation.
Properties
|
|||||||||||||
highlightOpacity |
Number | 0.1 | The base opacity for fading meshes in the scene. Over 1. | ||||||||||||
highlightColor |
THREE.Color | null | The color to be taken by highlighted objects. By default, null, thus color does not change. |
- Source:
Methods
(static) addAsSkeleton(scene)
Adds all Phantom bundles to given scene in a Skeleton form with
faded tubes.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE.Scene | Scene in which the Phantom will be added to. |
- Source:
(static) addCP(fiberindex, cpbefore)
Adds a new Control Point to a specified Fiber in the Phantom.
No position is specified; control point is added over the trajectory in between two existing control points.
Will
No position is specified; control point is added over the trajectory in between two existing control points.
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
fiberindex |
Number | Index of the fiber in which the control point is to be added to. |
cpbefore |
Number | Index of the control point in which the new one is to be added after. |
- Source:
(static) addFiber(fiber, parametersopt, replaceindexopt)
Adds a Fiber to the Phantom, by creating their
FiberTube
and FiberSkeleton
.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fiber |
FiberSource | Fiber to be added to the Phantom. | |||||||||
parameters |
Object |
<optional> |
Optional object containing different optional parameters. Those parameters
may be the ones to be specified in classes FiberTube and FiberSkeleton constructor.
If only nbElements is defined, sets the rest of those parameters by itself, looking at the constant meshConstraints .
Properties
|
||||||||
replaceindex |
Number |
<optional> |
If specified, replaces the Fiber yet present in this same index. |
- Source:
(static) addIsotropicRegion(region, parametersopt)
Adds a Fiber to the Phantom, by creating their
IsotropicRegion
.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
region |
IsotropicRegionSource | Fiber to be added to the Phantom. | |||||||||
parameters |
Object |
<optional> |
Optional object containing different optional parameters. Those parameters
may be the ones to be specified in class IsotropicRegion constructor.
If only nbElements is defined, sets the rest of those parameters by itself, looking at the constant meshConstraints .
Properties
|
- Source:
(static) addSkeleton(scene)
Adds all Phantom bundles to given scene in a Skeleton form.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE.Scene | Scene in which the Phantom will be added to. |
- Source:
(static) addToScene(scene)
Adds all Phantom bundles to given scene.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE.Scene | Scene in which the Phantom will be added to. |
- Source:
(static) cpHighlight(fiberindex, controlpointindex, mode) → {THREE.MeshBasicMaterial}
Overlays a colored slightly bigger sphere over a control point. Used for
the user focusing in this element.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
fiberindex |
Number | Index of the fiber containing the control point to highlight. |
controlpointindex |
Number | Index of the control point to highlight. |
mode |
String | Highlight mode:
|
- Source:
Returns:
The highlight mesh
- Type
- THREE.MeshBasicMaterial
(static) export() → {String}
Parses Fibers and Isotropic Regions in the Phantom and returns a parsed, indented string.
The JSON is fully compatible with Phantomas. Name string is used as name for property in JSON file. Uppercase, spaces and non-alphanumeric characters are removed. In case two elements share the same name, numeric values will be added at the end.
Information from fibers:
The JSON is fully compatible with Phantomas. Name string is used as name for property in JSON file. Uppercase, spaces and non-alphanumeric characters are removed. In case two elements share the same name, numeric values will be added at the end.
Information from fibers:
- Control points
- Tangents
- Radius
- Color
- Center
- Radius
- Color
- Source:
Returns:
Parsed variable ready for pushing to download.
- Type
- String
(static) fadeAll(opacityopt)
Fades all bundles to given opacity.
Will
Will
render
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
opacity |
Number |
<optional> |
Phantom.highlightOpacity | Opacity to fade to (over 1) |
- Source:
(static) fiberHighlight(n)
Fades all but the given fiber. Highlight opacity cannot be specified.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
n |
Number | Index of the fiber to highlight. |
- Source:
(static) newFiber()
Creates a new blank fiber in the scene.
The fiber features two points in X axis with
Will
The fiber features two points in X axis with
phantom's radius
distance.
Will
render
.
- Source:
(static) newIsotropicRegion()
Creates a new blank isotropic region in the scene.
The isotropic region will be centered in the scene and have 1/5 of
Will
The isotropic region will be centered in the scene and have 1/5 of
phantom's radius
as radius.
Will
render
.
- Source:
(static) radius() → {Number}
Provides the radius of the Phantom, understood as the distance from the center
to the most distant bundle.
- Source:
Returns:
Radius of the Phantom.
- Type
- Number
(static) regionHighlight(n)
Fades all but the given region. Highlight opacity cannot be specified.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
n |
Number | Index of the region to highlight. |
- Source:
(static) removeCP(fiberindex, cp)
Removes an existing Control Point of a specified Fiber in the Phantom.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
fiberindex |
Number | Index of the fiber in which the control point is to be removed. |
cp |
Number | Index of the control point to be removed. |
- Source:
(static) resetColors()
Resets color of all bundles. Important when unhighlighting with
Will
highlightColor
being defined.
Will
render
.
- Source:
(static) revealSkeleton(scene, n)
Adds Phantom to the scene and fades all by adding a Skeleton fiber to a
given fiber. This fiber's tube will feature twice the default opacity for making the user stay focus.
Will
Will
render
.
Parameters:
Name | Type | Description |
---|---|---|
scene |
THREE.Scene | Scene in which the Phantom will be added to. |
n |
Number | Index of the fiber to highlight. |
- Source:
(static) unfadeAll()
Unfades all bundles, setting opacity to 1.
Will
Will
render
.
- Source: