public interface SphereCovering
Interface with factory methods for creating different SphereCovering
implementations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SphereCovering
createHCPLatticeCover
(String coverFilename) Creates a HCPLatticeCover from a cover file in format X Y Z Radius.static SphereCovering
createHCPLatticeCover
(String stlFile, double ballRadius) Creates an HCP lattice of equal spheres with a given radius.static SphereCovering
createHCPLatticeCover
(List<Profile> profiles, double ballRadius, boolean circularPath) Creates an HCP lattice of equal spheres with a given radius.static SphereCovering
createSingleRowCover
(String file) Creates a single row cover from a cover file.static SphereCovering
createSingleRowCover
(List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> pathPoints, double apertureRadius, double ballRadius, boolean closedPath) Creates a single row cover around a given orbit with with a single line of balls centered on the orbit.The balls overlap such a way that it always covers a given aperture around the orbit.Gets the covering spheres.Gets the cover type for the covering.void
Writes the sphere covering to a file.
-
Method Details
-
createHCPLatticeCover
Creates a HCPLatticeCover from a cover file in format X Y Z Radius. It reads also the corresponding .stl file.- Parameters:
coverFilename
- Cover file name.- Returns:
- an HCPLatticeCover object with the lattice covering.
- Throws:
FileNotFoundException
-
createHCPLatticeCover
static SphereCovering createHCPLatticeCover(String stlFile, double ballRadius) throws KnownFatalException Creates an HCP lattice of equal spheres with a given radius. this class keeps a list of those spheres, which have the centers inside the surface described by the STL file. See: https://en.wikipedia.org/wiki/Close-packing_of_equal_spheres- Parameters:
stlFile
- STL file nameballRadius
- Radius of the spheres- Returns:
- The created HCP lattice sphere covering.
- Throws:
KnownFatalException
- when an internal error happens.
-
createHCPLatticeCover
static SphereCovering createHCPLatticeCover(List<Profile> profiles, double ballRadius, boolean circularPath) throws KnownFatalException Creates an HCP lattice of equal spheres with a given radius. this class keeps a list of those spheres, which have the centers inside the surface described by the profile.- Parameters:
profiles
- List of profiles that describe the surface.ballRadius
- Radius of the spherescircularPath
- True if the path is circular.- Returns:
- The created HCP lattice sphere covering.
- Throws:
KnownFatalException
-
createSingleRowCover
static SphereCovering createSingleRowCover(List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> pathPoints, double apertureRadius, double ballRadius, boolean closedPath) Creates a single row cover around a given orbit with with a single line of balls centered on the orbit.The balls overlap such a way that it always covers a given aperture around the orbit.- Parameters:
pathPoints
- points on the path that make up the orbit.apertureRadius
- used to calculate the ball centers.ballRadius
- used to calculate the ball centers.closedPath
- True if the path is closed (circular)- Returns:
- the created single row sphere covering.
-
createSingleRowCover
Creates a single row cover from a cover file. The file contains X,Y,Z, radius in each row. each row corresponds to a sphere.- Parameters:
file
- input file.- Returns:
- a new instance of a single row cover.
- Throws:
FileNotFoundException
-
toFile
Writes the sphere covering to a file.- Parameters:
outfile
- name of the output file.
-
getCoverType
CoverType getCoverType()Gets the cover type for the covering.- Returns:
- the cover type.
-
getCoveringSpheres
List<SphereDescripton> getCoveringSpheres()Gets the covering spheres.- Returns:
- the covering spheres.
-