Range Mapping:
The 1hew_RangeMapping node is designed to transform a value within the normalized range of 0 to 1 into a specified range defined by minimum and maximum values. This node is particularly useful when you need to scale a normalized input to a different range, which is a common requirement in various computational and artistic applications. By allowing you to specify the precision of the output through rounding, it provides flexibility in how the mapped value is represented, ensuring that the output can be tailored to the specific needs of your project. This capability is essential for tasks that require precise control over value scaling, such as adjusting parameters in generative art or fine-tuning inputs for machine learning models.
Range Mapping Input Parameters:
value
The value parameter represents the input value that you wish to map from the normalized range of 0 to 1 to a new range defined by the min and max parameters. It accepts a floating-point number with a default value of 1.0, and it can be adjusted in increments of 0.001. The minimum and maximum allowable values for this parameter are 0.0 and 1.0, respectively. This parameter is crucial as it determines the initial position within the normalized range that will be transformed.
min
The min parameter defines the lower bound of the target range to which the value will be mapped. It accepts a floating-point number with a default value of 0.0. The parameter can be set to any value within the range of -0xFFFFFFFFFFFFFFFF to 0xFFFFFFFFFFFFFFFF, allowing for a wide range of possible mappings. This parameter is essential for setting the starting point of the new range, influencing the final mapped output.
max
The max parameter specifies the upper bound of the target range for the mapping process. Like the min parameter, it accepts a floating-point number and has a default value of 1.0. It shares the same range of possible values as the min parameter, from -0xFFFFFFFFFFFFFFFF to 0xFFFFFFFFFFFFFFFF. This parameter is critical for defining the endpoint of the new range, affecting the scaling of the input value.
rounding
The rounding parameter determines the number of decimal places to which the mapped value will be rounded. It accepts an integer with a default value of 3, and it can be adjusted between 0 and 10. This parameter is important for controlling the precision of the output, allowing you to tailor the level of detail in the mapped value to suit your specific requirements.
Range Mapping Output Parameters:
actual_value
The actual_value output represents the result of mapping the input value from the normalized range to the specified range defined by min and max. This output is a floating-point number that reflects the scaled position of the input within the new range. The precision of this value is determined by the rounding parameter, ensuring that the output meets the desired level of accuracy for your application.
int_value
The int_value output provides an integer representation of the actual_value. This output is particularly useful when an integer value is required for further processing or when working with systems that do not support floating-point numbers. It ensures that the mapped value can be easily integrated into a variety of workflows that require integer inputs.
Range Mapping Usage Tips:
- To achieve precise control over the mapped output, adjust the
roundingparameter to match the level of detail required for your project. A higher rounding value will provide more decimal places, while a lower value will result in a more rounded output. - When mapping values for visual applications, consider the impact of the
minandmaxparameters on the overall appearance of the output. Experiment with different ranges to achieve the desired visual effect.
Range Mapping Common Errors and Solutions:
ValueError: Input value out of range
- Explanation: This error occurs when the
valueparameter is set outside the allowable range of 0.0 to 1.0. - Solution: Ensure that the
valueparameter is within the specified range by adjusting it to a value between 0.0 and 1.0.
OverflowError: Min or Max value too large
- Explanation: This error is triggered when the
minormaxparameters are set to values that exceed the allowable range. - Solution: Verify that the
minandmaxparameters are within the range of -0xFFFFFFFFFFFFFFFF to 0xFFFFFFFFFFFFFFFF and adjust them accordingly.
