RaphaëlSM

Structural mechanics extension of Javascript vector graphics library Raphaël

RaphaelSM is an extending library to JavaScript vector graphic library Raphaël created for structural mechanics purposes. With this extension, you can easily draw and manage SM graphic elements (supports, load etc.) in your web (JavaScript) applications (like here). Just download the raphaelsm.js file and place it into your HTML document. The raphael.js file and raphaeltools.js file has to be loaded first. The usage is very simple:
var w = 400, h = 400;
var paper = Raphael('div-raphael',w,h);
var frame = paper.rect(0,0,w,h);

var arrow = paper.Arrow({x:100,y:40,size:80,angle:180});
var ps = paper.PinSupport({x:100,y:40,sliding:true}).setWidth(3);
var fs = paper.FixedSupport({x:250,y:40,angle:180}).strokeRed();
var p1 = RaphaelTools.Point2d.create(ps.x,ps.y);
var p2 = RaphaelTools.Point2d.create(fs.x,fs.y);
paper.path([['M',p1.x,p1.y],['L',p2.x,p2.y]]).attr({'stroke-width':2});
var cl = paper.DistributedLoad(p1,p2,{valx:20,valy:20,nArrows:10}).blue()
var shifts = [[0,60],[0,150],[0,200]];
p1.copy(shifts); p2.copy(shifts);
var lc = paper.LinearCurve(p1.copies[0],p2.copies[0],{val1:-15,val2:25}).green();
var pc = paper.ParabolicCurve(p1.copies[1],p2.copies[1],{val1:0,valMid:25,val2:-50}).cyan();
var c4 = paper.Defl4thOrder(p1.copies[2],p2.copies[2],{
phi1:-.034722,wMid:0.0086805,scale:3000,realLen:2,closedBase:false});
c4.setWidth(4).strokeMagenta()
var p3 = RaphaelTools.Point2d.create(ps.x,300);
var p4 = RaphaelTools.Point2d.create(fs.x,p3.y);
var dim = RaphaelSM.Dimension.create(paper,p3,p4,{val:'4 m'});
var spring = paper.Spring({x:350,y:50,angle:-90,size:100,num:8}).setWidth(2);
var dashpot = paper.Dashpot({x:350,y:150,angle:-90,size:100}).setWidth(5);

RaphaëlSM is a free software distributed under GNU LGPL license.

Currently implemented "classes" are:
  • Arrow
  • Pin support
  • Fixed support
  • Distributed load
  • Curves (linear, quadratic, cubic, 4th order) - for drawing internal forces, deflection etc
  • Dimension.

See documentation and/or examples for more information.
Contact: e-mail
Last update: 22th August 2011
© 2011 - 2022   Jan Stránský
All rights reserved
Valid XHTML 1.1
Valid CSS