Skip to content

madil4/awatif

Repository files navigation

Awatif.co helps you build parametric structural engineering apps that run on the web or offline, featuring real-time FEM analysis and design.

Roadmap

  • FEM: Bar & beam elements Example
  • FEM: Plate & shell elements (coming soon)
  • FEM: Static simulations Example
  • FEM: Dynamic simulations
  • FEM: Nonlinear analysis
  • FEM: Meshing Example
  • Design: Member checks (coming soon)
  • Design: Connection checks
  • UI: Tabular editing Example
  • UI: Drawing Example
  • UI: Reporting (coming soon)
  • UI: Element selection
  • Structural Systems: Truss design Example
  • Structural Systems: Building design (coming soon)

Stack

  1. VanJS: for handling reactive state Docs
  2. Three.js: for 3D rendering and operations Docs
  3. Lit-html: for templating Docs
  4. W2UI: for UI components Docs

Coding style

Here is a typical function with structure and style in mind:

function mesh({ polygon }: { polygon: number[] }): { elements: number[][] } {
  // Init
  const elements = [];

  // Update
  elements.push([1, 2, 3]);

  // Events
  van.drive(() => {
    render(elements.val);
  });

  return { elements };
}
  • Focus on simplicity and stick to core features. Prioritize the minimum viable product by identifying essential elements. The system is already complex, and additional complexity will naturally arise, so maintaining simplicity is crucial.
  • Functions should fully describe their inputs and outputs using types to improve interfacing with other functions.
  • To organize the logic and improves readability, divide it into three blocks, as shown above:
    • Init: Initializes all variables.
    • Update: Updates variables.
    • Events: Handles event listeners.
  • If a function has no return value, it modifies a global state, which is generally not recommended as it can lead to more bugs over time. However, if unavoidable due to legacy code, consider using reactive objects and handling changes as events using the signal approach.