Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public override float Evaluate(Vector3 point)
        {
            // impl ref
            // http://iquilezles.org/www/articles/distfunctions/distfunctions.htm

            point = _toLocal.MultiplyPoint3x4(point);

            switch (_type)
            {
            case ImplicitSurfaceType.Diamond:
                return((float)ImplicitSurfaces.Diamond(point));

            case ImplicitSurfaceType.Gyroid:
                return((float)ImplicitSurfaces.Gyroid(point));

            case ImplicitSurfaceType.HybridPW:
                return((float)ImplicitSurfaces.HybridPW(point));

            case ImplicitSurfaceType.IWP:
                return((float)ImplicitSurfaces.IWP(point));

            case ImplicitSurfaceType.Neovius:
                return((float)ImplicitSurfaces.Neovius(point));
            }

            throw new System.NotImplementedException();
        }
Пример #2
0
    /// <summary>
    ///
    /// </summary>
    public bool Filter(Vector3 vector)
    {
        const float f = 2.0f * Mathf.PI;

        vector.x *= f / CountX;
        vector.y *= f / CountY;
        vector.z *= f / CountZ;

        //return ImplicitSurfaces.Gyroid(vector) > 0.5;
        return(ImplicitSurfaces.Diamond(vector) > 0.3);
    }