Changeset 915 for cpp/frams/model


Ignore:
Timestamp:
04/20/20 23:33:31 (4 years ago)
Author:
Maciej Komosinski
Message:

Added fields to characterize hinges in "solid shape"-type Models

Location:
cpp/frams/model
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/defassign-f0-SDK.h

    r732 r915  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    6666d.z=0;
    6767shape=0;
     68hinge_pos.x=0;
     69hinge_pos.y=0;
     70hinge_pos.z=0;
     71hinge_rot.x=0;
     72hinge_rot.y=0;
     73hinge_rot.z=0;
     74hinge_limit_x[0]=-1.5708;
     75hinge_limit_x[1]=1.5708;
     76hinge_limit_y[0]=-1.5708;
     77hinge_limit_y[1]=1.5708;
    6878stif=1.0;
    6979rotstif=1.0;
  • cpp/frams/model/f0-SDK-classes.h

    r754 r915  
    7171ParamEntry f0_joint_paramtab[]=
    7272{
    73  {"Connections",4,17,"j" },
     73 {"Connections",4,27,"j" },
    7474 {"Geometry",},
    7575 {"Other properties",},
     
    8484 {"dz",1,1024,"delta.z","f -2 2 0",FIELD(d.z),},
    8585 {"sh",1,0,"shape","d 0 1 0",FIELD(shape),},
     86 {"hx",1,0,"hinge position.x","f",FIELD(hinge_pos.x),},
     87 {"hy",1,1024,"hinge position.y","f",FIELD(hinge_pos.y),},
     88 {"hz",1,1024,"hinge position.z","f",FIELD(hinge_pos.z),},
     89 {"hrx",1,0,"hinge rotation.x","f",FIELD(hinge_rot.x),},
     90 {"hry",1,1024,"hinge rotation.y","f",FIELD(hinge_rot.y),},
     91 {"hrz",1,1024,"hinge rotation.z","f",FIELD(hinge_rot.z),},
     92 {"hxn",1,0,"hinge x negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_x[0]),},
     93 {"hxp",1,1024,"hinge x positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_x[1]),},
     94 {"hyn",1,0,"hinge y negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_y[0]),},
     95 {"hyp",1,1024,"hinge y positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_y[1]),},
    8696 {"stif",2,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
    8797 {"rotstif",2,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),},
     
    110120ParamEntry f0_nodeltajoint_paramtab[]=
    111121{
    112  {"Connections",4,11,"j" },
     122 {"Connections",4,21,"j" },
    113123 {"Geometry",},
    114124 {"Other properties",},
     
    117127 {"p2",0,1024,"part2 ref#","d -1 999999 -1",FIELD(p2_refno),},
    118128 {"sh",1,0,"shape","d 0 1 0",FIELD(shape),},
     129 {"hx",1,0,"hinge position.x","f",FIELD(hinge_pos.x),},
     130 {"hy",1,1024,"hinge position.y","f",FIELD(hinge_pos.y),},
     131 {"hz",1,1024,"hinge position.z","f",FIELD(hinge_pos.z),},
     132 {"hrx",1,0,"hinge rotation.x","f",FIELD(hinge_rot.x),},
     133 {"hry",1,1024,"hinge rotation.y","f",FIELD(hinge_rot.y),},
     134 {"hrz",1,1024,"hinge rotation.z","f",FIELD(hinge_rot.z),},
     135 {"hxn",1,0,"hinge x negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_x[0]),},
     136 {"hxp",1,1024,"hinge x positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_x[1]),},
     137 {"hyn",1,0,"hinge y negative limit","f -6.2832 0 -1.5708",FIELD(hinge_limit_y[0]),},
     138 {"hyp",1,1024,"hinge y positive limit","f 0 6.2832 1.5708",FIELD(hinge_limit_y[1]),},
    119139 {"stif",2,0,"stiffness","f 0.0 1.0 1.0",FIELD(stif),},
    120140 {"rotstif",2,0,"rotation stiffness","f 0.0 1.0 1.0",FIELD(rotstif),},
  • cpp/frams/model/model.cpp

    r900 r915  
    5050        geno = mod.geno;
    5151        f0genoknown = 0;
     52        shape = mod.shape;
    5253        startenergy = mod.startenergy;
    5354        modelfromgenotype = mod.modelfromgenotype;
  • cpp/frams/model/modelparts.cpp

    r899 r915  
    642642        d = src.d;
    643643        shape = src.shape;
     644        hinge_pos = src.hinge_pos;
     645        hinge_rot = src.hinge_rot;
    644646        stamina = src.stamina;
    645647        stif = src.stif; rotstif = src.rotstif;
  • cpp/frams/model/modelparts.h

    r899 r915  
    124124        class Pt3D d;           ///< position delta between parts
    125125        class Pt3D rot; ///< orientation delta between parts expressed as 3 angles
    126         enum Shape { SHAPE_BALL_AND_STICK = 0, SHAPE_FIXED = 1 };
    127         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
     126        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
     127                     SHAPE_FIXED = 1, ///< merge parts into one physical entity
     128                     SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot
     129                     SHAPE_HINGE_XY = 3 }; ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot
     130        paInt shape;///< values of type Shape (paInt for integration with Param)
     131        class Pt3D hinge_pos; ///< hinge position (relative to part1) for HINGE_X and HINGE_XY
     132        class Pt3D hinge_rot; ///< hinge orientation (relative to part1) for HINGE_X and HINGE_XY
     133        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.
    128134
    129135        Joint();
Note: See TracChangeset for help on using the changeset viewer.