HoloField - Boundary-to-Volume Generator
    Preparing search index...

    Function RadialDecoder

    • Constructs a continuous 3D scalar field by projecting a spherical BoundaryField surface outward from a central point in 3D space.

      The boundary values are projected into an inner volume, or onto a flat surface depending on the sampled geometry, providing a simple model for transforming 2D boundary data into 3D space.

      Parameters

      Returns {
          metadata: {
              boundary: {
                  description: string;
                  displayName: string;
                  mathFunction: string;
              };
              decoder: { description: string; displayName: string };
          };
          length(position: Vector3): number;
          mapBoundaryValue(value: number): number;
          normalize(position: Vector3, radius: number): Vector3;
          sample(position: Vector3): number;
      }

      • metadata: {
            boundary: {
                description: string;
                displayName: string;
                mathFunction: string;
            };
            decoder: { description: string; displayName: string };
        }
      • length: function
        • Calculates the Euclidean distance from the origin.

          Parameters

          Returns number

      • mapBoundaryValue: function
        • Maps a normalized boundary value to a radius.

          The decoder is responsible for evaluating the scalar field. This method defines how boundary values are interpreted as geometric distances from the origin.

          Parameters

          • value: number

            Boundary value in the range [0,1].

          Returns number

          Radius in world units.

          This mapping is not part of the core decoding algorithm. It's part of the interpretation of the boundary field.

          Current implementation is:

          • linear mapping

          Later other approaches could be implemented:

          • exponential mapping
          • logarithmic mapping
          • signed displacement
          • arbitrary transfer function

          The radial decoder itself doesn't care — it just needs to determine "what radius corresponds to this boundary value?" Separating that concern will make the function easier to extend without modifying the core decoding logic.

      • normalize: function
        • Convert a position into a unit direction vector.

          Parameters

          Returns Vector3

          If the position is the origin, an arbitrary direction is returned to avoid division by zero.

      • sample: function
        • Evaluates the signed scalar field.

          Parameters

          Returns number

          A signed value where

          • Positive values indicate positions inside the generated object.
          • Negative values indicate positions outside the generated object.
          • Zero represents the implicit surface.
    Index
    metadata: DecoderMetadata