Hi Eddy
After writing this:
Although I may code the others, at this stage of testing, I think it's pretty good.
It seems I spoke too soon as when I loaded up more fonts to check (I have a huge amount of fonts from my textile machine patterning program) and tried at least 20 or more, I found the methods (the origional code from the script) varied significantly in it's output depending on the font selected.
I then found some more methods in CAD3DUtils:
eg.
CAD3DUtils.GetShapeListSkeleton(MyShapeList, 0.1);
CAD3DUtils.GetPolylineSkeleton(my_polyline, 0.1);
CAD3DUtils.GetRegionSkeleton(My_Region, 0.1);
And if I left out the AcrFit things got a lot better.
ICADView view = CamBamUI.MainUI.ActiveView;
CADFile file = view.CADFile;
MyShapeList.Clear();
MyShapeList.AddSelectedEntities(view);
MyShapeList.CloneEntities = true;
MyShapeList.ApplyTransformations = true;;
string S = MyShapeList.Count.ToString();
label2.Text = "Shapes in MyShapeList_Fill success Count " + S;
MyShapeList.DetectRegions();
MyShapeList = CAD3DUtils.GetShapeListSkeleton(MyShapeList, 0.1);
MyShapeList = MyShapeList.Join(0.01);
//MyShapeList = MyShapeList.ArcFit(0.1);
//call the polyline smooth .dll or make a new module
//something like this
foreach (ShapeListItem sli in MyShapeList)
{
if (sli.Shape is Polyline)
{
my_polyline.CloneFrom(sli.Shape);
CAD3DUtils.GetPolylineSkeleton(my_polyline, 0.1);
MyShapeList2.AddEntity(my_polyline);
}
else {
if (sli.Shape is CamBam.CAD.Region)
{
My_Region.CloneFrom(sli.Shape);
CAD3DUtils.GetRegionSkeleton(My_Region, 0.1);
MyShapeList2.AddEntity(My_Region);
}
}
}
The Chaikin is a more geometric approach and is fast and the catmull/rom is more mathematical, these seem to be the standard fare for doing this
but there are other ways for example you could construct lines perpendicular to the centre line and use least squares regression or root sum squares regression(statistical) methods to pull the outlying points towards the centre line.
the trouble is that the new line may be (although smooth) not very representative of the original intent of the text.
I also noticed that when loading up the solution that you have not set CB as the startup solution, what I do is set CB as the Startup program
and VS studio automatically puts the .dll in the CB plugins directory, which means that I compile the code I'm working on and press start on the debugger and CB is opened in Debug mode. It's not a big thing in the scheme of things but I find it handy in all of my other projects as well as CB plugins.
I only really did this to set up VS Studio 2017, which I like a lot (It's a bit more picky about naming conventions) and a few other things and before an update managed to 'Do a Dynamo' and make it completely Disappear leaving me looking like a stunned mullet for a while.
For some time now I've become interested in AI and ML for my turrets (Auto touch off, tool wear compensation) among other things so plugins have been put to the sidelines for now, If you are keen to do more with this plugin, I'll point you to the sites I looked at UCBerkley and Code Project
as I have too many projects and too little time right now.
Dave