Merge pull request #3110 from jlewin/design_tools

Restore ImageConverter base functionality
This commit is contained in:
johnlewin 2018-03-22 17:12:00 -07:00 committed by GitHub
commit 314a52f964
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View file

@ -29,14 +29,13 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using ClipperLib;
using MatterHackers.Agg.Transform;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.DataConverters2D;
using MatterHackers.DataConverters3D;
using MatterHackers.PolygonMesh;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl.DesignTools
{
@ -52,13 +51,13 @@ namespace MatterHackers.MatterControl.DesignTools
{
}
public double ExtrusionHeight { get; set; } = 5;
public int InfillAmount { get; internal set; }
public BaseTypes CurrentBaseType { get; set; }
public int BaseSize { get; set; }
public IVertexSource VertexSource { get; set; }
public static BaseObject3D Create()
{
var item = new BaseObject3D();
@ -70,8 +69,14 @@ namespace MatterHackers.MatterControl.DesignTools
{
var aabb = this.GetAxisAlignedBoundingBox();
Polygons polygonShape = null;
// Fall back to sibling content if VertexSource is unset
var vertexSource = this.VertexSource ?? this.Parent.Children.OfType<IPathObject>().FirstOrDefault().VertexSource;
// Convert VertexSource into expected Polygons
Polygons polygonShape = (vertexSource == null) ? null : VertexSourceToClipperPolygons.CreatePolygons(vertexSource);
GenerateBase(polygonShape);
if (aabb.ZSize > 0)
{
// If the part was already created and at a height, maintain the height.

@ -1 +1 @@
Subproject commit 56dcc696d8f1ab7ba9a411147eea39cb7b322305
Subproject commit d831c5bd787e0913d0dc25b1c6b28a162bf73207