Added a few comments, did a test print for cubist image imports.

This commit is contained in:
Michael Smith 2016-05-03 23:03:47 -07:00
parent 79268ef334
commit d951b5bea0
3 changed files with 15 additions and 3 deletions

View File

@ -57,8 +57,15 @@ namespace OSCADSharp.ConsoleTests
static void Main(string[] args)
{
var img = ImportedImage.FromFile("seahawks coaster.png");
img.ToFile("seaImg").Open();
var img = ImportedImage.FromFile("seahawks coaster.png").Scale(1, 1, Inches.Quarter + Inches.Eigth);
var imgPos = img.Position();
var _base = new Cylinder(img.Bounds().Width + Inches.Quarter, Inches.Quarter);
var rim = _base.Clone().Scale(1, 1, 1.25) - _base.Clone().Scale(.9, .9, 3.5).Translate(0, 0, -Inches.Eigth);
var coaster = img + _base.Translate(imgPos.X, imgPos.Y, 0) + rim.Translate(imgPos.X, imgPos.Y, Inches.Quarter); ;
coaster.ToFile("seaImg").Open();
//makePeg();

View File

@ -47,7 +47,7 @@ namespace OSCADSharp.Solids.Imported
throw new InvalidOperationException("Cannot process images larger greater than 200x200 pixels");
}
this.ImageBounds = new Bounds(new Vector3(), new Vector3(img.Width, img.Height, 0));
this.ImageBounds = new Bounds(new Vector3(), new Vector3(img.Width, img.Height, 1));
List<OSCADObject> cubes = new List<OSCADObject>();
bool[,] visited = new bool[img.Width, img.Height];

View File

@ -20,6 +20,11 @@ namespace OSCADSharp.Solids.Imported
#endregion
#region Constructors / Initialization
/// <summary>
/// Creates an imported image from the specified file
/// </summary>
/// <param name="imagePath"></param>
/// <returns></returns>
public static ImportedImage FromFile(string imagePath)
{