I have a set of lines that are parallel to each other with different dimensions. I want the shorter lines to draw a perpendicular to the nearest longer line from their end points and close the curve to form a rectangle. The first picture shows the current situation. The second picture shows what it should be like.
Your help will be much appreciated. Thank you so much
Wow, That’s very cool. It is awesome when you want to control the location of boxes using domain. In my case, we have to make a box by extending two perpendicular lines from the both ends of the small lines (and then it touches the longer line and stops to close the curve). I hope I explained it better this time. I am attaching the file here too (in previous file there was only one small line). Thank you so much for your help.
Hi, I have another small query. I have a square (let’s say 2200 mm length and width each) and I want to extend it in x and z-direction to make it 2300 mm each by adding 50 mm on both sides considering the centroid of the square. I was trying to use Scale NU but it considers the current size of the rectangle as 1 and I am confused with that. Or I just add 1.050 on x and z vectors for it and it will be correct
Could you please help me with it too. Thanks a lot Scaling.gh (9.8 KB)
That’s a very good approach. Let’s say I do not know if the rectangle or square is 2200 m long. I get this rectangles as an output and I have different sizes of rectangles so I cannot deconstruct the rectangles and use their dimensions. Is there any other way I can add 50 mm to a rectangle without considering its original dimensions? For example by deconstructing the rectangle into individual curves and then extending the curves on both sides by 50 mm and then connecting them again to form the rectangle. Is it possible? I am trying to do it but unable to.
Thank you so much!!
It works however, I have a large number of rectangles and I am not sure if it is time-efficient for that. I could sense that it could be done using List (sort) nodes, I have been struggling to find the combination for it. I have already asked you enough questions and taken enough of your time but it would be a hugeeee favour if you could help me in this last question. I am attaching the purged GH file with internalised data where we have rectangles (windows) and I want to increase these rectangles’ width by 50 mm on both sides and then form a new rectangle. Is this doable? I feel embarrassed too for keeping on asking questions. You can answer if you have some idle time.
Hello again, the script you developed is correctly working on the XZ plane with 50 mm extension but on the YZ plane, it is not exactly 50 mm, it is 64.33 mm. Could you please look into that? I feel it is due to the Dot product of Z but I am not sure. I am trying alternatives which are only making it worse
Not really. It’s due to the initial rectangles not being cleanly constructed. Some thus have different plane orientations, which causes the deconstruction to provide y-values that in other planes are x-values and vis versa.