Пример #1
0
        public double DistanceFromPoint(Point3d point)
        {
            double d1 = A.DistanceFromPoint(point);
            double d2 = B.DistanceFromPoint(point);
            double h  = Math.Max(Blend - Math.Abs(d1 - d2), 0) / Blend;

            return(Math.Min(d1, d2) - h * h * h * Blend * (1 / 6.0));
        }
Пример #2
0
        public double DistanceFromPoint(Point3d point)
        {
            //Math.IEEERemainder(point.X,RepetitionDistance) - RepetitionDistance/2,
            Double x = RepetitionDistance.X > 0 ? Math.IEEERemainder(point.X, RepetitionDistance.X) : point.X;
            Double y = RepetitionDistance.Y > 0 ? Math.IEEERemainder(point.Y, RepetitionDistance.Y) : point.Y;
            Double z = RepetitionDistance.Z > 0 ? Math.IEEERemainder(point.Z, RepetitionDistance.Z) : point.Z;

            return(Primitive.DistanceFromPoint(new Point3d(x, y, z)));
        }
Пример #3
0
        public double DistanceFromPoint(Point3d point)
        {
            Double x        = Math.Abs(point.X) - Elongation.X;
            Double y        = Math.Abs(point.Y) - Elongation.Y;
            Double z        = Math.Abs(point.Z) - Elongation.Z;
            Double primDist = Primitive.DistanceFromPoint(new Point3d(Math.Max(x, 0), Math.Max(y, 0), Math.Max(z, 0)));

            return(primDist + Math.Min(Math.Max(x, Math.Max(y, z)), 0));
        }
Пример #4
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Math.Min(A.DistanceFromPoint(point), B.DistanceFromPoint(point)));
 }
Пример #5
0
 public double DistanceFromSdfObject(ISdfObject sdfObject)
 {
     return(sdfObject.DistanceFromPoint(this));
 }
Пример #6
0
 //todo: fix!
 //https://en.wikipedia.org/wiki/Rotation_matrix#In_three_dimensions
 public double DistanceFromPoint(Point3d point)
 {
     return(Primitive.DistanceFromPoint(matrix * point));
 }
Пример #7
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Primitive.DistanceFromPoint(point - Translation));
 }
Пример #8
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Math.Max(-point.Y, Primitive.DistanceFromPoint(point)));
 }
Пример #9
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Blend * A.DistanceFromPoint(point) + (1 - Blend) * B.DistanceFromPoint(point));
 }
Пример #10
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Math.Abs(Primitive.DistanceFromPoint(point)) - Thickness);
 }
Пример #11
0
 public double DistanceFromPoint(Point3d point)
 {
     return(Math.Max(-B.DistanceFromPoint(point), A.DistanceFromPoint(point)));
 }