Exemple #1
0
        private static void ApplyTranslate(gpPnt currentLocation, Point3D increment, Node sketchNode)
        {
            var currentAxis = NodeBuilderUtils.GetTransformedAxis(new NodeBuilder(sketchNode));

            var trsfCurrent = sketchNode.Get <TransformationInterpreter>().CurrTransform;
            var newPosition = new Point3D(currentAxis.Location.X + increment.X,
                                          currentAxis.Location.Y + increment.Y,
                                          currentAxis.Location.Z + increment.Z);
            var    newSystemAxis = new gpAx3(newPosition.GpPnt, currentAxis.Direction);
            gpTrsf T             = new gpTrsf();

            T.SetDisplacement(new gpAx3(currentAxis.Location, currentAxis.Direction), newSystemAxis);

            trsfCurrent = T.Multiplied(trsfCurrent);
            sketchNode.Set <TransformationInterpreter>().CurrTransform = trsfCurrent;
            var nb = new NodeBuilder(sketchNode);

            nb.ExecuteFunction();
        }