I’ve recently switched to Rhino from Sketchup and I need to create evenly spaced dovetail pins and tails. I’ve marked out the closed curves for the tails and thought that by running ArrayCrv along a curve I’d get 10 evenly spaced closed curves. I do, but 10th curve (shape of my dovetail tail) is placed at the end of the curve and runs off the end. Is there any way to have the arrayed objects constrained within the curve? Or is there another way to achieve this?
Can you post a bit more info on how to achieve this? I understand how to make a sub curve, but not how it applies to an array that requires precise spacing between objects and within the curve.
I’ve also run into an issue with my templates. When I use the small objects mm template I end up with objects that look massive. I thought that it might just be the grid, but when I import it into Keyshot for render I end up with a tiled rendering. I don’t have the same problem with small objects inches template. I have the same problem with large objects mm — I just get a larger grid.
I’ve attached a basic example of a box measuring 200x200x12.
The desired result is on a green layer, the actual array on curve result in the blue layer.
I ended up with the desired result by manually calculating the width of the tails and the gaps between them and used the ‘distance between items’ option. I then deleted the extra tail that I didn’t need.
maybe you could make a request to add the following functionality to ArrayLinear ? and other applicable array commands? i suppose it would work with ArrayCrv also… it mostly already works with ArrayPolar.
import rhinoscriptsyntax as rs
obj = rs.GetObject('Select object to array')
amount = rs.GetInteger('How many objects in array')
point1 = rs.GetPoint('Pick start point')
point2 = rs.GetPoint('Pick end point')
vector = rs.VectorCreate(point2, point1)
copyvec = rs.VectorDivide(vector, amount - 1)
for i in range(1, amount):
copy = rs.CopyObject(obj, copyvec * i)
…except fancier with the preview geometry and whatnot.
or… i assume that’s what jeremy is expecting since he’s coming from a sketchup background which allows you to make an array based off the space between obj1 and obj2 like ArrayLinear does… or you can pick the overall distance and have the desired amount of objects fill in the space… it’s pretty useful.
If a feature like this could be added to Rhino that would be great. This is a good summary of how it works in Sketchup which is super useful for laying out woodworking joints: https://www.youtube.com/watch?v=Sk_g2JqNrBk
On my other question —any idea why my mm templates make the objects appear so large and affect my renders?
• Navigate to ~/ Libray/ Application Support/ McNeel/ Rhinoceros/ Scripts (*note. this is your User library… not the MacHD library)
• Place the file ArrayBetween.py in the Scripts folder.
• in rhino, use the command RunPythonScript
• that command will open your scripts folder then choose the ArrayBetween script… press the open button.
in the case of the dovetails, the initial setup would look something like:
start the script, select the object, enter the number of items, click on the first point (point to copy from)… click the second point (point to copy to)… the result will be:
*note… if you can’t find your user library… post back here and i’ll tell you how to find it.
it’s a little different than sketchup in that the number you enter is the total number of objects in the array – including the original one. (ie- the example image above, i entered 6 for the amount)
i never really liked how sketchup makes you enter the number of copies… (the above in sketchup would require you to enter 5)… it’s confusing imo… but if you want to make the script act like sketchup in this regard, that’s possible.
Just for the sake of completeness, the Copy command has several options, after the first copy is made, that if invoked (all of them) allows a kind of regular array to be made. (FromLastPoint, UseLastDistance, UseLastDirection)
[quote=“pascal, post:19, topic:18486, full:true”]
Just for the sake of completeness, the Copy command has several options, after the first copy is made, that if invoked (all of them) allows a kind of regular array to be made. (FromLastPoint, UseLastDistance, UseLastDirection)[/quote]
a lot of times, yes, Copy is the way to go… Divide and Copy
no ‘s’ but that thing is sweet… never used it before but often do similar manually. thnks