Hi Michael,
thanks so much for helping me out!
In a broader context: I want to build an algorithm to create 2D parametric geometry for paper or cardboard, for example a parametric paper envelope.So only 2D curves.
All geometry is created within the script, so no referencing to existing geometry. The variables width, length, fold,…define the final shape, with a distinction between cutting lines (black) and folding lines (red).
I have already built a GH def to do this (example above: the preview and baked geometry), but there are quite a few complexities in the geometry (paper thickness, folding angles,…) and I end up with a fairly big definition which is not very robust: for example: explode → select item components lead to trouble because the order of the segments (list) changes when the ratio between width and length change significantly.
Others advised in another post that parametric CAD would be better suited for this kind of geometry, but I wanted to stick with Rhino for the moment. I could rebuild the definition using another approach, but wanted to try to code it, as it seemed faster to me: draw curves based on coordinates calculated with variables, and mirror the curves given the final geometry is symmetric. The script I posted earlier is the beginning of that: define the red lines parametrically, and then mirror these. Same with the black lines in a second routine. BUT, then I encountered the issue with mirroring.
What i basically want to end up with is a simple GHPython component that has two outputs: ‘red’ and ‘black’ with the respective lines as curves. But somehow the append causes trouble:
Mo = rs.MirrorObjects(line_list, [H / 2, 0, 0], [H / 2, 1, 0], True)
Mo.append(line_list)
It is probably something really simple, but I could not find a solution online.
Thanks again!