Skip to content

Instantly share code, notes, and snippets.

@thisMagpie
Created November 24, 2012 18:11
Show Gist options
  • Select an option

  • Save thisMagpie/4140752 to your computer and use it in GitHub Desktop.

Select an option

Save thisMagpie/4140752 to your computer and use it in GitHub Desktop.
PBC code: Checked and Works if it is called in leapPosition. Seems to fix min image issue from earlier
public static Vector3D boundaryPositions(Vector3D position){
double posX=position.getX();
double posY=position.getY();
double posZ=position.getZ();
/*********** X Direction ***********/
if(posX < 0)
posX = posX + lengthOfBox;
//if it goes over the max box coordinates subtract from box length to get t'other side
else if(posX > lengthOfBox)
posX = posX - lengthOfBox;
/************ Y Direction ***********/
if(posY < 0)
posY = posY + lengthOfBox;
//if it goes over the max box coordinates subtract from box length to get t'other side
else if(posY > lengthOfBox)
posY = posY - lengthOfBox;
/********* Z Direction ***********/
if(posZ < 0)
posZ = posZ + lengthOfBox;
//if it goes over the max box coordinates subtract from box length to get t'other side
else if(posZ > lengthOfBox)
posZ = posZ - lengthOfBox;
return new Vector3D(posX, posY, posZ);
}
@thisMagpie
Copy link
Author

Just a method for calculating PCB conditions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment