Orienting and arraying a Brep on the middle of a surface

I would like to Orient and array a specific Brep on the middle of a surface without re-orienting the Brep with MD Slider.

Are you able to grab the midpoint without the MD slider? As in getting the area centroid or the polygon center? If yes, then find the closest point on the surface from that point via Srf CP and use the uvP output as your surface coordinate to determine your target plane with EvalSrf:
image
You can also use Brep CP to make this target plane with:
image

Still, probably better to post your code or share screenshots for more adequate assistance.

Best,
RC



This is my script so far; I can move them to the middle but I have to adjust it manually with slider or md slider. I am trying to orient them in the middle automatically, not on the edge like this. I tried to generate an offset curve to the middle, then oriented the shapes on this curve, it worked but did not apply perfectly with the other shapes.

1 Like

Thanks for sharing and explaining - not quite sure I follow (apologies, I’m sure it’s my fault :slight_smile: ) - maybe share a sketch of what things should look like?

What is the ‘middle’ you’re referring to? The planar face of the surface? Should the breps you’re orienting be flushed with the surface or stick out perpendicularly?


No worries, it is my fault I was not clear enough. These oriented and arrayed geometries should be placed in the middle of the face not placed on the edge like that.

Post.your.code.

1 Like

:roll_eyes:

I can’t open an image in Grasshopper to edit. Post your actual .GH file.

1 Like

Help Us Help You - Grasshopper - McNeel Forum

Orient x joint.gh (225.8 KB)
Sorry I did not get that you mean the gh file.

1 Like

I’ve accomplished it. Now, I have only one problem, through this script I can set the number of those joints, but I always get two joints at the bottom that I don’t need.
Also, is it possible to have a fixed distance between them or at least get a real number of the distance between them.


Orient x joint.gh (27.0 KB)

1 Like

I was about to help before your latest response but I don’t have pufferfish, so script didn’t load correctly :slight_smile:

Something you could do, prior to finding the planes for orienting the breps, is take away start and end points. Use the Cull Index component and tell it to remove items 0 and -1.

The cull index did not work with me especially whenever I changed the number of joints. So, I used the point in curve, subtracted one from the relationship, and then connected the results to the cull pattern.

cool - again, because your objects aren’t internalized past the pufferfish stuff, I no longer tried opening your file, so my ‘cull index’ suggestion came from assumption(s) on how you were generating your points on that surface; that is, assuming they had a straightforward order (left to right, right to left), where taking away the start and end points (0 and -1) should suffice - my bad, sorry for confusions. Nonetheless, I am sure they still have an order…or, can be ordered, so that you can easily remove those points on the extremities.

Cheers.

1 Like