Thursday, November 29, 2012

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.

Tuesday, November 27, 2012

Translating a solid that is resulted from a cut is a bit more complicated than the other solid shapes, because aside from a base sketch it references a list of affected shapes which need to be translated before the base sketch is translated and cut function executed again.

Friday, November 23, 2012

Over the past two days I worked on fixing the translate gizmo for 3D solids resulted from non-circle sketch shapes. There main issues were:
- the way the faces were created, using a check for visibility to determine the correct candidates
- the way the sketch nodes were being updated after the translation
- the extra faces that were created, which slowed down the redrawing of the shapes

Here is a video showing the translate performed on a shape which has lines and a SER arc, the editing of the sketch after the translate and the redrawing of the extruded shape after the sketch was changed:

Currently, the faces on the sketch are processed and fused into one shape, which is added as an interpreter for the sketch node. Whenever a 3D tool is applied, a reference to the sketch containing the selected shape is used, avoiding the reprocessing of the same faces each time. When the sketch is changed, the shape is re-processed and all tools are notified.
The translate tool applies the translation on the sketch's points, the point changes cause all the shapes that reference them to be notified and the sketch face is regenerated, causing the 3D tools to be automatically redrawn.

Since there were some big changes over the past two weeks, we decided not to have a release today and continue working on improving the tools and fixing bugs over the next two weeks. The next release, for version 1.7.2, will be on the 7th of December.

Tuesday, November 20, 2012

Today I fixed the other 2 major issues we had: translation for 3D solids and Cut on sketch.

Translate now works on 3D shapes, updating the shapes on the underlying sketch and triggering an update for the 3D shapes that reference the sketch. A shape can be translated using the Translate gizmo by dragging it along an axis (using one of the arrows) or on a plane (using one of the parallelograms):

I've also modified the Cut tool so that it applies the cuts (through all or to depth) for the entire sketch:

Monday, November 19, 2012

Today I made the changes related to edit sketch - sketch shapes are hidden after a 3D tool was applied, and shown again when the sketch they belong to is being edited. Shapes that belong to a sketch without a 3D operation are always displayed:

For this to work, I've also updated the way a sketch can be selected for editing:
- if there is no 3D tool on the sketch: select any shape from the sketch, then click on Enter Sketch
- if there is a 3D solid from the sketch: select the 3D solid and click Enter sketch
- either case: select one of the shapes in the Tree View and click Enter sketch.

After last week's 3D tool changes the Translate gizmo doesn't work correctly, so I'll work on fixing that next, along with updating the cut tool.

Thursday, November 15, 2012

For the past few days I worked on improving the face generation for sketches and applying pipe on all sketch shapes.

Initially, the faces were created separately, once for each tool operation, but that wasn't efficient, so now we're creating just one face, which is a boolean add of all individual faces, and this operation is performed once, on Exit Sketch.

I've also modified the Pipe tool to work with the new sketch face structure:

Next steps:
- notify extrude when sketch is changed
- change the Cut tool to work with the new sketch face
- hide the sketch points and wire when we're not in Edit Sketch mode

Tuesday, November 13, 2012

Today I worked on improving the Extrude tool to allow extruding shapes with holes. Until now, if one shape was inside another, both of them were extruded. After today's changes, the shape inside will act as hole:

Tomorrow I will do more testing, fix any bugs and work on improving the speed.

Wednesday, November 7, 2012

Today I committed the changes for the Translate gizmo: I've updated the code used for sketch shapes - if the shape is constrained the Solver is called and the points are updated according to the solution it finds - and I've fixed it for 3D objects.

For both cases, all dependencies are updated and there are no more points that remain in their original position or are transformed differently from their parent shape/solid:

Friday, November 2, 2012

Today I finished the improvements for chamfer, fillet and rectangle drawing on faces of 3D solids. I've also started updating our website, narocad.com, and all the information and demo videos about these tools can be found there: fillet 2D, chamfer 2D and four line rectangle.

As I make more changes to tools I will add the information about them to the website, so that everything is easily available there.