[OpenSCAD] Functional OpenSCAD, working with vertex data

Hans L thehans at gmail.com
Sun Jan 28 15:10:49 EST 2018


The resurrection of this thread has spurred me to make some updates to
the library over the past few days.

https://github.com/thehans/FunctionalOpenSCAD

- I've created an overall README.md for the project and tried to
document everything a bit better.
- A signed_volume function has been added, thanks to NateTG.
- Added new planes.scad file for creating planes from points,
visualization, etc.
- Plus a handful of other minor additions and changes.

I hope the new documentation makes it all easier to understand.  Let
me know if anything in particular is unclear.

The splitPolygonByPlane function in planes.scad is my attempt to port
this function from OpenJSCAD/csg.js   My implementation doesn't work
100% and I guess that's where I stalled on further implementing
boolean ops, etc.  I haven't touched that code in months and forgot a
lot of what I was doing.  I'm not particularly motivated to pick that
code back up at the moment, but I fiured it was still worthwhile to
show what progress I had made.


Do you have ideas for any other features you would like to see added?
(aside from the currently unsupported OpenSCAD builtins)

Lastly I'm curious anyone has found FunctionalOpenSCAD useful in their
own projects so far?

Thanks
-Hans

On Thu, Jan 25, 2018 at 6:19 PM, Hugo Jackson <hugo at apres.net> wrote:
> 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
>
>
> _______________________________________________
> 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