mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-11 13:38:33 +00:00
Added a few comments, did a test print for cubist image imports.
This commit is contained in:
parent
79268ef334
commit
d951b5bea0
@ -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();
|
||||
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user