Monday, November 30, 2009

Other small improvements on usability

Continuing bxtrx work on usability, spline have a better/easier behavior on editing, adding points as follows: adding points, will be done by setting on the action of adding points to spline. Removing points from spline is just to press Control and click on the point you want to remove. Pressing Shift will show the old dialog though (without the Remove button in case of spline's points). Are some small issue but I hope to address them tomorrow.

Inherited copies are used in Repeat Pattern tool as default. The new behavior will create multiple small shapes that you can modify individually. If you will want the old behavior, that creates a monolithic shape, you will have to uncheck the "Reference Inherited Clone" check box when the setup dialog will appear.

Improved usability

Introduced an experimental feature at Extrude to display to the user the Extrusion height realtime while the user moves the mouse. This should improve the usability and probably will be improved and implemented at all drawing tools. To display the text used the same functionality as the one used for Dimension.

Line normal to Face

Implemented a tool that draws a line normal to the Face where the user clicked.

An encountered problem here is that our mouse point generator generates points on the faces over which the mouse passes so in this case it starts generating points on the clicked Face, in order to start drawing the line upwards the user must pass the mouse over some other Face in other plane that the one clicked. We should find a way to improve the point generating algorithm.

I have eventually net

I eventually got (broadband) internet after three months of waiting. In the meantime I did wait a bureaucratic papers to make it their ways to break around 50 meters of wiring in a public section. In the meantime I used mobile internet. Jumping to mobile internet I found a lot of persons that really have not access to broadband internet and what it means. Not because I don't know it, but sometimes is simply not feasible to think on some procedures without thinking on that users.

Today I did did worked on update and seems to work but I will test it and I hope by tomorrow to make an nightly build with Update activated. By this it will be created most probably two builds: nightly build and a stable build. The nightly build will be updated nightly and the updates will make you to have a blog-to-date fixed version. Also, the updates will be changes day by day so you will not download all days the OCC distribution so it will be the recommended build for you if you care on your last features are on blog. But more on this when the nightly build will be posted.

Saturday, November 28, 2009

Inherited Copy and what it means

To Copy/Paste a shape a Control+C/Control+V sequence works as expected: your source copy and the destination shape are separate entities, and the destination is a clone of the source. This means that you can save a part of your work when you have shapes that are similar. This is good in your design work but there are some use-cases that this design is far from perfect.
For those cases enters Inherited Copy. An inherited copy is shape that clones a source shape but all changed attribute are overridden to the source.

Let's expain with a simple case: lets take a shape S that have attributes: A, B, C (like color, transparency, transform, etc.). We clone with Reference Copy. Let's name this shape D (D comes from destination). When you change in S attributes A, B or C, they apply to shape D automatically. But if you change ever any of D attributes, like supposedly B, the following changes of S.B will not change D.B, only S.A and S.C.

It's easy? Isn't so?

To create inherited clones, just use Control + Shift + V.

2D Offset tool improvements

Worked at improving the 2D offsetting tool.

Added code to generate interior offsets to shapes. Found a very interesting classifier class: IntTools_Context that among other methods has IsValidPointForFace that classifies the position of a point related to a face.

Tried also improving the external shape offset to generate the same shape and not rounded shape duplications but couldn't find a possibility to implement it. Some custom algorithm needs to be built.

On the screenshot an interior offset can be seen. It looks exactly like the external shape (a face was generated and then extruded). The exterior offset has rounded corners.

Lua Unit tests

Lua code was moved to be accessible from other parts of the code like unit tests. By this will mean if you can have a Lua script that make Naro to fail, you can submit to our team and we can put that script in the unit tests to not happen that crash again.

For you as user will mean no visible change but for us will mean another way to reduce crashes and problems you may encounter.

Friday, November 27, 2009


Implemented a first version of offset that offsets Faces and Wires. It needs improvements to accept also negative values and also would like to change it to generate sharp corners not rounded ones. The 3D version of the offset will also be implemented and probably 2 tools will be created: offset that offsets the solid and offset that shells the solid.

A screenshot with the currently implemented functionality:

To implement this tool used BRepOffsetAPI_MakeOffset with GeomAbs_JoinType set as GeomAbs_Arc.

Editing precise

NaroCAD 1.2 release adds a nifty feature on 2D shapes. This is really important one meaning to drag&drop to edit points of a specific shape. The reason of this feature is that in most of cases mouse is imprecise. Another reason was that Spline have no proper way to edit it's points.

The solution was to create a custom dialog as the shown one. To edit it you just need to press Shift on the point you want to edit and this dialog appears. The Remove button appears for multipoints shapes. Hope you will enjoy using it...

Thursday, November 26, 2009

Multi-File bug reports and cleaning file management

The last release included auto-save support enabled by default. For simplify developers work, this autosaved file was sent as a bug report. Even is great for developers that gets more information to reproduce your problem, you may have cases when your don't want to report what you work with Naro. Or another case, you want to show a specific screenshot or extra logging (a virus maybe :) ). For both of those cases it was implemented.

Step and Brep formats are setup out of Save/Open entries. Save to Step have the following behavior: if you have selected a shape, it will save only it to Step, elsewhere it will save the entire scene.

I will try to solve the issues of Updater to make easier to users to upgrade their machines. I will try to make also a nightly build repository that you can test all Blog/SVN builds and you can drive with your feedback as did murd the last day.

Wednesday, November 25, 2009

Export to step working

Exporting a specific shape to Step is supported right now. In this way the Step format is supported at the OpenCascade level of supporting of save/import. Combined with work of yesterday, you will be able to work with Step seamless.

I will work to improve the editing component to make possible to make precise point editing.


Implemented the Direction tool to work in Naro something like the "normals" command from Draw Test Harness. The normals on faces with orientation FORWARD are displayed with red and to the REVERSED ones with blue. Also at double click the face orientation is changed to the opposite value. This tool is mainly needed for development research more than for modeling. ex: This helped investigating on cases when the cut to depth generates nothing (because the Cut prism direction is not intersecting the solid and the cut height should be negative like -100 instead 100).

Today tried a cool way to check on Naro geometry:
- export the Naro model to STEP
- load on Draw Test Harness the geometry using a command like:
stepread extrude.step ex
- apply commands to visualize normals and to check the model:
checkshape ex_4
bopcheck ex_4
bopargcheck ex_4 -c // check if shape is a valid Cut argument
normals ex_4 50

Tuesday, November 24, 2009

Undo/Redo on external shapes

Naro had for some time the possibility to load external shapes in Step format. But the problem that Naro was not able to store it as it is because NaroCAD stores high level shapes. For counter this problem was created a shape that stores the shape as is. The single bad problem that this shape was not stored persistently in tree. That means that on operations like Undo/Redo will make Naro simply to crash if is involved an external shape that was not persistently stored. Right now is stored like a binary blob in Base64 format so it can get pretty big but at least solves the problem. One small optimization is that the binary blob is compressed to save space. So the 90k file representing the OpenCascande's sample "screw.step" is compressed to 50k internally (and is that large because Naro uses Unicode strings to save the diff data).

Enjoy importing from now your Step files in Naro!

Face Direction

Implemented a direction tool that displays the normals on faces and their direction. This will be used to analyze geometry and research on the operation result in cases when faces have different orientations (like cut on extrude). Started analyzing in Draw Test Harness Cut on Extrude situations with different face normals.

Improved auto-restore

If you don't want to auto-restore your scene, an empty scene was not loaded. This was fixed. Also a half of work was done regarding improve File->New->Part work. Naro for now is not multi-document aware architecture so it will replace your current part you work on. I will also focus on all document formats work.

Monday, November 23, 2009


Improved the magic points parallel line matching to detect if the mouse is on the OX, OY or OZ axis before looking for edge matching or parallelism matching. Refactored the the parallelism code to make it simpler and cleaner, made unit test codes for all magic points algorithms (point matching, plane matching, edge and parallelism matching).

Will continue implementing a Direction tool. This will be used to display the direction of a face allowing the user to change its direction. This will be also used to research on faces to see what causes some cuts through solids to generate shell like results.

Being Agile

Let's remember some of the principles behind the Agile manifesto:

- Working software is the primary measure of progress.
- Continuous attention to technical excellence and good design enhances agility.
- Simplicity - the art of maximizing the amount of work not done - is essential.
- At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

Interesting concept: Underdo your competition

Friday, November 20, 2009

NaroCAD 1.2 Released!

Uploaded on Sourceforge the NaroCAD 1.2 version. It can be downloaded from here.

In 1.2 version compared to the 1.2 RC1 version enabled a new functionality: recovery functionality in case of a crash.

Thursday, November 19, 2009

Auto save enabled

NaroCAD is a software product in intensive development, so many features may be experimental and you may be the unlucky person that Naro will crash in the middle of your work. We never want that but it will be great if you will have a previous state. Also, bug reporting can be enriched if you can send your document you worked on.

Auto saving your work is done at every step so you will have an autosave.naroxml file that store your entire scene, in your running Naro folder.

AutoSave makes possible to expose to user in bug reporting the document he worked on. This can be more intuitive for developers when we try to reproduce crashes/bugs. This feature will be enabled from the next release (1.2.1), so is just another reason to try the latest Naro and give your feedback.

Also the tools like NaroLinker, NaroUpdater were reviewed today. NaroLinker have a bug actually that do stop to add classes and I was not able yet to fix it.

The next days I will try to improve the update concept, can be improved to make a save only once at some minutes, also, some testing will not trouble anyone for this new code.

Wednesday, November 18, 2009

NaroCAD 1.2 RC1 lauched

Uploaded on Sourceforge the NaroCAD 1.2 RC1 version. It can be downloaded from here.

Among the features added at the new version are:
- Fixed around 40 bugs,
- Added editing with Drag and drop for 2D shapes. When no tool activated when clicking Line, Circle, Ellipse, Rectangle, Arc, Spline marker points appear and can be dragged with the mouse,
- Implemented Chamfer 3D to be applied on solids, Chamfer 2D to be applied on wires,
- Implemented diameter and length Dimensions,
- Implemented pattern repeat. A shape can be repeated and rotated a number of times having a guideline,
- Implemented Mirror relative to a line and to a point,
- Improved the error logging all errors are logged with log4net,
- Stabilized the intersection algorithm and data tree structure. Undo, Redo, Save, Open are fixed.

This version will enter now under more testing and bug fixing.

Tuesday, November 17, 2009

Bug fixing

Started to make a quick check on the current bug list and closed fixed bugs.

Fixed the majority of bugs related to Dimension. Closed bugs related to selection type closing when changing between tools or incorrect display in toolbar of active selection type. The bugs related to intersection algorithm were all closed.

Will work at bug fixing until the end of the week. At this moment 28 bugs remained to fix.

Monday, November 16, 2009

Cut Preview - usability gets better

Cut operation is a very useful for engineers but sometimes gets tricky just because you don't know how much it will affect. One of the causes is that Cut Through All you are not certain of what it cuts. Another reason is that Cut to Depth is related with face orientation. Meaning that in case you want to have inverted Cut, you will not be able to see the result before you clicked OK on button. That can make really annoying to do Undo and dialog again until you got the "right values".

Right now Cut makes all scene semi-transparent and will explicitly show what the Cut will affect. Hope you will enjoy this way to work with cut operation.

Fixed Dimensions

Succeeded to fix the direction detection problems at Dimensions. Now Dimensions can be drawn with better precision.

Will continue with bug fixing .

Closed Iteration

Closed Iteration 1.9. The finished tasks on this iteration are:

- Added editing with Drag and drop for 2D shapes. When no tool activated when clicking Line, Circle, Ellipse, Rectangle, Arc, Spline marker points appear and can be dragged with the mouse,
- Implemented Chamfer 3D to be applied on solids, Chamfer 2D to be applied on wires,
- Implemented diameter and length Dimensions,
- Implemented pattern repeat. A shape can be repeated and rotated a number of times having a guideline,
- Implemented Mirror relative to a line and to a point,
- Improved the error logging all errors are logged with log4net,
- Stabilized the intersection algorithm and data tree structure. Undo, Redo, Save, Open are fixed.

Will continue with a week of bug fixing and if no major bugs found will make a release version or at least a build.

Saturday, November 14, 2009


Implemented the Dimension tool. It detects if a shape is circle and generates a DiameterDimension, if it is an edge it generates an EdgeDimension. Implemented also realtime drawing so that the dimension text moves after the mouse when drawn until a click shows the location. The text display the circle diameter value and the edge length.

On circle it seems to work well. On edges it still needs improvements as the dimension orientation is not properly detected.

For the graphical representation used the OpenCascade AIS_LengthDimension and AIS_DiameterDimension classes. In order to use this type of AIS objects in the data tree had to implement a new type of interpreter that holds and displays this type of objects.

Friday, November 13, 2009


Some bugs were addressed like: flickering on creating/manipulating real-time shapes. The cause was a forced update in the middle of an update shape instead at the end of it (or not at all).

Lines can be drawn continuously right now. Lua script with lines do auto-face.


Started working at implementing dimensions in Naro. Read all documentation related to it, studied the implementations from test harness, looked on forums.
Succeeded to implement some prototype code that represents radius and diameter for a circle and length dimension for a segment.

Tomorrow will implement the dimension tool code to detect what type of geometry is selected and what is the dimension representation appropriate for it (ex: for circle - diameter, for edge - length). As graphical representation will use the OpenCascade interactive classes for dimensions but because they don't look very advanced and configurable probably in the future will implement also some custom graphical representation for dimensions.

Implemented Chamfer, Chamfer 2D

Implemented Chamfer tool for solids. Implemented Chamfer 2D that can be applied on intersecting wires, also it can be applied on the edges of a face.

Thursday, November 12, 2009

Editing shapes for remaining shapes

Was fixed an thrown exception on the yesterday's code. Editing for 2D shapes is reviewed and made more compact. By this all shapes excluding cerc and ellipse (which depends on non point editing). Cerc editor was implemented by bxtrx. As of next week we will target bugs, I will try to target bugs tomorrow too.

Wednesday, November 11, 2009

Latest new bugs are fixed

Two major bugs were addressed: the line/circular pattern have now a check box to not advance so makes possible to make circular pattern without making line advancing. The shape 2D editing changes were not commited.

Lua created lines right now do autogroup.

Also a small bug on help that do not show on patterns was also addressed.

Data tree improvements

NaroCad's internal data tree that holds info about the data, undo, redo and knows how to save, open is implemented in C# and has a similar structure with the OCAF package from OpenCascade. Being in C# and not wrapped it offers a lot of advantages like improved code readability, improved debugging and most important possibility to launch events (like when a node is modified it informs the view to redraw it - functionality not easily implementable with wrappers). Also it offers advantages when modifications propagate.

In the last 2 days worked at strengthening the unit tests for the data tree by implementing use cases and data integrity checks. With this occasion found and fixed some of the bugs that were affecting Undo/Redo. The problems were mainly created by the face intersection functionality integration with the data tree. Now the Undo, Redo, Save, Open should work better.
Will continue reviewing the data tree code/architecture. If no major problems found will continue with implementing Dimensions and the Chamfer tool.

Editing for shapes almost done

Editing for Line and spline are almost done. There are small issues though so I am gonna fix them. The actual design permit that you can add extra editor handlers for new shapes in future and when you click on a shape, it will show specific to that shape the list of the points that can be dragged.

I will work to fix those issues, a help related issue (that the mapping of help do not work just right) and after this I will continue with work. So today I will just work on polish and bug fixing of just implemented code.

Tuesday, November 10, 2009

Undo, Redo, face intersection fixing

Implemented a test unit with 2 rectangles that intersect and extrude on one of the intersection shapes. The unit test duplicates a bug that appears in Naro at Undo Redo.
Succeed to find and fix the problem. After fixing it seems that Undo Redo started to work well.
A problem that will be left for the bug fixing week (next week) will be to investigate the Delete crash. It might be related to this problem.
Will continue with improving the unit tests and check if the data tree behaves well when using shape intersections and Undo Redo. If everything is ok will think how to refactor the code and improve the performance. One more day of work will be dedicated to this task, if needed will be extended to 2 days.

Monday, November 9, 2009

Initial work on editing 2D Shapes

The 2D shapes cannot be edited visually but they can be changed their properties in Property Grid.

But the most natural wanting is to edit them visually. The concept skeleton I am still considering some small changes so hopefully it will work smooth.

Error logging improvements

Removed all references and usage of Enterprise Library logging code. Now all logging output is routed to log4net. Improved the exception mechanism, more information like the crash call stack is logged.

Updated the unit test codes for the data tree and shape intersection algorithm, reviewed the new face splitter code. Will continue with making unit test cases for data tree that fail and solve bugs at it.

Table made by Lua script

Our contributor Cris did a great job showing his success with Naro and stressing Naro's capabilities.

There are created a lot of shapes, there and stressing both 2D and basic operations like Extrude in it.

At the end it creates a table which can be seen here. Also there is a 3D transparent view of it. This was done somehow easier as I could filter the extrudes and setup transparency for make this view.

See bellow and hope you like it:

Sunday, November 8, 2009

Properties dialog for Linear Pattern

Linear pattern have a Properties dialog which make easier to edit the associated relevant properties for the linear-circular pattern.

Hope it will make easier to edit the linear patterns shapes.

Friday, November 6, 2009

Mirroring and repeat pattern

Mirroring against a point and a line seems working in the trunk version (I think it need some testing but the feeling is right here). Also the repeat line pattern.

How it work?
- Pick your shape first
- Pick the point (for Mirror Point) or line (for Mirror Line or Repeat Pattern)

In case of Repeat Pattern you are asked how many times to make a complete (360 degrees, 2*PI) rotations and in how many steps should translate the length of the whole line.

See screenshot for Repeat Pattern of one of the initial rectangles, 1 complete turn and 10 steps. If you simply want translated along with a line (to make stairs without rotation) you will need to put 0 (zero) for complete turns when the dialog will appear.

Thursday, November 5, 2009

Continue work on Mirroring

I've start my day working on NaroLinker as I was need to add to wrappers some new classes. Right now NaroLinker have some bugs but I will not target them as was somehow easy to be added by hand the needed classes to the wrapper.

Right now there is mirroring up-and-running at model level so I will need to create the related visual code. It works against a point and a edge. So expect it to work it soon.

Wednesday, November 4, 2009

Initial work on Mirroring

I start working on mirroring shapes. OpenCascade supports mirroring as a transform operation and can be done against a point, a line and a plane. I've added (there is no visual tool for this) a point shape to be tested against both: lines and points. Also I think that I can share the code with creating shapes using other transforms (like rotate, translate, etc.) but I still evaluate this.

An annoyance in NaroLinker that it makes you not be able to use too nice your machine was removed: all commands used in build are launched silently.

Why am I so happy that Windows 7 was launched?

Windows 7 gets a fairly positive reviews all over the IT world. In fact, it's technology is Windows Vista SP2 with refinements. It's technology is similar with what was Windows 95 saga vs Windows 98. Even Windows 98 was somehow a bad operating system, and have a BSOD on it's first public presentation. But in years, after Windows 2000 appears, people don't want to get rid of Windows 95, or a bit later about Windows 98. But in fact Windows 95 and 98 were on the same family of products.

The same thing applies to Windows Vista compared with Windows 7. The backslash of public opinion of Vista, was the same backslash that Windows 95 has (it was considered bloated, slow). The improvements of hardware made the new Windows 98 (which in fact was Windows 95 with small updates on UI) to be more positive.

In some extend the same thing happens with Vista: it brings new technology, a bit incompatible with XP "old OS". Was a bit slow for it's start. Do you think anyway that Vista was ever considered a slow release? Or Windows 98, or XP, or any OS from Microsoft? Look in history of more or less independent reviewers that Vista do not perform so bad, if you don't believe me, look here.

The good think is that virtually all programs that run on Vista, run on Windows 7. If you do all upgrades to your Vista machine, you will have installed already .NET 3.5 (the same version as Windows 7 does), the same IE8. In fact NaroCAD never had more problems on Windows 7 than on Vista, and no crash was because was Windows 7.

This launch of Windows 7 will push much more people to leave the beloved XP away, and makes also Vista to be really a great deal. You can buy Vista Home Basic in OEM at really bargain prices. I found a shop (in Spain) that sells it as low as 30 euros (care that we talk about OEM, so you should buy a new hard drive or video card with it at least). This is incomparable with an OEM price of 90 euros of Windows 7 upgrade price (see here). And the good thing is that you get (almost) the same OS (that version do not have included SP1, so I had to wait a bit to apply all upgrades), but as of today all new hardware you buy is Windows Vista compatible.

If Windows7 +1 will be technology compatible with Windows 7, it will just mean that if you can wait another three years and buy at that time Windows7, at a very good price with no big compatibilities issues that Windows 8 will have at their prime time.

Tuesday, November 3, 2009

NaroCAD 1.2 released

NaroCAD went a long way from the 1.0 version. The revision count doubled from 1000 to 2000.

There is a lot of new functionality that you needed and right now it is here. It covers all major tool functionality (like pipe, spline, cone, sphere, boolean operations), it got a lot of polish in UI and usability, lua scripting for generating scenes faster etc.

We, the NaroCAD team, really want you to try this new release version and give your mark on it. With your feedback, and who knows, your contributions we can make one of the best free-opensource CAD systems out there. Being written in C#/.NET makes the code easy to understand besides our team's willingness to help in all problems you may have with this codebase.

If you think that a new functionality is still needed, you may join the NaroCAD Feedback sessions or simply report a bug. We value your feedback and hope that you will like this release.

You can download the 1.2 Beta release version from Sourceforge page:

Sunday, November 1, 2009

Face splitter refactor and why was done

More than a week I was targeting undo/redo bugs and the last big remaining bug was on face-splitting. Half of reasoning was that there were some quirks in current codebase (small issues but the code was stressed to show those problems) but face splitter in particular was a bit overwhelming (for me at least). The cause is just that cases where it does not work are only cases with spliter that works with more than three shapes, undo that applies out of order the items (the splitter itself required that references to be deserialized first), a lot of side-effects.

Splitter in itself was the first shape that creates other shapes, meaning small "pies" over an area that shapes actually intersect.The actual refactor targets just that issue, and gets out the splitter out of tree, as is much more a helper code. By doing this, the splitter will work more or less like the solver component (so as an scene utility). Because splitter required kinda big refactor, was a good reason to also cut out (some) parts of code in smaller pieces. The shapes are created right now in a separate assembly, and is not mixed with property grid assembly one. This will mean for anyone that will look to the code a bit more clear where to find stuff. This code moving does not change functionality more than the splitter related one.

An installer nice thing: NaroCad will use ngen at the end of instalation translating in waiting for around a minute at the end of installing (the biggest thing is to compile wrappers, so using NaroLinker may improve the compiling time), but startup time will simply halve. So you will "feel" NaroCAD as being more responsive when next releases will happen.