@gov.nasa.jpl.honeycomb/telemetry-primitives
v0.0.6
Published
Set of three.js primitives for displaying robotic telemetry.
Downloads
8
Readme
telemetry-primitives
Set of simple telemetry primitives for drawing objects in the scene.
!> Note that geometry instances associated with the primitive annotations are shared and should not be modified.
Use
TODO
API
BoxAnnotation
Renders a box with a given size.
extends Mesh
size
size : Vector3 = (1, 1, 1)The size of the box in X, Y, and Z
center
center : Vector3 = (0, 0, 0)The center position of the box.
constructor
constructor( material : Material ) : voidEllipticCylinderAnnotation
Renders an elliptical cylinder.
extends Mesh
radiusX
radiusX : Number = 1The radius of the cylinder in the X dimension.
radiusY
radiusY : Number = 1The radius of the cylinder in the Y dimension.
length
length : Number = 1The length of the cylinder in the Z dimension.
center
center : Vector3 = (0, 0, 0)The center of the cylinder.
constructor
constructor( material : Material ) : voidCylinderAnnotation
Version of EllipticCylinderAnnotation that has a setter for the full cylinder radius.
extends EllipticCylinderAnnotation
radius
radius : Number = 1Sets the radius in X and Y of the cylinder.
CAHVOREOptions
width
width : Numbermax number of pixels in width
height
height : Numbermax number of pixels in height
C
C : Vector3input model center
A
A : Vector3input model axis
H
H : Vector3input model horiz
V
V : Vector3input model vert
O
O : Vector3 | null = nullinput model optical axis, only required for CAHVORE
R
R : Vector3 | null = nullradial-distortion, only required for CAHVORE
E
E : Vector3 | null = nullentrance-pupil, only required for CAHVORE
linearity
linearity : Number = 1linearity parameter, only required for CAHVORE
nearDist
nearDist : Number = 0.085the distance between the camera model and the near plane
farDist
farDist : Number = 10.0the distance between the camera model and the far plane
widthSegments
widthSegments : Number = 16lthe number of segments to create along the x axis (all sides)
heightSegments
heightSegments : Number = 16lthe number of segments to create along the x axis (all sides)
FrustumAnnotation
Frustum for depicting the view volume of a camera. This will be transformed using CAHV or CAHVORE settings.
extends Mesh
constructor
constructor( material : Material ) : voidsetParameters
setParameters( parameters : CAHVOREOptions ) : voidUpdate the parameters of the CAHVORE frustum geometry.
LinearFrustumAnnotation
Create a linear camera frustum facing the -Z axis with X to the right and Y up.
extends Mesh
setFromProjectionMatrix
setFromProjectionMatrix(
projectionMatrix : Matrix4,
frame : Matrix4,
near : Number,
far : Number
) : voidUpdates the linear frustum view based on the provided projection matrix, frame, near, and far values.
HexagonAnnotation
Class for creating and rendering a hexagonal prism.
extends Mesh
length
length : Number = 1Sets the length of the prism along the Z axis.
constructor
constructor( material : Material ) : voidsetVertices
setVertices( points : ...Vector2 | Vector3 ) : voidSet the position of the hexagon vertices on X and Y.
getVertices
getVertices( points : ...Vector2 | Vector3 ) : voidGet the position of the hexagon vertices on X and Y. If Vector3s are passed in Z is set to 0.
SpheroidAnnotation
Class for rendering a sphere with asymmetrical radii on X, Y, and Z.
extends Mesh
dimensions
dimensions : Vector3 = (1, 1, 1)The dimensions of the radius on each X, Y, and Z dimenions of the spheroid.
center
center : Vector3 = (0, 0, 0)The center position of the spheroid.
constructor
constructor( material : Material ) : voidSphereAnnotation
Version of SpheroidAnnotation that has a setter for the full sphere radius.
extends SpheroidAnnotation
radius
radius : Number = 1Sets the radius for the full sphere. Returns the radius for X if the radius dimensions have been been set separately.
TriangleAnnotation
Class for rendering triangular prisms.
extends Mesh
length
length : Number = 1The length of the triagular prism on the Z axis.
constructor
constructor( material : Material ) : voidsetVertices
setVertices( p1 : Vector2 | Vector3, p2 : Vector2 | Vector3, p3 : Vector2 | Vector3 ) : voidSets the X and Y positions of triangl vertices.
getVertices
getVertices( p1 : Vector2 | Vector3, p2 : Vector2 | Vector3, p3 : Vector2 | Vector3 ) : voidSets p1, p2, and p3 to the X and Y position of the triangle vertices. Z is set to 0 if Vector3s are passed in.
StadiumAnnotation
Renders a box with a given size.
extends Mesh
length
length : Number = 1The length of the shape in the Z dimension.
constructor
constructor( material : Material ) : voidsetParameters
setParameters( p0 : Vector2, p1 : Vector2, radius : Number ) : voidSets the center line and radius of the stadium shape.
LineAnnotation
Creates a thick line.
extends Line2
color
color : Color = 0xffffffSets the color of the line.
lineWidth
lineWidth : Number = 1Sets the width of the line.
constructor
constructor( material : LineMaterial ) : voidsetPositions
setPositions( arr : Array | TypedArray ) : voidSets the geometry of the line to the passed array of vertices. The array should be a list of numbers with every 3 tuple representing a point in space.
setFromGeometry
setFromGeometry( newGeometry : BufferGeometry, threshold : Number = 45 ) : voidSets the line based on the edges of the given geometry. The threshold is angle between the faces over which a line will be added in degrees.
EllipseLineAnnotation
Class for rendering an ellipse with a Line.
extends LineAnnotation
radiusX
radiusX : Number = 1Sets the radius of the ellipse on the X axis.
radiusY
radiusY : Number = 1Sets the radius of the ellipse on the Y axis.
constructor
constructor( material : LineMaterial ) : voidCircleLineAnnotation
Class for rendering a cricle with a Line.
extends EllipseLineAnnotation
radius
radius : NumberSets the X and Y radius to the same value. Returns the x radius if they were set separately.
SquareLineAnnotation
Renders a square line on X and Y.
extends LineAnnotation
constructor
constructor( material : LineMaterial ) : voidsetSize
setSize( width : Number, height : Number ) : voidSets the width and height of the square on X and Y.
TriangleLineAnnotation
Class for rendering a triangular line.
extends LineAnnotation
constructor
constructor( material : LineMaterial ) : voidsetVertices
setVertices( v1 : Vector2 | Vector3, v2 : Vector2 | Vector3, v3 : Vector2 | Vector3 ) : voidSets the positions of the vertices on X and Y.
getVertices
getVertices( v1 : Vector2 | Vector3, v2 : Vector2 | Vector3, v3 : Vector2 | Vector3 ) : voidGets the positions of the vertices on X and Y. If Vector3s are passed in Z is set to 0.
StadiumLineAnnotation
Renders a stadium shape.
extends LineAnnotation
constructor
constructor( material : LineMaterial ) : voidsetParameters
setParameters( p0 : Vector2, p1 : Vector2, radius : Number ) : voidSets the center line and radius of the stadium shape.
StencilShape
Class for stenciling a shape intersection into the stencil buffer. Needs to be rendered after some geometry has already been rendered into the depth buffer. Raycasting is disabled on the stencil geometry.
extends Group
shape
shape : MeshGetter for the shape that is being rendered.
constructor
constructor( shape : Mesh ) : voidConstructor that take the shape to render.
setRenderOrder
setRenderOrder( renderOrder : Number ) : voidSets the render order of the stencil.
StampShape
Renders a color where the given shape intersects any data in the depth buffer.
extends StencilShape
stamp
stamp : MeshGetter for the mesh with material that will be rendered.
constructor
constructor( shape : Mesh ) : voidTakes a shape with a material to be rendered at the shape overlap. The object itself is stored as a reference in this StampShape instance and the material on the shape has the necessary stencil and depth properties set on it. Raycasting is disabled on the stencil stamp geometry.
LabeledVertex
Spherical vertex rendered with a label above it.
extends SphereAnnotation
text
text : String = ''The text in the label.
args
args : ...nullWedgePlane
Class for rendering a wedge on plane using a shader. Angle starts at the X axis.
extends Mesh
angle
angle : Number = 0The angle of the wedge in radians.
opacity
opacity : Number = 1The opacity of the wedge.
color
color : Color = 0xffffffThe Color of the wedge.
radius
radius : Number = 1The radius of the wedge.
