Adding sliders to all primitives

This commit is contained in:
LarsBrubaker 2021-09-12 20:23:40 -07:00
parent 3ac482f5e9
commit c36d270c92
23 changed files with 205 additions and 56 deletions

View file

@ -559,8 +559,20 @@ namespace MatterHackers.Plugins.EditorTools
public static Vector3 GetCenterPosition(IObject3D item, Placement placement)
{
var aabb = item.GetAxisAlignedBoundingBox(item.Matrix.Inverted);
var cornerPosition = aabb.Center;
var invertedMatrix = item.Matrix.Inverted;
var aabb = item.GetAxisAlignedBoundingBox(invertedMatrix);
Vector3 cornerPosition;
var useOriginXy = true;
if (useOriginXy)
{
cornerPosition = Vector3.Zero;
}
else
{
cornerPosition = aabb.Center;
}
switch (placement)
{
case Placement.Bottom: