java.lang.Object
simpa.core.api.Profile
Object that represents a profile of the shape of the beam region.
-
Constructor Summary
ConstructorsConstructorDescriptionProfile
(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) Creates a rectangular profile in the X, Y plane.Profile
(double xRadius, double yRadius, int steps, double startingAngle) Creates an ellipse profile in the X, Y plane with the following code:Creates a general profile in the X, Y plane from a set of 3D points in the given file. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.math3.geometry.euclidean.threed.Vector3D
Gets the origin of the profile.List
<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> Gets the list of points that make up the profile.getTransformedCopy
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) Makes a copy of this profile with the given translation and rotation.boolean
void
setDefaultProfile
(boolean defaultProfile) toString()
Returns the points in the profile as string for debugging.
-
Constructor Details
-
Profile
Creates a general profile in the X, Y plane from a set of 3D points in the given file. The Z coordinate must be zero for all points.- Parameters:
file
- Filename- Throws:
FileNotFoundException
- when the file is not found
-
Profile
public Profile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps) Creates a rectangular profile in the X, Y plane. The first profile point is in the bottom left corner.- Parameters:
xmin
- Minimum X coordinate.xmax
- Maximum X coordinate.ymin
- Minimum Y coordinate.ymax
- Maximum Y coordinate.xsteps
- Number of points in the profile in the X direction.ysteps
- Number of points in the profile in the Y direction.
-
Profile
public Profile(double xRadius, double yRadius, int steps, double startingAngle) Creates an ellipse profile in the X, Y plane with the following code:- Parameters:
xRadius
- Horizontal radius of the ellipseyRadius
- Vertical radius of the ellipsesteps
- Number of points in the profilestartingAngle
- To modify the staring angle where the profile starts. By default, it is zero and the first profile points starts at fi = -3*Math.PI/4 The retangular profile starts at the left bottom corner. We need to align the ellipse profile to start at the same angle that's why the - 3*Math.PI/4
-
-
Method Details
-
getTransformedCopy
public Profile getTransformedCopy(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot) Makes a copy of this profile with the given translation and rotation.- Parameters:
translation
- distance to addrot
- rotation to apply to profile- Returns:
- a copy of the profile with the given translation and rotation
-
getPoints
Gets the list of points that make up the profile.- Returns:
- The list of points.
-
getOrigin
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getOrigin()Gets the origin of the profile.- Returns:
- Vector3D of the origin.
-
toString
Returns the points in the profile as string for debugging. One point per line -
isDefaultProfile
public boolean isDefaultProfile()- Returns:
- A flag indicating if this is a default profile for the beam region. We use this property to detect overlapping vacuum chambers.
-
setDefaultProfile
public void setDefaultProfile(boolean defaultProfile)
-