I have an airfoil shape I need to scale to dozens of different sized boxes. The boxes are rotated at various random angles. I need to scale each so that the airfoil shape fills the box and is tangent to all 4 sides. Here is links to before and after image and example Rhino file. I’m still using Rhino v4.
I think… use two sides of each box to set a plane and then BoundingBox the foil curve based on the plane…? Will that do it? Should be scriptable, I’ll have a try.
@The10thMan, is the red box in the attached file what you want?
Just in case that is correct, here is a script that should work to automate this- To use the script, extract and save the .rvb file from the attached zip archive, then drag and drop the saved rvb over an open Rhino v5 window. This will load the script, set it up to load on startup in the future and register the alias
FrameAirfoils
that will run the script much like a regular command. An alias can be typed or added to a toolbar button or keyboard shortcut (F-key).
The script FrameAirfoils asks to select boxes. I select A box and hit enter. I get the following error. I get same error when selecting multiple boxes.
Got it- that is also possible, I think.
OK, @The10thMan, see how this works- replace the earlier script with this one, and restart rhino or drag and drop again.
doesn’t work right. shape isn’t tangent to any of the boxes lines. on some box sizes the airfoil rotates to fit the box. That is unwanted. MUST scale straight in X and in Y.
Ah, well, I fixed getting the tangency right, that was just dumb scripting, but that is an extra hoop to jump through - I’ll see if I have time to figure something out.
I do not see an exact solution, myself. It would be a matter of jiggling the thing into place with multiple iterations (somehow) and getting it to be ‘good enough’.