Created
November 24, 2012 18:11
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a method for calculating PCB conditions