#openscad

/

      • kintel
        if (idx == len(matrices) - 1) children();
      • else multmatrix(matrices[0]) ApplyMatrices(matrices, idx+1);
      • }
      • See also here for inspiration for other ways of achieving your goals: https://github.com/openscad/list-comprehension-...
      • glafond
        Thanks a lot Kintel
      • ERROR: Recursion detected calling function 'len'
      • I will figure it out :)
      • saint_ has quit
      • InPhase
        glafond: Bug fix: multmatrix(matrices[idx])
      • glafond
        Children needs to be carried over: ApplyMatrices(matrices, idx+1) children();
      • InPhase
      • I did many recursive functions in openscad, but hadn't thought to try a recursive module until your question.
      • glafond
        It's not working, but I have a good background in programming. I'm pretty sure I will figure it out :)
      • gunnbr joined the channel
      • Got it :)
      • menip has quit
      • Transformations are applied in order. Fantastic!
      • Github-openscad
        [openscad] kintel pushed 1 new commit to cmake-build: https://github.com/openscad/openscad/commit/749...
      • openscad/cmake-build 749c70b Marius Kintel: Pass current date as version when building, change version messages STATUS messages
      • abernstein joined the channel
      • glafond
        Kintel, are you always pushing commits that fast? I didn't know OpenSCAD was changing that quickly!
      • abernstein has quit
      • kintel
        glafond: it’s a feature branch - just playing around with some build system stuff.
      • glafond
        Ok :)
      • menip joined the channel
      • kintel has quit
      • menip has quit
      • KimK has quit
      • KimK joined the channel
      • jfcaron has quit
      • gunnbr has quit
      • Doginal has quit
      • Is there a way to get the height of a shape?
      • peeps[lappy] joined the channel
      • teepee_ joined the channel
      • teepee has quit
      • teepee_ is now known as teepee
      • I feel like I'm hitting OpenSCAD limitations. I'm trying to create a shape from a polygon (that I get using children) and a copy of that polygon (using translate / rotate operations)
      • I can't find a way to iterate through the polygon points, so I can't create my shape manually using polyhedron
      • hull() doesn't work with 2D polygon in a 3D space
      • The only solution I have found so far is to linear_extrude the polygon with a very small height (let say 0.00001) then hull the 2 very thin 3D shape. That works but I feel like there is an easier way to achieve this
      • peeps[lappy] has quit
      • Example
      • module twist_extrude_polygon() {
      • hull() {
      • rotate([90, 0, 0])
      • linear_extrude(height=0.00001)
      • children();
      • rotate([90, -10, 45])
      • linear_extrude(height=0.00001)
      • children();
      • }
      • }
      • twist_extrude_polygon() {
      • polygon([
      • [1,-1.5], [3,-0.5],
      • [3, 0.5], [1, 1.5]
      • ]);
      • }
      • teepee has quit
      • teepee joined the channel
      • mhroncok joined the channel
      • peeps[lappy] joined the channel
      • peeps[lappy] has quit
      • peeps[lappy] joined the channel
      • peeps[lappy] has quit
      • peeps[lappy] joined the channel
      • nge joined the channel
      • teepee] joined the channel
      • mar77i_ joined the channel
      • mar77i has quit
      • saurabh joined the channel
      • mar77i_ has quit
      • mar77i joined the channel
      • snaked has quit
      • InPhase
        glafond: I was recently struggling with a problem of trying to do something similar, and it got a lot cleaner when I switched away from operating on polygons and instead started using list comprehension to generate arrays of arrays of points, where each inner array defines one loop that outlines a polyhedron.
      • glafond: I was just talking about it in here the other day, but I think it was before you joined. To see how I approached it, grab threads_v2.scad and scroll to line 182 with the module ClosePoints. The comments describe it in more detail: http://www.thingiverse.com/thing:1686322/#files
      • othx
        http://www.thingiverse.com/thing:1686322 => Screw Threads, Holes, Bolts, Nuts, and Rods Library by rcolyer => 2 IRC mentions
      • InPhase
        glafond: When you operate on the raw points, you have cleaner control over the mathematics.
      • glafond
        Yes, that's what I was trying to do, but I can't get the points of a polygon. I want to keep the same syntax as linear_extrude and rotate_extrude
      • so basically the polygon has to come from the children
      • If I change the API to get a list of points, I drop quite a lot of flexibility. The user can't use difference, union, etc to create its polygon
      • The "hull" function give me what I want, but it doesn't work well with 2D polygons. I managed to do it by creating extruding my polygons to create very thin shape
      • But when the shapes are too thin, it cause problem (non-manifold) when I try to assemble them with union. It seems to work great when the polygons are extruded with a small value, but not too small so it doesn't get stripped out by the mantissa rounding. Shapes overlap a little, union works better... Well that's my interpretation of what is happening :)
      • Thanks for that link btw, I like to see how others has solve the problem
      • Sound joined the channel
      • InPhase
        glafond: Yeah, it was precisely those difficulties with the unions and small offsets causing defects that eventually led me down the point-array approach.
      • glafond: hull is also problematic in that it only works right on convex polygons. Concave ones are made non-concave.
      • abernstein joined the channel
      • jfcaron joined the channel
      • glafond
        Oh that's a very interesting point
      • Yep, concave shapes are made convex... I just want a way to iterate between points of the polygon, I would create my own polyhedron if I could do that... Hull is overkill for what I'm doing
      • abernstein has quit
      • mar77i_ joined the channel
      • mar77i has quit
      • Anyway, I prefer to impact performance in favour of code readability and easy to use. The render operation only needs to be done once anyway...
      • I will come back to this library when OpenSCAD provide a way to iterate through polygon's points
      • jfcaron has quit
      • abernstein joined the channel
      • znge joined the channel
      • glafond has quit
      • nge has quit
      • saurabh has quit
      • jfcaron joined the channel
      • znge has quit
      • menip joined the channel