funcutils icon indicating copy to clipboard operation
funcutils copied to clipboard

Add parse_array()

Open nomike opened this issue 1 year ago • 0 comments

I've added a fuction parse_array, which can parse arbitrary multidimensional float/int arrays from strings.

I've also added a few test cases and an entry to the readme.

The use case of this function is to allow complex lists to be customized. The customizer only supports one dimensional lists of up to 4 elements. But with this function, the parameter could just be a string.

One remark about the test cases:

I've commented out one test case with exceptionally large numbers. Even though it seems to produce the correct result, the assert of the test fails.

I assume this is due to some internal floating point representation within OpenSCAD or something.

It might require a bit of trouble shooting or it can simply be ignores as it's anyway quite unlikely to ever encounter such a list in a real world example.

nomike avatar Nov 29 '24 03:11 nomike