Hey All.
Strange one here because of the convulted way im going about getting to teh curves I guess,
We have an application to take text from a user, to a nominal size and font etc… for laser cutting.
-SO-
as we have no ability to apply kerning in rhino (that i am aware of) i need to accept the text, iterate through it on a per character basis then move each CHAR (or its curve representation) until its touching just touching its neighbour (with an insert tolerance) something like pictured except ONE item not 6 from the GH definition.
This all sounds complicated but essentially i need to get this as i have it in inkscape where you can see the two overlaps required. I do understand ill have to sacrifice things like the dorts on the i’s. (or in a later version, shuffle the dot down)
I assume an array of sorts after I get to the curves, but its the shuffling left bit im stuck at… I even tried a kangaroo def to try “shift” these in grasshopper but its clear a code solution is required.
Code i have so far (noting im jumping to boundary surfaces otherwise curve union throws away the holes in A and O etc. using the surfaces coverted to meshes once the overlap, i can meshoutline to get a proper set of curves back )
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
string name = “”;
Result rc = RhinoGet.GetString(“text…”, true, ref name);
if (rc != Result.Success)return rc;Point3d pt0; using (GetPoint getPointAction = new GetPoint()) { getPointAction.SetCommandPrompt("Please select the text insertion point"); if (getPointAction.Get() != GetResult.Point) { RhinoApp.WriteLine("No start point was selected."); return getPointAction.CommandResult(); } pt0 = getPointAction.Point(); } List<Brep> FontSurfaces = new List<Brep>(); foreach(char c in name.ToCharArray()) { //start with a character. var te = RhinoDoc.ActiveDoc.Objects.AddText(c.ToString(), new Plane(pt0,Vector3d.ZAxis), 20, "Segoe script", true, true); Rhino.DocObjects.TextObject txt = RhinoDoc.ActiveDoc.Objects.Find(te) as Rhino.DocObjects.TextObject; if (txt != null) { var tt = txt.Geometry as TextEntity; var A = tt.Explode(); var brep = Brep.CreateEdgeSurface(A); if(brep != null) { FontSurfaces.Add(brep); } } } foreach (var character in FontSurfaces) { } doc.Views.Redraw(); // --- return Result.Success; } }