Index: /cpp/frams/config/f0-SDK.def
===================================================================
--- /cpp/frams/config/f0-SDK.def	(revision 914)
+++ /cpp/frams/config/f0-SDK.def	(revision 915)
@@ -48,4 +48,14 @@
 PROP(dz,1,1024,delta.z,f,-2,2,0,d.z)
 PROP(sh,1,0,shape,d,0,1,0,shape)
+PROP(hx,1,0,hinge position.x,f,,,0,hinge_pos.x)
+PROP(hy,1,1024,hinge position.y,f,,,0,hinge_pos.y)
+PROP(hz,1,1024,hinge position.z,f,,,0,hinge_pos.z)
+PROP(hrx,1,0,hinge rotation.x,f,,,0,hinge_rot.x)
+PROP(hry,1,1024,hinge rotation.y,f,,,0,hinge_rot.y)
+PROP(hrz,1,1024,hinge rotation.z,f,,,0,hinge_rot.z)
+PROP(hxn,1,0,hinge x negative limit,f,-6.2832,0,-1.5708,hinge_limit_x[0])
+PROP(hxp,1,1024,hinge x positive limit,f,0,6.2832,1.5708,hinge_limit_x[1])
+PROP(hyn,1,0,hinge y negative limit,f,-6.2832,0,-1.5708,hinge_limit_y[0])
+PROP(hyp,1,1024,hinge y positive limit,f,0,6.2832,1.5708,hinge_limit_y[1])
 XPROP(stif,2,0,stiffness,f,0.0,1.0,1.0,stif)
 XPROP(rotstif,2,0,rotation stiffness,f,0.0,1.0,1.0,rotstif)
@@ -66,4 +76,14 @@
 PROP(p2,0,1024,`part2 ref#',d,-1,999999,-1,p2_refno)
 PROP(sh,1,0,shape,d,0,1,0,shape)
+PROP(hx,1,0,hinge position.x,f,,,0,hinge_pos.x)
+PROP(hy,1,1024,hinge position.y,f,,,0,hinge_pos.y)
+PROP(hz,1,1024,hinge position.z,f,,,0,hinge_pos.z)
+PROP(hrx,1,0,hinge rotation.x,f,,,0,hinge_rot.x)
+PROP(hry,1,1024,hinge rotation.y,f,,,0,hinge_rot.y)
+PROP(hrz,1,1024,hinge rotation.z,f,,,0,hinge_rot.z)
+PROP(hxn,1,0,hinge x negative limit,f,-6.2832,0,-1.5708,hinge_limit_x[0])
+PROP(hxp,1,1024,hinge x positive limit,f,0,6.2832,1.5708,hinge_limit_x[1])
+PROP(hyn,1,0,hinge y negative limit,f,-6.2832,0,-1.5708,hinge_limit_y[0])
+PROP(hyp,1,1024,hinge y positive limit,f,0,6.2832,1.5708,hinge_limit_y[1])
 XPROP(stif,2,0,stiffness,f,0.0,1.0,1.0,stif)
 XPROP(rotstif,2,0,rotation stiffness,f,0.0,1.0,1.0,rotstif)
Index: /cpp/frams/config/f0.def
===================================================================
--- /cpp/frams/config/f0.def	(revision 914)
+++ /cpp/frams/config/f0.def	(revision 915)
@@ -13,9 +13,9 @@
 PROP(y,0,1024,position.y,f,,,,p.y)
 PROP(z,0,1024,position.z,f,,,,p.z)
-PROP(sh,1,0,shape,d,0,3,0,shape)
-PROP(s,1,0,size,f,0.1,10.0,1.0,size)
-PROP(sx,1,0,scale.x,f,0.001,1000.0,1.0,scale.x)
-PROP(sy,1,0,scale.y,f,0.001,1000.0,1.0,scale.y)
-PROP(sz,1,0,scale.z,f,0.001,1000.0,1.0,scale.z)
+PROP(sh,0,0,shape,d,0,3,0,shape)
+PROP(s,0,0,size,f,0.1,10.0,1.0,size)
+PROP(sx,0,0,scale.x,f,0.001,1000.0,1.0,scale.x)
+PROP(sy,0,0,scale.y,f,0.001,1000.0,1.0,scale.y)
+PROP(sz,0,0,scale.z,f,0.001,1000.0,1.0,scale.z)
 XPROP(h,1,0,hollow,f,0,1,0,hollow)
 XPROP(dn,1,0,density,f,0.2,5.0,1.0,density)
@@ -47,5 +47,15 @@
 PROP(dy,1,1024,delta.y,f,-2,2,0,d.y)
 PROP(dz,1,1024,delta.z,f,-2,2,0,d.z)
-PROP(sh,2,0,shape,d,0,1,0,shape)
+PROP(sh,1,0,shape,d,0,3,0,shape)
+PROP(hx,1,0,hinge position.x,f,,,0,hinge_pos.x)
+PROP(hy,1,1024,hinge position.y,f,,,0,hinge_pos.y)
+PROP(hz,1,1024,hinge position.z,f,,,0,hinge_pos.z)
+PROP(hrx,1,0,hinge rotation.x,f,,,0,hinge_rot.x)
+PROP(hry,1,1024,hinge rotation.y,f,,,0,hinge_rot.y)
+PROP(hrz,1,1024,hinge rotation.z,f,,,0,hinge_rot.z)
+PROP(hxn,1,0,hinge x negative limit,f,-6.2832,0,-1.5708,hinge_limit_x[0])
+PROP(hxp,1,1024,hinge x positive limit,f,0,6.2832,1.5708,hinge_limit_x[1])
+PROP(hyn,1,0,hinge y negative limit,f,-6.2832,0,-1.5708,hinge_limit_y[0])
+PROP(hyp,1,1024,hinge y positive limit,f,0,6.2832,1.5708,hinge_limit_y[1])
 XPROP(stif,2,0,stiffness,f,0.0,1.0,1.0,stif)
 XPROP(rotstif,2,0,rotation stiffness,f,0.0,1.0,1.0,rotstif)
@@ -65,5 +75,15 @@
 PROP(p1,0,1024,`part1 ref#',d,-1,999999,-1,p1_refno)
 PROP(p2,0,1024,`part2 ref#',d,-1,999999,-1,p2_refno)
-PROP(sh,2,0,shape,d,0,1,0,shape)
+PROP(sh,1,0,shape,d,0,3,0,shape)
+PROP(hx,1,0,hinge position.x,f,,,0,hinge_pos.x)
+PROP(hy,1,1024,hinge position.y,f,,,0,hinge_pos.y)
+PROP(hz,1,1024,hinge position.z,f,,,0,hinge_pos.z)
+PROP(hrx,1,0,hinge rotation.x,f,,,0,hinge_rot.x)
+PROP(hry,1,1024,hinge rotation.y,f,,,0,hinge_rot.y)
+PROP(hrz,1,1024,hinge rotation.z,f,,,0,hinge_rot.z)
+PROP(hxn,1,0,hinge x negative limit,f,-6.2832,0,-1.5708,hinge_limit_x[0])
+PROP(hxp,1,1024,hinge x positive limit,f,0,6.2832,1.5708,hinge_limit_x[1])
+PROP(hyn,1,0,hinge y negative limit,f,-6.2832,0,-1.5708,hinge_limit_y[0])
+PROP(hyp,1,1024,hinge y positive limit,f,0,6.2832,1.5708,hinge_limit_y[1])
 XPROP(stif,2,0,stiffness,f,0.0,1.0,1.0,stif)
 XPROP(rotstif,2,0,rotation stiffness,f,0.0,1.0,1.0,rotstif)
Index: /cpp/frams/model/defassign-f0-SDK.h
===================================================================
--- /cpp/frams/model/defassign-f0-SDK.h	(revision 914)
+++ /cpp/frams/model/defassign-f0-SDK.h	(revision 915)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -66,4 +66,14 @@
 d.z=0;
 shape=0;
+hinge_pos.x=0;
+hinge_pos.y=0;
+hinge_pos.z=0;
+hinge_rot.x=0;
+hinge_rot.y=0;
+hinge_rot.z=0;
+hinge_limit_x[0]=-1.5708;
+hinge_limit_x[1]=1.5708;
+hinge_limit_y[0]=-1.5708;
+hinge_limit_y[1]=1.5708;
 stif=1.0;
 rotstif=1.0;
Index: /cpp/frams/model/f0-SDK-classes.h
===================================================================
--- /cpp/frams/model/f0-SDK-classes.h	(revision 914)
+++ /cpp/frams/model/f0-SDK-classes.h	(revision 915)
@@ -71,5 +71,5 @@
 ParamEntry f0_joint_paramtab[]=
 {
- {"Connections",4,17,"j" },
+ {"Connections",4,27,"j" },
  {"Geometry",},
  {"Other properties",},
@@ -84,4 +84,14 @@
  {"dz",1,1024,"delta.z","f -2 2 0",FIELD(d.z),},
  {"sh",1,0,"shape","d 0 1 0",FIELD(shape),},
+ {"hx",1,0,"hinge position.x","f",FIELD(hinge_pos.x),},
+ {"hy",1,1024,"hinge position.y","f",FIELD(hinge_pos.y),},
+ {"hz",1,1024,"hinge position.z","f",FIELD(hinge_pos.z),},
+ {"hrx",1,0,"hinge rotation.x","f",FIELD(hinge_rot.x),},
+ {"hry",1,1024,"hinge rotation.y","f",FIELD(hinge_rot.y),},
+ {"hrz",1,1024,"hinge rotation.z","f",FIELD(hinge_rot.z),},
+ {"hxn",1,0,"hinge x negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_x[0]),},
+ {"hxp",1,1024,"hinge x positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_x[1]),},
+ {"hyn",1,0,"hinge y negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_y[0]),},
+ {"hyp",1,1024,"hinge y positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_y[1]),},
  {"stif",2,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
  {"rotstif",2,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),},
@@ -110,5 +120,5 @@
 ParamEntry f0_nodeltajoint_paramtab[]=
 {
- {"Connections",4,11,"j" },
+ {"Connections",4,21,"j" },
  {"Geometry",},
  {"Other properties",},
@@ -117,4 +127,14 @@
  {"p2",0,1024,"part2 ref#","d -1 999999 -1",FIELD(p2_refno),},
  {"sh",1,0,"shape","d 0 1 0",FIELD(shape),},
+ {"hx",1,0,"hinge position.x","f",FIELD(hinge_pos.x),},
+ {"hy",1,1024,"hinge position.y","f",FIELD(hinge_pos.y),},
+ {"hz",1,1024,"hinge position.z","f",FIELD(hinge_pos.z),},
+ {"hrx",1,0,"hinge rotation.x","f",FIELD(hinge_rot.x),},
+ {"hry",1,1024,"hinge rotation.y","f",FIELD(hinge_rot.y),},
+ {"hrz",1,1024,"hinge rotation.z","f",FIELD(hinge_rot.z),},
+ {"hxn",1,0,"hinge x negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_x[0]),},
+ {"hxp",1,1024,"hinge x positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_x[1]),},
+ {"hyn",1,0,"hinge y negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_y[0]),},
+ {"hyp",1,1024,"hinge y positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_y[1]),},
  {"stif",2,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
  {"rotstif",2,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),},
Index: /cpp/frams/model/model.cpp
===================================================================
--- /cpp/frams/model/model.cpp	(revision 914)
+++ /cpp/frams/model/model.cpp	(revision 915)
@@ -50,4 +50,5 @@
 	geno = mod.geno;
 	f0genoknown = 0;
+	shape = mod.shape;
 	startenergy = mod.startenergy;
 	modelfromgenotype = mod.modelfromgenotype;
Index: /cpp/frams/model/modelparts.cpp
===================================================================
--- /cpp/frams/model/modelparts.cpp	(revision 914)
+++ /cpp/frams/model/modelparts.cpp	(revision 915)
@@ -642,4 +642,6 @@
 	d = src.d;
 	shape = src.shape;
+	hinge_pos = src.hinge_pos;
+	hinge_rot = src.hinge_rot;
 	stamina = src.stamina;
 	stif = src.stif; rotstif = src.rotstif;
Index: /cpp/frams/model/modelparts.h
===================================================================
--- /cpp/frams/model/modelparts.h	(revision 914)
+++ /cpp/frams/model/modelparts.h	(revision 915)
@@ -124,6 +124,12 @@
 	class Pt3D d;		///< position delta between parts
 	class Pt3D rot;	///< orientation delta between parts expressed as 3 angles
-	enum Shape { SHAPE_BALL_AND_STICK = 0, SHAPE_FIXED = 1 };
-	paInt shape;///< ball-and-stick=old Framsticks compatible, creates a physical rod between parts (cylinder or cuboid), do not mix with shape>0,  fixed=merge parts into one physical entity
+	enum Shape { SHAPE_BALL_AND_STICK = 0, ///<  old Framsticks compatible, creates a physical rod between parts (cylinder or cuboid), do not mix with part.shape>0
+		     SHAPE_FIXED = 1, ///< merge parts into one physical entity
+		     SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot
+		     SHAPE_HINGE_XY = 3 }; ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot
+	paInt shape;///< values of type Shape (paInt for integration with Param)
+	class Pt3D hinge_pos; ///< hinge position (relative to part1) for HINGE_X and HINGE_XY
+	class Pt3D hinge_rot; ///< hinge orientation (relative to part1) for HINGE_X and HINGE_XY
+	double hinge_limit_x[2], hinge_limit_y[2]; ///< hinge movement range - i.e., extreme allowed values of a state. A state can be an angle or other physical property. limit[0] <= 0 <= limit[1]. Relative Part position and orientation as set in the Model define the initial state 0.
 
 	Joint();
