[770c98]: / Application / Examples / KneeSimulator / Model / Contacts.any

Download this file

342 lines (290 with data), 11.7 kB

Main.Model.Segs.Femur = {
  
  AnySurfSTL ContactSurf = {
    FileName = "..\Input\STL_New\Femoral Component_scaled_cut_ContactSurf.stl" ;
    ScaleXYZ = {1, 1, 1};
    AnyDrawSurf DrwSurf = {
      FileName = .FileName;
      ScaleXYZ = .ScaleXYZ;
      Visible = Off;
      RGB = 1*{1, 0, 1};
      Opacity = 0.5;
    };      
  };
  
  AnyInputXML XML_Points_Posterior = {
    FileName = "..\Input\STL_New\Femoral Component_scaled_picked_points_Posterior.pp";
  };
  AnyFloat Points_Posterior_xptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Posterior_yptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Posterior_zptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Posterior = {Points_Posterior_xptr0',Points_Posterior_yptr0',Points_Posterior_zptr0'}';//, yptr0, zptr0};    
  
  AnyDrawPointCloud Drw_Points_Posterior = {
    Points = .Points_Posterior;
    Visible = Off;
    RGB = {0, 0, 0};
  };
  
  AnySurfCylinderFit FitBaseNode_Posterior = {
    // construct a ref. frame with computed center and orientation    
      Length = 0.08;
      Points = .Points_Posterior ;
      AnyDrawParamSurf Drw={
        Visible = Off;
        RGB={1,0,0};
        Opacity=0.2;
      };
      Direction = {0, 0, 1};
      FixedDirection = On;
  };   
  
  AnyInputXML XML_Points_Anterior = {
    FileName = "..\Input\STL_New\Femoral Component_scaled_picked_points_Anterior.pp";
  };
  AnyFloat Points_Anterior_xptr0 = Obj2Num(ObjSelect("XML_Points_Anterior.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Anterior_yptr0 = Obj2Num(ObjSelect("XML_Points_Anterior.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Anterior_zptr0 = Obj2Num(ObjSelect("XML_Points_Anterior.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Anterior= {Points_Anterior_xptr0',Points_Anterior_yptr0',Points_Anterior_zptr0'}';//, yptr0, zptr0};    
  
  AnySurfCylinderFit FitBaseNode_Anterior= {
    // construct a ref. frame with computed center and orientation
      Length = 0.08;
      Points = .Points_Anterior ;
      AnyDrawParamSurf Drw={
        Visible=Off;
        RGB={1,0,0};
        Opacity=0.2;
      };
      Direction = {0, 0, 1};
      FixedDirection = On;
  };
  
  AnyInputXML XML_Points_Lateral = {
    FileName = "..\Input\STL_New\Femoral Component_scaled_picked_points_PF_Lateral.pp";
  };
  AnyFloat Points_Lateral_xptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Lateral_yptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Lateral_zptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Lateral= {Points_Lateral_xptr0',Points_Lateral_yptr0',Points_Lateral_zptr0'}';//, yptr0, zptr0};     
  
  AnyDrawPointCloud Drw_Points_Lateral= {
    Points = .Points_Lateral;
    Visible= Off;
    RGB = {0, 0, 0};
  }; 
  
  AnySurfCylinderFit FitBaseNode_Lateral= {
    // construct a ref. frame with computed center and orientation
    
    AnyRefNode RotNode = {
      ARel = RotMat(10/180*pi, x);
      AnySurfEllipsoid FitEllip = {
        Radius = {..Radius, ..Radius, 0.0275};
        AnyDrawParamSurf Drw={
          Visible=Off;
          RGB={1,0,0};
          Opacity=0.2;};
      };        
    };
    Length = 0.00;
    Direction = {0, 0, 1};
    FixedDirection = On;
    Points = .Points_Lateral ;
    AnyDrawParamSurf Drw={
      Visible=Off;
      RGB={1,0,0};
      Opacity=0.2;
    };
  };
  
  AnyInputXML XML_Points_Medial = {
    FileName = "..\Input\STL_New\Femoral Component_scaled_picked_points_PF_Medial.pp";
  };
  AnyFloat Points_Medial_xptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Medial_yptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Medial_zptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Medial= {Points_Medial_xptr0',Points_Medial_yptr0',Points_Medial_zptr0'}';//, yptr0, zptr0};    
  
  AnyDrawPointCloud Drw_Points_Medial= {
    Points = .Points_Medial;
    Visible= Off;
    RGB = {0, 0, 0};
  };    
  
  AnySurfCylinderFit FitBaseNode_Medial= {
    // construct a ref. frame with computed center and orientation    
    AnyRefNode RotNode = {
      ARel = RotMat(-15/180*pi, x);
      AnySurfEllipsoid FitEllip = {
        Radius = {..Radius, ..Radius,  0.0285};
        AnyDrawParamSurf Drw={
          Visible=Off;
          RGB={1,0,0};
          Opacity=0.2;};
      };        
    };      
    
    Length = 0.00;
    Direction = {0, 0, 1};
    FixedDirection = On;
    Points = .Points_Medial;
    AnyDrawParamSurf Drw={
      Visible=Off;
      RGB={1,0,0};
      Opacity=0.2;
    };
  };    
};//Femur

Main.Model.Segs.Tibia = {

  //split tibial contact surface into lateral and medial compartments
  AnySurfSTL ContactSurf_medial = {
    FileName = "..\Input\STL_New\medial_tibia_insert_cut_ContactSurf.stl";
    ScaleXYZ = {1, 1, 1};
    AnyDrawSurf DrwSurf = {
      FileName = .FileName;
      ScaleXYZ = .ScaleXYZ;
      Visible=Off;
      RGB = 1*{1, 0, 1};
      Opacity = 0.5;
    };      
  }; 
  
  AnySurfSTL ContactSurf_lateral = {
    FileName = "..\Input\STL_New\lateral_tibia_insert_cut_ContactSurf.stl";
    ScaleXYZ = {1, 1, 1};
    AnyDrawSurf DrwSurf = {
      FileName = .FileName;
      ScaleXYZ = .ScaleXYZ;
      Visible=Off;
      RGB = 1*{1, 0, 1};
      Opacity = 0.5;
    };      
  }; 
  
  AnyInputXML XML_Points_Medial = {
    FileName = "..\Input\STL_New\Tibial Tray_scaled_remeshed_picked_points_Medial.pp";
  };
  AnyFloat Points_Medial_xptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Medial_yptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Medial_zptr0 = Obj2Num(ObjSelect("XML_Points_Medial.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Medial= {Points_Medial_xptr0',Points_Medial_yptr0',Points_Medial_zptr0'}';//, yptr0, zptr0};    
  
  AnyDrawPointCloud Drw_Points_Medial = {
    Points = .Points_Medial;
    Visible= Off;
    RGB = {0, 0, 0};
  };
  
  AnySurfCylinderFit FitBaseNode_Medial = {
    // construct a ref. frame with computed center and orientation    
    Length = 0.016;
    Points = .Points_Medial;
    AnyDrawParamSurf Drw={
      Visible = Off;
      RGB={1,0,0};
      Opacity=0.2;
    };
    Direction = {0, 1, 0};
    FixedDirection = On;
  };
  
  AnyInputXML XML_Points_Lateral = {
    FileName = "..\Input\STL_New\Tibial Tray_scaled_remeshed_picked_points_Lateral.pp";
  };
  AnyFloat Points_Lateral_xptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Lateral_yptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Lateral_zptr0 = Obj2Num(ObjSelect("XML_Points_Lateral.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Lateral= {Points_Lateral_xptr0',Points_Lateral_yptr0',Points_Lateral_zptr0'}';//, yptr0, zptr0};    
  
  AnyDrawPointCloud Drw_Points_Lateral = {
    Points = .Points_Lateral;
    Visible=Off;      
    RGB = {0, 0, 0};
  };
  
  AnySurfCylinderFit FitBaseNode_Lateral = {
    // construct a ref. frame with computed center and orientation
    Length = 0.016;
    Points = .Points_Lateral;
    AnyDrawParamSurf Drw={
      Visible= Off;
      RGB={1,0,0};
      Opacity=0.2;
    };
    Direction = {0, 1, 0};
    FixedDirection = On;
    CapRatio = 0.25;
  };
  
  AnyInputXML XML_Points_Posterior = {
    FileName = "..\Input\STL_New\Tibial Insert_scaled_remeshed_picked_points_Posterior.pp";
  };
  AnyFloat Points_Posterior_xptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".x_*"));
  AnyFloat Points_Posterior_yptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".y_*"));
  AnyFloat Points_Posterior_zptr0 = Obj2Num(ObjSelect("XML_Points_Posterior.Contents.PickedPoints.point*.active", "==1", ".z_*"));
  AnyFloat Points_Posterior= {Points_Posterior_xptr0',Points_Posterior_yptr0',Points_Posterior_zptr0'}';//, yptr0, zptr0};    
  
  AnyDrawPointCloud Drw_Points_Posterior = {
    Points = .Points_Posterior;
    Visible = Off;
    RGB = {0, 0, 0};
  };
  
  AnySurfPlaneFit FitBaseNode_Posterior = {
    // construct a ref. frame with computed center and orientation
    Radius = {0.02, 0.007, 1e-005};
    Points = .Points_Posterior;
    AnyDrawParamSurf Drw={
      Visible=Off;
      RGB={1,0,0};
      Opacity=0.2;
    };

    AnySurfEllipsoid FitEllipsoid = {
      Radius = {0.015, 0.007, 1e-003};
      AnyDrawParamSurf Drw={
        Visible = Off;
        RGB={1,0,0};
        Opacity=0.2;}; 
    };
  };        
};

Main.Model.Segs.Patella = {
  AnySurfSTL ContactSurf = {
    FileName = "..\Input\STL_New\Patellar Button_scaled_remeshed_cut_ContactSurf.stl" ;
    ScaleXYZ = 1.0*{1, 1, 1};
    
    AnyDrawSurf DrwSurf = {
      FileName = .FileName;
      ScaleXYZ = .ScaleXYZ;
      Visible = Off;
      RGB = {1, 0, 1};
      Opacity = 0.5;
    };      
  };    
};

AnyFolder Contacts = {
  
  #if USE_FDK == 1
  
  //define two surface contacts to examine lateral and medial tibial compartments
  AnyForceSurfaceContact Femur_Tibia_medial = {
    AnySurface &sMaster = ..Segs.Tibia.ContactSurf_medial;
    AnySurface &sSlave = ..Segs.Femur.ContactSurf ;
    
    PressureModule = DEF_CONTACT_PRESSURE_TIBIOFEMORAL ;
    
    ForceViewOnOff = On;
    MeshRefinementMaster = 0;
    MeshRefinementSlave = 0;
    SingleSidedOnOff= 1;
    
    #if DEF_CONTACT_DRAW_PRESSURE_MAP == 1
    
    AnyDrawForceSurface DrwSurfaceContact = {
      DrawSurf1RGB = {1, 0, 0};
      DrawSurf2RGB = {0, 0, 1};
    };
    #endif   
  }; 
  
  AnyForceSurfaceContact Femur_Tibia_lateral = {
    AnySurface &sMaster = ..Segs.Tibia.ContactSurf_lateral;
    AnySurface &sSlave = ..Segs.Femur.ContactSurf ;
    
    PressureModule = DEF_CONTACT_PRESSURE_TIBIOFEMORAL ;
    
    ForceViewOnOff = On;
    MeshRefinementMaster = 0;
    MeshRefinementSlave = 0;
    SingleSidedOnOff= 1;
    
    #if DEF_CONTACT_DRAW_PRESSURE_MAP == 1
    
    AnyDrawForceSurface DrwSurfaceContact = {
      DrawSurf1RGB = {1, 0, 0};
      DrawSurf2RGB = {0, 0, 1};
    };
    #endif   
  }; 
  
  AnyForceSurfaceContact Femur_Patella = {
    AnySurface &sMaster = ..Segs.Patella.ContactSurf;
    AnySurface &sSlave  = ..Segs.Femur.ContactSurf ;
    
    PressureModule = DEF_CONTACT_PRESSURE_PATELLOFEMORAL;
    
    ForceViewOnOff = On;
    MeshRefinementMaster = 0;
    MeshRefinementSlave = 0;
    SingleSidedOnOff= 1; 
    
    #if DEF_CONTACT_DRAW_PRESSURE_MAP == 1
    
    AnyDrawForceSurface DrwSurfaceContact = {
      DrawSurf1RGB = {0, 0, 1};
      DrawSurf2RGB = {1, 0, 0};
    };
    #endif    
  };  
  #endif 
};