Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A high-level ray picking helper for 3D intersection, built from modular pieces.
var Ray = require('ray-3d')
var ray = new Ray(origin, direction)
if (ray.intersectsSphere(center, radius)) {
console.log("Hit a sphere!")
}
Features:
intersectsSphere
intersectsPlane
intersectsTriangle
intersectsTriangleCell
intersectsAABB
(Axis-Aligned Bounding Box)The API is still experimental, and missing some features:
ray-ray-intersection
ray-mesh-intersection
(simplicial complex)ray = new Ray([origin, direction])
Creates a new Ray
with optional origin
and direction
, both arrays in the form [x, y, z]
.
origin
defaults to [0, 0, 0]
and direction
defaults to [0, 0, -1]
.
ray.set(origin, direction)
Assigns this ray's origin
and direction
to the given values.
ray.copy(otherRay)
Copies the origin
and direction
from the otherRay
into this ray.
otherRay = ray.clone()
Deep clones this ray into a new Ray
instance.
All intersection methods return the collision point [x, y, z]
if one occurred, which is re-used across calls to avoid GC thrashing.
If no collision occurred, the methods return null
.
ray.intersectsPlane(normal, distance)
Whether this ray intersects the plane with the unit normal
[x, y, z] and distance
from origin.
ray.intersectsSphere(center, radius)
Whether this ray intersects with the sphere at center
[x, y, z] and radius
.
ray.intersectsTriangle(triangle)
Whether this ray intersects with the triangle
:
[ [x1, y1, z1], [x2, y2, z2], [x3, y3, z3] ]
ray.intersectsTriangleCell(cell, positions)
Whether this ray intersects with the triangle cell, where cell
is a face like so:
[ a, b, c ]
Where [ a, b, c ]
are indices into the positions
array:
[ [x1, y1, z1], [x2, y2, z2] ... ]
This is useful for indexed meshes and simplicial complexes like icosphere.
ray.intersectsBox(aabb)
Whether this ray intersects with the Axis-Aligned Bounding Box aabb
:
[ [x1, y1, z1], [x2, y2, z2] ]
MIT, see LICENSE.md for details.
FAQs
a high-level ray picking helper for 3D intersection
The npm package ray-3d receives a total of 550 weekly downloads. As such, ray-3d popularity was classified as not popular.
We found that ray-3d demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.