Thursday, June 28, 2012

Updates to constraints

I've finished updating the arc and circle constraints to use the new constraints structure and updated it for all shapes. Now, instead of saving all the individual points for a shape, we only save the shape index and retrieve the points using offsets.
You can find the changes here.

The only existing constraint that wasn't updated is PositionToCenter, which I'll rewrite as a OneShapeConstraintMapping instead of the current separate mapping. I will also add some more one shape constraints (line length, arc angle, arc radius, circle radius) and improve the way points are loaded for point related constraints. There is also a problem with one of the arc points that isn't repainted correctly after the constrained is applied.

Wednesday, June 27, 2012

Released NaroCAD 1.6.6 Beta

Today we released NaroCAD 1.6.6 Beta, which fixes some installer problems (the options.nxml file is now saved in AppData and the installer doesn't set any global environment variables) and allows constraints to be added after shapes were drawn for lines and circles.

The new version can be downloaded here.

For next version we'll continue working on the 2D sketching:
- Adding new constraints after the shapes are drawn for arcs,
- Define and implement all enter/exit sketch situations,
- Improve property grid (add solver processing after property grid changes),
- Bug fixing.

Monday, June 25, 2012

Adding constraints to lines

I've started working on the constraint tool and now it's possible to add constraints to already drawn lines:

The next step is fixing the constraints for circles and arcs, which requires changing the old constraints to fit the new structure we're using for the solver.

Friday, June 22, 2012

Realeased NaroCAD 1.6.5 Beta

Today we released the 1.6.5 version of NaroCAD. This version is built against the previous version of wrappers, it should work on most operating systems.
As the wrapper issue is solved for the moment from now we'll release more often (every 2-3 weeks).

The new version can be downloaded form here.

In this version:
- Extrude is enabled and working on most cases,
- Reverted to the old wrappers that were generated using C++/CLI. These work on most platforms and don't leak,
- Improved the Trim tool,
- Improved the Hinter,
- Fixed the 2D Fillet and Chamfer tools.

For next version we'll focus mostly on enhancing the 2D sketching:
- Enable adding new constraints after the shapes are drawn,
- Define and implement all enter/exit sketch situations,
- Improve property grid (add solver processing after property grid changes),
- Bug fixing.

Thursday, June 21, 2012

Extrude completed

As the Extrude tool had some difficult to fix issues decided to reimplement it. Probably this is the 4th time Extrude is reimplemented, let's hope this is a version that will remain for a long time :)
Added also an Extrude animation that shows the height during drawing.

A movie that demonstrates some use case:

Trimming tool changes commited

Today I've commited the changes for the trimming tool, which in addition to the changes mentioned in yesterday's post, are:
- the hinter isn't displayed when selecting a shape to be trimmed
- the reffered by nodes are loaded using the same method that is used for the solver, DocumentShapesGraph.GetReferredByNodes

I also fixed a bug found when testing the trim tool: the LineParallelAxis constraint added a new point identical to one of the line's extremities. This caused wrong nodes to be deleted and some points disappeared from the scene even if they weren't actually deleted.

The changeset also includes all the commits that bxtrx did for the porting to old wrappers.

Wednesday, June 20, 2012

Update to trim tool

When trying to trim a shape that had a constraint, the constraint wasn't removed and the points from the original shape remained on stage. I updated the tool and now the constraints are removed, along with the original shape and its unreferenced children.

Another update was for the circle trim. Until now, trimming lines, arcs and circles was done in the same method, causing some problems because the circle doesn't have a start and end point that can be used as it's used for arcs and lines. I've added a new method to handle only circle trimming and I've added trimming for more than two intersection points:

I've also done a 'list' of all the tested cases and their results for the special cases:
- trimming line is parallel to one of the axes
- trimming line crosses the radius parallel to the ox axis (the intersection between this and the circle is the origin and end of the circle curve)
- trimming wire is another circle
- trimming wire is an ellipse -> here we have a problem because the open cascade method that determines the intersection points finds only one point and so the entire circle is deleted
- trimming wire is an arc

Tuesday, June 19, 2012

Moved back to the old wrappers

We released the NaroCAD 1.6.x versions using a new set of wrappers that were implemented using PInvoke. This set of wrappers had a few advantages like: they were portable to Linux, easier to debug, lighter at deploy time. Among the disadvantages of this set of wrappers there are: they are generated from the old wrappers so we don't have a generator that works directly with OpenCascade headers, on Release build we have some strange behavior that we didn't identify yet, also they are leaking. Example of strange behavior: IntAna_IntConicQuad.IsParallel returns false on Debug mode and true in Release mode.

As our current focus is fixing Naro and deploying stable versions of it and because at the wrappers it seems that there is a lot of work to be made we decided to switch back to the old wrappers that were generated using C++/CLI. Also this wrapper version has issues (like they are still generated for OpenCascade 6.3.0) but at least with this version we can release and fix Naro.

We have a Naro 1.6.5 version built with the old C++/CLI wrappers that seems to work well. Now bug fixing it and preparing for release.
In parallel as a lower priority task we'll also put some work on wrappers, the most important task being the update to OpenCascade 6.5.x version. By the way: OpenCascade released for public the 6.5.3 version.

Friday, June 15, 2012

Fillet and chamfer changes commited

Today I commited the changes for the fillet and chamfer tools. I've added a validation for the fillet, to make sure we never draw the major arc, covered the chamfer corner cases (lines parallel to the axes) and changed the code so that the existing lines' coordinates are updated, instead of creating new lines and hiding the old ones.

Wednesday, June 13, 2012

Chamfer length update

Today I updated the chamfer and fillet tool because of some problems with method that calculated the intersection points. In some cases, this returned no solutions, even though the lines had a common point.

I've also updated the chamfer tool to use the size window value for the new line's length instead of the helper circle's radius. To do this, I calculated the required radius that creates a segment of the desired length:

Tuesday, June 12, 2012

Updates to 2D fillet and chamfer

As I mentioned in last week's post about the 2D fillet and chamfer tools, they created new generic shapes that couldn't be edited or extruded. Today I updated the tools to create known shapes.

For the chamfer, the resulting shapes are three lines. The new line's extremities are obtained by building a helper circle, with the center in the two lines' intersection point and the radius equal to the chamfer's radius:

For the fillet tool we need to create an arc and two lines. To determine the arc's center, we draw two additional circles (magenta) with the fillet's radius and the centers in the intersection points obtained from the first circle (lime green):

Friday, June 8, 2012

Irregular shapes extrude

I'm working on the extruding of irregular shapes, which now works for all types of lines and shapes resulted from drawing and trimming:

There is a small problem with trimming and intersection points aren't handled correctly when extruding, so for now this shape can't be extruded. I'll continue working on these and as soon as they're fixed I'll commit the changes.

Wednesday, June 6, 2012

Circle and ellipse extrude

I've continued working on the extrude tool and now it works on circles and ellipses, as well. There are some problems with the orientation of the extrusion and in some cases the extrusion is not displayed until the base shape is clicked. I'll fix these issues and then start working on extruding shapes resulted from complex drawing/trimming.

Tuesday, June 5, 2012

Fillet and chamfer

I've started investigating the 2D and 3D fillet and chamfer tools, which create a rounded or square edge between two lines that have an intersection point. The 3D tools create the chamfer/fillet without updating the underlying shape and the 2D tools create generic shapes instead of arcs and lines, so these are the changes I'll be working on for these tools.