I am engraving some text into certain pieces for CNC, or Laser Cutting.
I have the pieces and the text, as curves. What I need to achieve is to fit the text within the piece… Right now its placed based on centroids.
For simplification purposes a bounding rectangle can be used to replace the text curves.
My idea is to maybe search for an optimal position with Galapagos, and eventually if the bounding rectangle of the text is still outside the closed curve, then go progressively scaling the text until it fits. I dont think any kind rotation would be a good idea.
So basically I need to fit the text using Translation and Scaling only.
{if I understood your problem correctly} here’s a cheat that might help in the meantime given the nature of your parts…
NOTE: ran out of time for the third option, plus it might work better using actual searchable characters as opposed to text curves because character ‘E’ (example) becomes split into little lines which then cause duplicate bounding boxes for one ‘character’. Hope it makes sense.
Hey Laurent! Thank you! I actually found that thread and tried to work with the script you provided there, but I couldn’t make it work as I intended.
This look great! Two things though.
Two pieces in the left bottom corner seem to have lost their text.
Could be made so that already fitting text isnt scaled? Maybe if bounding box already fits inside closed curve = true. And perfom a dispatch or cull pattern! Will try myself later.
don’t know what happened to ‘curve array’ component - grabbed another one in Rhino 5 but it doesn’t work for a reason I do not need to know as it does work on R6 it doesn’t matter though as the primary ‘solution’ in that script isn’t that array