latest agg (fixes glfw render bug)
Made it possible to have curve not add geometry
This commit is contained in:
parent
4fe9f61dc6
commit
b415f36270
2 changed files with 18 additions and 8 deletions
|
|
@ -66,6 +66,9 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
[Description("Where to start the bend as a percent of the width of the part")]
|
||||
public double StartPercent { get; set; } = 50;
|
||||
|
||||
[Description("Split the mesh so it has enough geometry to create a smooth curve")]
|
||||
public bool SplitMesh { get; set; } = true;
|
||||
|
||||
public void DrawEditor(Object3DControlsLayer layer, List<Object3DView> transparentMeshes, DrawEventArgs e)
|
||||
{
|
||||
var sourceAabb = this.SourceContainer.GetAxisAlignedBoundingBox();
|
||||
|
|
@ -160,11 +163,14 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
// transform into this space
|
||||
transformedMesh.Transform(itemMatrix);
|
||||
|
||||
status.Status = "Split Mesh".Localize();
|
||||
reporter.Report(status);
|
||||
if (SplitMesh)
|
||||
{
|
||||
status.Status = "Split Mesh".Localize();
|
||||
reporter.Report(status);
|
||||
|
||||
// split the mesh along the x axis
|
||||
transformedMesh.SplitOnPlanes(Vector3.UnitX, cuts, cutSize / 8);
|
||||
// split the mesh along the x axis
|
||||
transformedMesh.SplitOnPlanes(Vector3.UnitX, cuts, cutSize / 8);
|
||||
}
|
||||
|
||||
for (int i = 0; i < transformedMesh.Vertices.Count; i++)
|
||||
{
|
||||
|
|
@ -186,10 +192,14 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
// transform back into item local space
|
||||
transformedMesh.Transform(Matrix4X4.CreateTranslation(-rotationCenter) * itemMatrix.Inverted);
|
||||
|
||||
status.Status = "Merge Vertices".Localize();
|
||||
reporter.Report(status);
|
||||
if (SplitMesh)
|
||||
{
|
||||
status.Status = "Merge Vertices".Localize();
|
||||
reporter.Report(status);
|
||||
|
||||
transformedMesh.MergeVertices(.1);
|
||||
}
|
||||
|
||||
transformedMesh.MergeVertices(.1);
|
||||
transformedMesh.CalculateNormals();
|
||||
|
||||
var curvedChild = new Object3D()
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 745e92f0c8792f2009084af63bd2eed9180c1789
|
||||
Subproject commit 6036f5fb4fde9769ee9d1a9f2efb213ea981ec28
|
||||
Loading…
Add table
Add a link
Reference in a new issue