Ir al contenido
Español
Fuerzas en una celosía viene con Pro. La vista previa aparece al desbloquearlo.

Cómo funciona

A textbook figure of a six-panel truss: seven pinned joints, eleven members, a pin support at A and a roller at D. One load sits on a top joint, E, F or G. Every member force comes from the method of joints and is drawn in the tension or compression colour, with a width that grows with the force and a chip with the signed value (+ tension, − compression). The support reactions appear as arrows with their values. Drag the load along the top chord, tap a top joint or use the segmented control; it snaps to the nearest joint. Select a member on the figure to read its force, and how it was with the load at the previous joint.

Úsalo para

  • Teach statics: let learners see that the bottom chord pulls and the top chord pushes, and that a diagonal can change from tension to compression when the load moves.
  • Explain support reactions with the lever rule: the closer the load is to a support, the more of it that support carries.

Busca otra opción cuando

  • For a real structural design, use engineering software: this figure is one idealised, pin-jointed truss with loads at joints only.

Uso

import React, { useState } from 'react'
import { ExhibitTrussForces } from './ExhibitTrussForces.jsx'

export function TrussLesson() {
  const [joint, setJoint] = useState('F')
  return (
    <ExhibitTrussForces
      value={joint}
      onChange={(next, { forces }) => setJoint(next)}
      defaultMember="EB"
      load={12}
      labels={{ title: 'A load at mid-span' }}
    />
  )
}

Propiedades

PropiedadTipoPor defectoQué hace
value'E' | 'F' | 'G'—Nudo superior controlado que recibe la carga.
defaultValue'E' | 'F' | 'G''F'Nudo inicial de la carga sin control externo y el destino de Restablecer.
onChange(joint, details) => void—Se llama al mover la carga, con el nuevo nudo y { reason ('drag', 'press', 'key', 'cancel' o 'reset'), previous, forces (kN por barra, tracción positiva), reactions ({ A, D } en kN) }.
memberstring—Barra seleccionada controlada, nombrada por sus dos nudos: AB, BC, CD, EF, FG, AE, EB, BF, FC, CG o GD.
defaultMemberstring'EB'Barra seleccionada al inicio y tras Restablecer.
onMemberChange(member, { reason, force }) => void—Se llama al seleccionar otra barra, con su esfuerzo en kN (tracción positiva).
loadnumber12Valor de la carga en kN. Todos los esfuerzos escalan con ella; el grosor de las barras es relativo al mayor esfuerzo que puede causar.
labelsobject—Sustituye cualquier texto integrado: title, caption, tension, compression, zero, legendTension, legendCompression, members, memberText ('{member}', '{state}', '{value}'), readout ('{member}'), compare ('{joint}', '{value}'), compareHint, loadAt, positions (tres), reactionText ('{joint}', '{value}'), unit y reset.
localestring'en'Etiqueta de idioma para las cifras decimales.
classNamestring—Clase extra para la tarjeta, por ejemplo para fijar su ancho (30rem por defecto, nunca más que su contenedor).

Accesibilidad

  • The member chips form a radio group: Tab reaches the selected one, arrows move to the next member from left to right, Home and End go to the first and last. Each chip's name reads the member, its state and its force.
  • The load position is a segmented control (a radio group): arrows, Home and End move the load between E, F and G. The draggable load on the figure is a pointer shortcut for the same choice.
  • The readout is a polite live region: it reads the selected member, its state and force, and the comparison with the previous load position. Each reaction is a note named with its support and value. Reset is a button, marked unavailable while nothing has changed.
  • Dragging the load uses pointer capture and touch-action: none, so the page does not scroll mid-drag; a cancelled gesture returns the load to where it started.
  • Colour is not the only key: every member shows a signed value, and the readout names the state in words.

Movimiento

When the load moves, member colours and widths change over --ds-duration-base and the load glides to its joint; while it is dragged it follows the pointer and the forces switch when it passes the middle between two joints. With reduced motion every change lands at once.

Añádelo a tu proyecto

Los miembros Pro copian un prompt y su agente de programación instala el código, igual que con los gratuitos.

ExhibitTrussForces.jsxexhibit-truss-forces.csstokens.cssREADME.md

Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.

Gráficos
Trilateración viene con Pro. La vista previa aparece al desbloquearlo.