Class ModelUtil


  • public class ModelUtil
    extends Object
    • Method Detail

      • loadModel

        public static Polygon2D[] loadModel​(Path fileLocation)
        Gets a Polygon2D array, loaded from a .psdf file.

        This method allows the user to load an array of Polygon2Ds from a single file, decreasing the amount of models that have to be programmed in.

        Furthermore, this allows for easy use of the Model2D class, allowing you to directly use the resulting array from this method to create a Model2D object.

        Parameters:
        fileLocation - Location of the file.
        Returns:
        An array of Polygon2Ds.
      • writeModel

        public static void writeModel​(Path destinationPath,
                                      Model2D model)
        Writes a model file containing the current state of the Polygon2Ds that make up the specified Model2D.
        Parameters:
        destinationPath - The destination path of the model file that will be written.
        model - The Model2D that will be written to the file.