Ejemplo n.º 1
0
        public void VarUpdate(GeoVariable geovar)
        {
            CurveVariable crvvar        = (CurveVariable)geovar;
            Point3d       newpoint      = Points[crvvar.u];
            Point3d       originalPoint = OriginalPoints[crvvar.u];

            //Not used?
            //int n = Curve.Points.Distinct<ControlPoint>().Count();

            switch (crvvar.Dir)
            {
            case (int)Direction.X:
                newpoint.X = originalPoint.X + crvvar.CurrentValue;
                break;

            case (int)Direction.Y:
                newpoint.Y = originalPoint.Y + crvvar.CurrentValue;
                break;

            case (int)Direction.Z:
                newpoint.Z = originalPoint.Z + crvvar.CurrentValue;
                break;
            }

            Points[crvvar.u] = newpoint;
        }
        public void VarUpdate(GeoVariable geovar)
        {
            SurfaceVariable srfvar = (SurfaceVariable)geovar;
            // the current surface point (newPoint) tracks the previous changes applied in the iteration at other coordinates
            Point3d newPoint = this.Surface.Points.GetControlPoint(srfvar.u, srfvar.v).Location;
            // we need to grab the originalPoint because coordinate updates have to be applied with respect
            // to the original config (otherwise, the bounds are updated at every iteration and the alg. blows up)
            Point3d originalPoint = this.OriginalSurface.Points.GetControlPoint(srfvar.u, srfvar.v).Location;

            // update newPoint with respect to originalPoint
            switch (srfvar.Dir)
            {
            case (int)Direction.X:
                newPoint.X = originalPoint.X + srfvar.CurrentValue;
                break;

            case (int)Direction.Y:
                newPoint.Y = originalPoint.Y + srfvar.CurrentValue;
                break;

            case (int)Direction.Z:
                newPoint.Z = originalPoint.Z + srfvar.CurrentValue;
                break;
            }

            this.Surface.Points.SetControlPoint(srfvar.u, srfvar.v, newPoint);
        }
Ejemplo n.º 3
0
        public void VarUpdate(GeoVariable geovar)
        {
            CurveVariable crvvar        = (CurveVariable)geovar;
            Point3d       newpoint      = Points[crvvar.u];
            Point3d       originalPoint = OriginalPoints[crvvar.u];

            switch (crvvar.Dir)
            {
            case (int)Direction.X:
                newpoint.X = originalPoint.X + crvvar.CurrentValue;
                break;

            case (int)Direction.Y:
                newpoint.Y = originalPoint.Y + crvvar.CurrentValue;
                break;

            case (int)Direction.Z:
                newpoint.Z = originalPoint.Z + crvvar.CurrentValue;
                break;
            }

            Points[crvvar.u] = newpoint;
        }