Scan your whole stack
Are you using @rulecad/fea?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.3.0
@rulecad/fea was last scanned on 29 Nov 2026 at version 0.3.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.0 LATEST | 29 Nov 2026 | No rules fired |
| 0.2.14 | 25 Nov 2026 | No rules fired |
| 0.2.13 | 24 Nov 2026 | No rules fired |
| 0.2.11 | 21 Nov 2026 | Not shown |
| 0.2.9 | 7 Nov 2026 | Not shown |
Findings for v0.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
How far a part bends under load. Finite elements on a grid of cells, each with its own stiffness: flat parts loaded in their own plane (2D, plane stress, square cells) and solid parts (3D, cubes). Plain JavaScript in typed arrays, no dependencies: it runs in browsers and Node alike. Units are millimetres and newtons, so Young's modulus is in MPa and movement in mm.
Frames of beams joined at nodes have their own solver, @rulecad/fea/frame: see Frames of beams.
Which members such a frame should have, and how thick, is found by @rulecad/fea/layout: see
Frame layout.
import { grid, analyse } from '@rulecad/fea';
const g = grid({ nx: 100, ny: 10, h: 1 }); // 100 × 10 cells of 1 mm
const fixed = new Uint8Array(g.dofs), load = new Float64Array(g.dofs);
for (let j = 0; j <= 10; j++) { fixed[2 * g.node(0, j)] = 1; fixed[2 * g.node(0, j) + 1] = 1; } // hold the left edge
load[2 * g.node(100, 5) + 1] = -10; // 10 N down at the right end
const r = analyse({ grid: g, density: new Float64Array(1000).fill(1), material: { E: 2680, nu: 0.36 }, thickness: 5, fixed, loads: [load] });
r.u[0]; // each node's movement: x at 2n, y at 2n + 1
r.compliance[0]; // the load times how far it moved (N·mm): lower is stiffer
r.stress[0]; // each cell's von Mises stress (MPa) at its centre: reads bending stress low (see How fine a grid)
r.surface[0]; // each solid cell's von Mises stress (MPa) at the part's surface: use this for strength
r.findings; // [{ level, text, code, values, at, box }]: a warning where the peak stress is in a member under 8 cells through
r.deflection[0]; // { most, at }: the largest movement of solid material, and where
r.thin; // { share, cells }: how much of the part is in members under 4 cells thick (thinShare), where a cell's stiffness is rough
nz too (grid({ nx, ny, nz, h })) and every node has x, y and z.density ** penal), so the same code analyses a part, a part filling only some of its thickness, and
a topology optimisation's in-between designs.direct: a banded Cholesky factorisation. Exact; quick for 2D grids up to about 100,000 cells and small 3D ones.cg: conjugate gradients with a diagonal preconditioner.mg: conjugate gradients with a multigrid preconditioner, the default in 3D. Coarser grids halve each side. Each
coarse cell's matrix is built from its children's exactly (Galerkin), so it stays accurate when cells'
stiffnesses differ a millionfold, as they do in topology optimisation. A cantilever of 16,000 cubes takes 9
iterations, where plain cg takes 371.solve(...) returns again(loads), which solves more right-hand sides on the same matrix,
reusing its factorisation or preconditioner: an adjoint, for a gradient.stress is read at each cell's centre, half a cell inside the part. In bending the
stress peaks at the surface, so in a member n cells through the centre stress reads low by about one cell's share:
27 to 30% low at 4 cells, 10% at 10. surface (and surfaceStress(g, u, modulus, nu, density), which also gives
each node's value) reads each cell at its corners and averages each stress component over the solid cells round
each node. At a corner it takes two thirds of what the cell's strains say and one third of the stress that
reproduces the forces on the cell's corners: square cells bend a little too stiffly, so their strains alone read
low (6% at 4 cells in 3D), and the second reading errs the other way by about twice as much. A cell under half
density keeps its centre stress. analyse adds a warning to findings (code fea.coarse-stress) for each load
whose peak surface stress is in a member under 8 cells through, counted along the directions the stress changes
fastest there (the shortest of them). At a sharp inside corner, or a curved edge stepped into cells, the peak keeps rising as cells shrink:
the stress concentrates there beyond what any grid settles on, so read it with care (a real part has a fillet).centreStress(h, nu, dim) is the matrix from a cell's movements to the stress at its centre
(for Young's modulus 1), and vonMises(s, dim, grad) gives von Mises stress and, optionally, its gradient. Stress
limits in @rulecad/topopt use both.cg repeats (the stiffness product, its diagonal, dot products) sit behind a small
interface. jsBackend, plain JavaScript in 64-bit floats, is the reference; a WebGPU or TensorFlow.js backend
implements the same and passes backend-suite.mjs in this repository. The matrix is assembled in blocks (a node's
rows: a 3 × 3 block for each node it shares a cell with), so a product is a plain sweep, and multigrid's sweeps are
symmetric Gauss-Seidel through those blocks.import { threadsBackend } from '@rulecad/fea/threads' (Node only) shares each product over the
machine's cores (FEA_THREADS to say how many), the rest as jsBackend. On a 134,000-unknown grid a product takes
6.8 ms on seven threads against 19 ms on one, and an optimisation step about a third of the time. It needs Node 22
or later: on Node 20 a product now and then came out wrong when the workers let go of an old operator's shared
memory (a few solves in sixty, more with more threads, none on Node 22 or 24), so there it is plain JavaScript
under another name (its name says so).Tested against beam theory with shear (Timoshenko's, F L³ / 3 E I + F L / κ G A): a cantilever's tip moves within
1% of it in 2D at 10 cells through, and within 3% in 3D at 8, never more. The surface stress of a cantilever 4, 8 or
10 cells deep is tested within 5% of M c / I at mid-span and a beam's depth from the support, in 2D and 3D (it
comes within 2%); right at a clamped edge the stress concentrates, and beam theory doesn't hold.
Multigrid is tested against the direct solver with stiffnesses a millionfold apart.
How fine a grid. The cells are exact for a part that only stretches, and converge on beam theory with shear (Timoshenko's) as they shrink. What matters is how many cells cross the depth of whatever bends:
| Cells through the depth | Too stiff by | stress (cell centres) reads low by |
surface is out by |
|---|---|---|---|
| 1 | about 32% | about 94% | about 24% low |
| 2 | about 11% | about 55% | about 5% low |
| 4 | about 3% (4% in 3D) | about 27% (29% in 3D) | under 1% |
| 8 | about 1% | about 13% | about 1% high |
| 10 | under 1% | about 10% | about 1% high |
| 20 | under 0.5% | about 5% | under 1% high |
So give every member that bends at least four cells, read its strength from surface, not stress, and check a
final shape on cells half the size: if the stiffness or the peak stress moves by more than a few percent, the grid
was too coarse. (Stiffness measured on cantilevers and a simply supported beam, in 2D and 3D; stress on a cantilever
100 × 10 mm at mid-span, against M c / I, in 2D, and in 3D where they differ.)
@rulecad/fea/frame solves a frame as beams joined at nodes: how far it moves under load, what each beam carries,
the load at which it buckles and the frequencies it rings at. A frame of aluminium extrusion or tube would need
millions of cubes, nearly all of them empty; as beams it has a few hundred unknowns and solves in milliseconds, so a
machine's frame can be checked at every pose. It is its own entry of the package, with no dependencies, and runs in
browsers and Node alike.
import { frame, subdivide } from '@rulecad/fea/frame';
const model = {
nodes: { footA: [0, 0, 0], topA: [0, 0, 400], topB: [600, 0, 400], footB: [600, 0, 0] }, // mm
sections: { bar2020: { A: 400, Iy: 13333, Iz: 13333, J: 22500, Asy: 333, Asz: 333, cy: 10, cz: 10 } },
materials: { aluminium: { E: 69000, nu: 0.33, density: 2.7 } },
elements: [
{ id: 'legA', a: 'footA', b: 'topA', section: 'bar2020', material: 'aluminium' },
{ id: 'beam', a: 'topA', b: 'topB', section: 'bar2020', material: 'aluminium', ends: { a: { ry: 2e6, rz: 2e6 }, b: { ry: 2e6, rz: 2e6 } } },
{ id: 'legB', a: 'footB', b: 'topB', section: 'bar2020', material: 'aluminium' },
],
supports: { footA: 'fixed', footB: 'fixed' },
loads: [{ node: 'topA', force: [50, 0, 0] }, { element: 'beam', spread: [0, 0, -0.2] }],
gravity: [0, 0, -9.81],
masses: { topB: 1.5 },
};
const f = frame(model); // read, checked and factorised once
const s = f.statics();
s.displacements.topA; // [x, y, z, rx, ry, rz]: 0.40 mm sideways
s.reactions.footA; // the force (N) and moment (N·mm) the support gives the frame
s.elements[1].peak.My; // { value, x }: the beam's largest moment about its own y, and where along it
s.elements[1].stress.peak; // 5.6 MPa
const fine = frame(subdivide(model, 4)); // every member in four pieces, for buckling and modes
fine.buckling().factors[0]; // 181: the loads times this buckle the frame
fine.modes({ count: 3 }).frequencies; // [26.7, 36.6, 66.9] Hz
The model is plain data, so an assembly can write it and a file can hold it.
| Part | Shape | Notes |
|---|---|---|
nodes |
{ name: [x, y, z] }, or a list of positions named by place |
mm |
elements |
[{ id, a, b, section, material, roll, up, ends }] |
From node a to node b. section and material are objects, or names in the model's sections and materials |
| a section | { A, Iy, Iz, J, Asy, Asz, cy, cz } |
Area (mm²); second moments about the element's own y and z, and the torsion constant (mm⁴); shear areas (mm², leave out for no shear deformation); the distances to the furthest fibre along y and z (mm), or the section moduli Wy and Wz (mm³), for stress |
| a material | { E, nu, density } |
MPa; Poisson's ratio (or G in MPa); g/cm³, as the kit's material rule sets give it |
ends |
{ a, b }, each 'rigid', 'pinned', 'ball' or { rx, ry, rz } |
How each end is joined to its node: each rotation 'rigid', 'free', or a spring's stiffness in N·mm/rad, about the element's own axes. 'pinned' frees both bending rotations and still carries twist; 'ball' frees all three |
supports |
{ node: 'fixed' }, 'pinned', or { x, y, z, rx, ry, rz } |
Each freedom true (held), left out (free), or a spring to ground in N/mm or N·mm/rad |
loads |
{ node, force, moment } or { element, spread, axes } |
N and N·mm in global axes; a spread load is N per mm of the element's length, in 'global' axes or the element's 'local' ones |
gravity |
[0, 0, -9.81] |
N/kg, the same number as m/s². It acts on every element's mass and every lumped mass |
masses |
{ node: kg } |
Lumped masses: weight under gravity, inertia in modes |
An element's own axes. x runs from a to b. z is the part of up square to the element, and up is global
+Z unless the element gives another (for an element along Z it is global +X). y = z × x. roll, in degrees, then
turns y and z about x. Iy resists bending that moves the beam along its z, Iz along its y. Every element's
result carries its axes, so nothing has to be guessed.
What each solve returns.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.