Friday, April 29, 2011

Unit Testing/Boo Script Fixes

A lot of code was not updated to be sketch aware and this showed some areas with problems. This made that the Sketch based code to be a bit harder to use and made a lot of 2D sketch shapes to not work out of actions range. Right now somelike 50% of scripts and unit-tests affected are working again.
Unit tests are critical to make a baseline of NaroCAD code to know that errors are in usage of code, and to not propagate all errors to break everything. I will work more to fix them as it appears that where unit-tests are fully broken, most of functionality (at least on Boo scripting level) seem also to be completely broken.

Thursday, April 28, 2011

OpenCascade 6.5.0 wrapper work schedule

Built a final version of OpenCascade 6.5.0 wrappers and started investigating why Naro crashes with the new wrappers.

It seems that on 6.5.0 the installer doesn't set the environment variables anymore. Made a script that launches Naro in Visual Studio previously setting its environment variables.
Some crashes appear when opening and closing local contexts. Possibly something on OpenCascade functionality changed in this area.
Some crashes appear when selecting something. Made a sample movie for this case:


The crashes are not created by adding finalizers at all wrappers, I tested also with wrappers that don't have finalizers and the behaviour is the same. It seems to be generated by some changes on OCC. Investigating this issue will probably take time.

As on next week a Naro release is scheduled will save the wrappers work on this state and change the environment back to 6.3.0 to help at finishing the current release.
Will continue wrapper work after release.

Monday, April 25, 2011

Constraints Icon Preview Working

NaroCAD have right now icon previews for applied constraints. And some bug fixes are done to not apply random constraints in tree like: parallel line with itself, or such, making sketch based solver to get crazy in most cases.

Some small issues were fixed as projects layout copied DLLs to specific sketch based projects and this code was also fixed.


So look here to demo:

Saturday, April 23, 2011

Solver Geometry Jumping and a Resharper tip

I did and I do work for a simple and smooth experience to work with a sketch solver. Anyway, as solution is applied real time, some solutions may not appear as obvious and the solver do some jumping. I did improve a little but are still corner cases when it still jumps and I did not found a simple use-case to reduce those cases. I will hope to find a proper solution but in the mean time I will improve in other ways the solver integration. (like I try to find a proper way to display visually the applied constraints, to not make user to navigate in tree or to select all combinations to see why some things are not moving because some constraints are applied).

Other thing I want to describe is that in my coding experience Resharper (no marketing intended, yet this software addon is one of the best I've found), had always some odd issues when is working with Visual Studio setup in Spanish (the language of my Windows + Visual Studio setup). This make me reticent every time I've upgraded that I will lose the keyboard mapping and was really odd to setup one by one key combination.
So the tip is the following: go to Herramientas->Opciones->Teclado, set as default: Visual C++ 6 as default shortcut mapping and after this go to Resharper->Options->Visual Studio Integration and apply the Visual Studio style. After this you will be able go use great shortcut integration that Resharper provides.

And let's not forget: Happy Easters for everyone! (for who celebrates it!)

Thursday, April 21, 2011

Naro on OCC 6.5.0 wrappers

Built a 6.5.0 wrapper library for the wrappers used in NaroCAD. Fixed also Naro so that it compiles with the new library. Still have problems at starting it, possibly because of environment settings.

Pushed the new compiled set of wrappers on SVN and also a 6.5.0 Naro on the bxtrx Mercurial repository.

Next step is to fix Naro starting and investigate if it works correctly with the new wrappers.

Tuesday, April 19, 2011

NaroCAD New Background Colors and a Twist

NaroCAD had for some time background gradients, yet this made it awful to work with them, because sometimes they were flickering. This is the reason that we patched them using a patch from OpenCascade forum. We also made some ugly yet explicit tricks to make it happen right: we force updating screen after some seconds after NaroCAD starts. The flickering was still there but in rare cases after patching.
I've eventually found another way to do it, flicker free as it seem and also the color theme is a bit more vivid.
The reason is that we display a bitmap based background instead a layers based background which OCC (6.3) seemed to have that much problems with.

6.5.0 wrappers

Finalized wrapping the 6.5.0 packages, merged on them previous wrapper fixes and pushed on SVN. Next step (estimated to take 1-2 days) would be to fix the compiling errors.
A problem that might appear after the new wrapper library is generated could be some problems on memory allocation deallocation caused by the fact that now all wrappers have finalizers (a good point will be that memory leaks will be greatly reduced).

Monday, April 18, 2011

Sketch Constraint Circle/Arc More Constraints

Based on SketchSolve's implementation more constraints are accessible. The code was changed at multiple levels to make constraints to be easy to set and less prone to errors (by using generics).

See a demo here:

Sunday, April 17, 2011

Sketch Hinter Preview

The Sketch's hinter will detect four combinations so far: if a line is horizontal/vertical and if two lines are parallel/perpendicular on each other.
When you will click on it, it will actually check if those relations are possible and it will apply them as constraints.
A video preview can be seen here:

Friday, April 15, 2011

6.5.0 wrapping status

Generated wrappers for the OpenCascade 6.5.0 and started verifying by hand and merging from previous version the compile fixes and bug fixes we made during time. Around 30% of the wrappers reviewed until now. After finishing will compile them and make tests to see if Naro crashes.
All the new wrappers classes will have finalizers, this might lead to crashes during running.

Thursday, April 14, 2011

Sketch Hinter Work

Hinter NaroCAD component have some limitation and it work odd for a sketch based drawing:
- it practically have no high level information (and is really hard to achieve on complex shapes like a combination of results of different tooling). Sketch drawing works with much less shapes. For this reason a second point will likely become true:
- the hinter will be able to introduce constraints automatically for shapes that can take advantage of it. Also the hinter may know some specific interactions to handle them in a proper way. To be more precise: the hinter in the past was simply know that an edge was parallel with the previous two points. The new hinter will likely know that you want a line with another line to be parallel and will do the corresponding work for you. In the global hinter, dragging the radius of a circle will give to you likely erroneous hints like line parallelism, which is at best useless
- hinter will scale better: there will be no shape extraction logic, or a shape that is made of clone to simply pollute the entire scene with edges. If your sketch is unique, all the rest of scene will simply be ignored, so you will notice less clutter and will see it as working faster

So you, the reader, already grasp the ideas and utility of the sketch hinter and when implementation will take shape, I hope you will enjoy working with it!

6.5.0 wrappers

Today started working at updating the wrappers for the 6.5.0 version. Will analyze package differences and probably in a few days will have a new wrapper library.

Wednesday, April 13, 2011

1.6.1 Alpha preview

Today we made a 1.6.1 alpha build to offer users some preview on the latest features we plan to launch.

We made a big rewrite on NaroCAD and added: integrated a solver algorithm, implemented the Sketch concept and 2D tools that use the Sketch, reimplemented Extrude to work with sketch shapes, added 2D dragging handles that work on the current sketch. A final updater version was also included in this build.

A sample movie that demonstrates lines drawn having a perpendicular constraint on them. Demonstrates solver behavior when a point is dragged:



Another sample that demonstrates drawing a rectangle (that is built from lines with constraints) and also a circle center connected to one rectangle corner:



Download NaroCAD 1.6.1 Alpha from here.

Tuesday, April 12, 2011

Rectangle as Constrained Lines

Rectangle implementation is defined right now as constrained based four lines shapes.
This implementation shows lively how constrains work and will be a good test case to them too.
So look here for details:

Saturday, April 9, 2011

Sketch Constraint Document Apply

Sketch shapes that are referred by constraints if changed on commit they will trigger automatically the solver. This also implied a code refactor that exposes which shapes are lively changed in document. Also, based on Sami's work that when you press Sketch button, the sketch shapes buttons are enabled, the code was made better both as quality and how behaves making it more consistent and easy to use. The Sketch Constraints button was moved to the Sketch Section so will be easily accessible to access shapes.

Friday, April 8, 2011

2D shapes dragging handles

Modified line dragging handles so that the user can drag 2D shapes only in their Sketch plane. Implemented also a new type of 2D rectangle dragging handles used for 2D shapes. Will apply these modifications also at the other 2D shapes.

Thursday, April 7, 2011

SketchSolve Action Preview

A full solver for sketch shapes (based on SketchSolve code) is right now in preview state in an easy to use action. So this video explains it how it works and how to use it:

Wednesday, April 6, 2011

2D Sketching tools

Worked at porting the 2D drawing tools to use the Sketch concept. Implemented the Arc CSE (center, start, end), Arc SER (start, end, radius), Ellipse tools including animations. Fixed the line and circle tools, improved the sketch launch/close functionality.

Sunday, April 3, 2011

SketchSolve NaroCAD Infrastructure Explained

SketchSolve is a 2D Sketch Constraint Solver and NaroCAD is a 3D based designer.
SketchSolve have mostly a dynamic programming solution optimizer that will apply the constraints using a big dispatcher to compute the errors that may happen in applying the constraints.
From NaroCAD standpoint challenges are at two levels: sketch shapes need to be sketch oriented, so by design all shapes get references to a sketch. The second problem is how to setup at programming level map the Line, Point, Arc and Circle from NaroCAD to SketchSolve semantics and after the SketchSolve is done, to make things back. Another small feature, yet useful is that those constraints are in a chain, so at programming level, the code at NaroCAD level is smart enough that by simply stating a shape, will build all the dependency chains to be computed in SketchSolve. To be both efficient, this code uses the GraphMapping component that compute back-references and get the mapped constraints.

So let's take a simple(st) case:
"NaroCAD have defined two points and one constraint (PointToPoint) and one point may be moved"
How the back logic works:
- the scene computes the back references: so P1, P2 are references by P2PC
- BFS algorithm will find in P1 -> P2PC -> P2
- a re-mapping will translate NaroCAD shapes and constraints will be converted in SketchSolve logic
- SketchSolve will solve the the constraint system and will retranslate shapes to make the system to work
- at the end shapes will be un-mapped from SketchSolve so the constraints will work accordingly