Monday, September 6, 2010

Better AutoFace Performance and Code Cleanup

There are some components in code that would like some improvements.

We use backtracking to do autoface. AutoFace is a feature of NaroCAD that when you draw lines, and you make a continuous shape, it will create a face automatically from it. This can be expensive operation as NaroCAD searched naively if shapes two by two are chained and there was a lot of back and forth bookkeeping. This part was not changed, because is needed to explore (allmost) all possible ways to combine.

The part was really improved was how candidates are searched: before backtracking was done the candidates combinations are precomputed. This improves greatly the solution searching space and in the gear shape creation the Auto-shape code from a 200 teethes gear will go down from 97 to 3 seconds. You will most likely not notice that great improvements, but if you will have more lines/splines/arcs in your scene, you will not get "delays" as you move mouse around because the Auto-Face code is trying to preview to you if you have combined a face there or not.

The (meta)actions with hidden side effects were fixed and they use corresponding code components.

No comments: