private void MirrorAllShapes(NodeBuilder liveShape) { var bounding = ComputeEnclosingBoundingBox(); if (liveShape.LastExecute) { bounding = CombineBoundingBoxWithShape(liveShape, bounding); } _mirrorDocument.Undo(); _mirrorDocument.Transact(); var floorRectangle = BuildFloor(bounding); var plane = ShapeUtils.ExtractPlaneFromFaceShape(floorRectangle.Shape); var mirrorTransform = ShapeUtils.ExtractPlaneMirrorTransform(plane); ClearMirrors(); if (liveShape.LastExecute) { MirrorBuilder(liveShape, mirrorTransform); } foreach (var shapeNode in _document.Root.Children.Values) { GetCacheItem(shapeNode.Index, mirrorTransform); } ViewRedraw(); }
public override bool Execute() { var sourceBuilder = new NodeBuilder(Dependency[0].Reference); var targetBuilder = new NodeBuilder(Dependency[1].Reference); var profile = sourceBuilder.TransformedShape; var targetFace = targetBuilder.TransformedShape; Ensure.IsTrue(ShapeUtils.IsPlanarFace(targetFace)); var plane = ShapeUtils.ExtractPlaneFromFaceShape(targetFace); var referenceTransformation = Dependency[0].Reference.Get <TransformationInterpreter>().CurrTransform; var mirroredShape = profile.Located(new TopLocLocation(referenceTransformation)); var transformation = Parent.Set <TransformationInterpreter>(); // transformation.CurrTransform.SetMirror(plane.Position.Ax2); Shape = mirroredShape; return(Shape != null); }