Thursday, November 29, 2012

Cut and translate fixes

One of the issues that caused the Cut tool to fail was that the shapes it was meant to cut through weren't selected properly. Today I improved the code that selects these shapes (you can find the changes here). There are several cases when the list is refreshed, the main ones being:
1. First cut: for example, when performing a cut on a solid obtained after an Extrude. In this case, we need to check all the solid shapes in the document and try to perform the cut on them.
2. Second cut on the same solid: for this case, we need to perform the cut on the result of the previous cuts. Otherwise, the previous cut results would be displayed and some of the cut outs would be filled in. To do this, we analyze all the Cut nodes and exclude the nodes in their reference list from the final shape list
3. Updating an existing cut: for example, when performing translate on a solid resulted after one or more cut operations. In this case, the reference list is already filled in from the previous/first cut operation and we use that list.

An example that covers these cases is:



I'm working on testing and fixing bugs for cutting and translating shapes resulted from different operations. Here is an overview of the test cases I've worked on so far and the bugs that aren't yet fixed:

1a. Extrude sketch; cut through all with second sketch; translate (example 1, example 2)
1b. Extrude sketch; cut to depth with second sketch; translate (example)
2a. Extrude sketch; cut through all with second sketch; edit second sketch; translate
2b. Extrude sketch; cut to depth with second sketch; edit second sketch (example); translate
3a. Extrude sketch; cut through all with second sketch; edit base sketch; translate
3b. Extrude sketch; cut to depth with second sketch; edit base sketch; translate
4a. Extrude sketch; cut through all with second sketch; delete shape from second sketch; translate (example)
4b. Extrude sketch; cut to depth with second sketch; delete shape from second sketch; translate
5. Extrude sketch; cut to depth with second sketch; cut through all on result of first cut; cut to depth on result of second cut; translate (example)
6a. Extrude 2 sketches; apply boolean operation; cut through all on result (example); translate (BUG)
6b. Extrude 2 sketches; apply boolean operation; cut to depth on result; translate (BUG)
7. Extrude two sketches; cut through all so that both solids are affected (the result is one shape) ; translate (BUG)

There are also several bugs in the display and selection of items in the Document Tree view panel and for save/open and undo/redo for solids affected by cut.

No comments: