BoundSpec Declarations

Frederick_Wright
Frederick_Wright Member Posts: 3 ✭
I was looking at the Featurescript for the Hex Infill feature, am puzzles by several aspects of the following:
<div>// integer from 1 to 100, default 10 (used for %Infill)</div><div>export const INFILL_BOUNDS =</div><div>{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min" &nbsp; &nbsp; &nbsp; &nbsp;: 1,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max" &nbsp; &nbsp; &nbsp; &nbsp;: 100,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (unitless) &nbsp; : [1, 10, 100]</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } as IntegerBoundSpec;</div><div><br></div><div>// parameter values (real numbers) in various document unit systems with defaults</div><div>export const HEX_BOUNDS =</div><div>{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "min" &nbsp; &nbsp; &nbsp; &nbsp;: 1 * millimeter,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "max" &nbsp; &nbsp; &nbsp; &nbsp;: 100 * millimeter,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (meter) &nbsp; &nbsp; &nbsp;: [0.0, 0.025, 500],</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (centimeter) : 0.5,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (millimeter) : [1, 5, 100],</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (inch) &nbsp; &nbsp; &nbsp; : .25,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (foot) &nbsp; &nbsp; &nbsp; : 0.015,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (yard) &nbsp; &nbsp; &nbsp; : 0.005</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } as LengthBoundSpec;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>//----------------- &nbsp; &nbsp; </div>
Does the line  "(unitless) : [1, 10, 100]" redundantly define the min/max, given that they're explicitly given on the two lines above?

Somewhat similarly, for the HEX_BOUNDS, the line "(meter) : [0.0, 0.025, 500]" seems to contradict the min/max given on the two preceeding lines. Is one range ignored in favor of the other? Does it depend on the document units?

Thanks for any clarification.

Best Answer

Answers

  • Frederick_Wright
    Frederick_Wright Member Posts: 3 ✭
    Thank you, Kevin, for the swift and thorough answer. Much appreciated.