Placing Pieces to the right location

placing pieces to right locations.gh (31.8 KB)

Hi everyone! I’m stuck on something and wanted to ask for help. I created this Grasshopper file to basically explain what I’m trying to do. There are, let’s say, three pieces, which should move to their correct positions when the slider changes (they represent interior walls). The rectangular piece should always be centered between the endpoint and intersection point. When the perpendicular wall reaches a certain position on the line, the yellow piece should appear, and the corner pieces should be the green one. The lines can also be in the -Y or -X directions, so the pieces should rotate and mirror automatically if necessary. Although I haven’t included it, there are also multiple lines in the Z direction as well.

I tried using the Horizontal Frame component, and although it rotated the pieces correctly, it only applied the transformation to one piece. So I basically need to select the endpoints, intersection points, and corner points separately, but I couldn’t manage to do it.

Would love to have a look, please upload a file not using plugins.

regards, Eef

Thank you! I don’t know how to upload it without the plugins but I haven’t used any plugin for this definition. Can you just ignore the plugin messages?

then it looks like this:

Without plugins.(Pufferfish)

placing pieces to right locations a.gh (30.0 KB)

Thank you for this! I had no idea how to do that. I’m not an expert on Grasshopper yet! :slight_smile:

Hi, did you able to do this by any chance?

I wonder , why don’t you just use Offset Curve ? You can change your number parameters and you will have the same result …


placing pieces to right locations a (1).gh (24.3 KB)

Thank you for this. The pieces are actually assembly components that need to be placed in specific locations, as I mentioned earlier. It’s not about designing the wall itself, but rather about positioning these components within the wall, since they serve as the structural elements of the wall. I hope that make sense

I am a bit busy with other projects. But let me explain my approach. And I will try do a short gh to show the idea:

  • The input in your question can be simplified to two lists : 1. lines. and 2 points on that line.
  • it is simple to orient the objects you have to all this points.
  • the (for me) tricky part is: how to know what type of object and what orientation.
    I tried several approaches, with curve closest point, but then it is hard to keep track of what lines are connected to a point (one would want a component: point closest curve)

But think I found a good one:

  • create a circle (or sphere to also work in 3D) around all points.
  • use the brep | curve component to find the points where the lines intesect with the circle (sphere).
  • then you have:
  • the point
  • 1, 2, 3 (or even 4 could happen) intersecting points.
    Use 2point vector to create 1 , 2 , 3 vectors.
    use crossproduct to see if these vectors are in 90 or in 180 degrees.
    depending on results:
    Only 1 vector. = type Blue
    Two vectors 180 degrees = type Blue
    Two vectors 90 degrees = type green
    Three vecort = type Yellow
    And Orient to that point .

If I find more time I will make a working example. Regards, Eef

OK, here you go. I made an example for the brep on the T’s
I know the handling of the trees/lists could surely be improved.

In the white boxes, I explain how it works. Have fun, Eef
NB: First I did was put all your lines + points in two lists


NB: To see how the intersecting with the spheres function, increase the diameter a bit and zoom in.


placing pieces to right locations a_EW.gh (47.8 KB)

Thank you so much for this! It looks perfect! but I need to study it and understand what actually is going on :grin:

can I suggest…

sortBricks_jvs06.gh (31.6 KB)

wow. yes this looks amazing. I will also study this. Thank you so much!