improving rotation

This commit is contained in:
MatterHackers 2023-12-03 15:05:57 -08:00
parent 25dd3c7f78
commit 8e772944c5
4 changed files with 6 additions and 5 deletions

View file

@ -443,8 +443,6 @@ namespace MatterHackers.MatterControl
var itemClone = sceneItem.Clone();
revolve.Children.Add(itemClone);
revolve.Matrix = itemClone.Matrix;
itemClone.Matrix = Matrix4X4.Identity;
scene.SelectedItem = null;
scene.UndoBuffer.AddAndDo(new ReplaceCommand(new[] { sceneItem }, new[] { revolve }));

View file

@ -29,7 +29,6 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.Threading.Tasks;
using MatterControlLib.DesignTools.Operations.Path;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.DataConverters3D;

View file

@ -136,7 +136,9 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
public void DrawEditor(Object3DControlsLayer layer, DrawEventArgs e)
{
var path = this.CombinedVisibleChildrenPaths();
if (path != null)
// we only draw the rotation line if we are not rotated
if (path != null
&& Rotation.Value(this) == 0)
{
var (start, end) = GetStartEnd(this, path);
layer.World.Render3DLine(start, end, Color.Red, true);
@ -198,6 +200,8 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
vertexSource = vertexSource.Translate(-pathBounds.Left - axisPosition, 0);
Mesh mesh = VertexSourceToMesh.Revolve(vertexSource,
sides,
// A right hand rule rotation about y would make the part go clockwise into the ground so we need to rotate the other way
// Starting at the end and going to the start
MathHelper.DegreesToRadians(360 - endingAngle),
MathHelper.DegreesToRadians(360 - startingAngle),
false);

@ -1 +1 @@
Subproject commit ea29e79df34dc1ad8bac8f09e4333f49212922db
Subproject commit 4a3185d8d49855cf6ade9d2bf2ada19e101d731f