[OpenSCAD] Functional OpenSCAD, working with vertex data

Hugo Jackson hugo at apres.net
Thu Jan 25 19:19:21 EST 2018


Wow… I agree… I love the dot notation and had no idea it existed… I think it really helps with readability of code.
I also agree the swizzling would be great.

> On Jan 25, 2018, at 3:49 PM, Hans L <thehans at gmail.com> wrote:
> 
> 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
>> 
> 
> _______________________________________________
> 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