[OpenSCAD] Functional OpenSCAD, working with vertex data

Hans L thehans at gmail.com
Thu Jan 25 18:49:11 EST 2018

I like the .x .y .z shortcuts and I think they are somewhat useful
feature, but I actually feel that it doesn't go far enough!  I think
support for swizzling, much like GLSL would be a really handy
addition.  https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling

So you could do something like this for example:
p3d = [1,2,3];
p2d = p3d.xy; // alternative to: [ p3d[0], p3d[1] ]   more clean and
concise with swizzling

And all the other combinations and transposing of axes could also be possible.

On Thu, Jan 25, 2018 at 3:28 PM, Marius Kintel <marius at kintel.net> wrote:
> The dot notation shortcut isn't really documented, except through source
> code:
> https://github.com/openscad/openscad/blob/master/src/expr.cc#L393
> Not sure it's worth using as it may make code less readable for people not
> used to this syntax.
> We should design such features in a better way.
>  -Marius
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

More information about the Discuss mailing list