Monday, August 12, 2013

New blog

After the 1.7.8 release we decided to move the blog to the NaroCAD website, so from now on you can follow us on

Thursday, August 1, 2013

Released NaroCAD 1.7.8 Beta

Today we released NaroCAD 1.7.8 Beta:

Generated and fixed a new wrapper set for OpenCascade 6.5.5
Fixed Cut to depth for negative values
Reimplemented Cut through All
Improved Undo and Redo functionality
Fixed Spline display and editing
Fixed display issues

You can download it here

Tuesday, July 30, 2013

Fillet and chamfer bug fixes and Spline investigation

Today I fixed two bugs related to Fillet and Chamfer 3D which caused errors when performing two fillet operations on the same solid or when trying to cut through a solid resulted after Fillet or Chamfer was applied:

I've also investigated Split and Combine spline, which in some cases don't have any effect because the coordinate for the mouse position doesn't match the spline nodes, even if the sphere gizmo is highlighted.

Thursday, July 25, 2013

Bug fixes

Over the past few days I've worked on fixing some bugs found during testing (some that we had in the previous versions and some new):
- Undo needed to be pressed twice to work
- Undo after cut didn't show the sketch shapes that were used for cut
- After trying to redo when there were no more redo steps, the application sometimes crashed
- Cut to depth with negative values didn't work
- Cut through all for solids resulted in wrong shapes
- Pressing Cancel in the Chamfer window when the chamfer operation wasn't possible caused the selected shape to disappear

The bug I'm working on now causes some letters to disappear from the hinter text:

Cut through all fix

Today I updated the code for Cut through all to use a vector-based prism to create the object that is used to cut through all the objects on the scene:

The old method, which used a prism built using the direction, with infinite length, caused the Occ operation of cut to fail in some cases (without an error), so I've replaced it with the equivalent of a mid-plane prism with a big depth.

Thursday, July 11, 2013

Interface changes and Cut Through All bug

I've updated the interface to eliminate the black overlay problem mentioned in the previous post and this is how the current interface looks like:

I also updated the installer to use the new dlls added to OpenCascade 6.5.5 and checked that everything works correctly after installation.

Cut through all and Cut to depth work in most cases, with Redo and Undo functionality. The bug I'm working on now is when the cutting sketch contains a circle - in this case, the cutting is not performed. Cutting with complex shapes, on planes that aren't parallel to xOy or through solids works correctly:

The Cut to depth tool works correctly in all tested cases, including cutting with a circle.

Thursday, July 4, 2013

Display fix for Splines and 3D solids

Today I fixed the display issues for coordinates and Hinter messages for the three types of splines and the 3D solids:

I've also updated the property grids for some of the tools, removing the property lock icon for the ellipse tool and 3D solids. The locking wasn't correct because the underlying constraints are not implemented and after applying the lock it wasn't possible to remove it anymore. I will add them and the needed constraints when I work on improving the tools.

The next issue to be solved is another display issue which sometimes causes a part of the layout to be black instead of transparent:

Friday, June 28, 2013

Wrappers updated to Occ version 6.5.5

Today I finished updating the wrappers to version 6.5.5. We decided to update to this version rather than 6.6.0 because the newest version has many changes and some issues that aren't yet resolved, with few bug fixes added from 6.5.5.

I started testing Naro and there are some issues that were fixed and some issues that we didn't have before. We can now display the parallel and perpendicular hinter images and spline editing works correctly, but there are problems when displaying text and coordinates:

Other tested features that work correctly:
* extrude and cut
* pipe
* array pattern
* circular pattern (with improvements for processing speed)
* 3D fillet on straight and curved edges (there seems to be an improvement in the way the edge is detected for complex shapes)
* boolean operations: fuse, intersect, substract
* translate 3D shapes
* dimension for line and circle
* 3D
* mirror point and mirror line
* adding constraints and solving the sketch

Friday, June 21, 2013

Investigating the 6.6.0 crashes

After the changes for the NaroOccCore.dll were done, I updated the code for the main Naro project - everything compiles and the application starts, quickly crashing with an error about 'NaroOccCore.dll' not being found. This is a frequent error and it can mean not only that the dll wasn't found, but that there was an error loading one of the dlls that is referenced from it.

One of the best tools to investigate this is the Process Monitor, but unfortunately it didn't report any missing dll. All dlls it tried to load were eventually found in one of the paths set in the environment variables and the file was loaded:

Before the program crashed, all files were loaded and there were no files that weren't found.
The next tool I used was Depency Walker (the 32-bit version, as NaroOccCore.dll is built for Win32) and this is the result:

I have rebuilt TKernel.dll and am now using dumpbin (though the Visual Studio Command Prompt) to analyze the exports and check why we have the dll errors. Only TKernell has such errors, but contains the main classes and most other dlls reference it.

Thursday, June 13, 2013

Updating to OpenCASCADE 6.6.0

The past two weeks I worked on updating the code for the newest version of OpenCASCADE, version 6.6.0. Today I completed the update for the wrapper generator and compiled NaroOccCore and NaroCppCore for this version and started updating Naro.

The changes for the wrappers are the addition of new classes needed for compilation, the removal of classes that we used and aren't included in the new version and updating the methods in the classes that remained mostly unchanged.

Thursday, May 30, 2013

Released NaroCAD 1.7.7 Beta

Today we released NaroCAD 1.7.7 Beta, for which we implemented the automatic wrapper generator and generated and fixed a new wrapper set using PInvoke for OpenCascade 6.3.0.

You can download it here.

Thursday, May 23, 2013

Code commited and bug fixes

Today I commited the code changes done since I started working on the new wrappers. You can find them here.

I've also completed a first version of the Test cases document, which is published on the website here.

I fixed some bugs I found for the Pipe Tool and will continue fixing some of the top priority bugs before we release a new version of Naro.

Friday, May 17, 2013

Working version with the new wrappers

Yesterday I finished the changes for the new wrappers and we have a working version of Naro, using the new wrappers. I've tested it in Release mode and also as an installed application. I fixed some of the bugs and am working on fixing the others, and aside from some small speed issues, the application behaves as it did before the wrappers port.

I am working on a test plan that will include all the cases I mentioned in the previous post, as well as everything I added during today's testing and I will post it when it's done.

Monday, May 13, 2013

Fix for Release differences and testing

Today we found the cause for the differences we had between Release and Debug builds, the Optimization property value set in NaroOccCore.vcproj. The Debug value was set to 4 and the Release to 2. Changing it to 4 in Release caused the .dll to be slightly bigger, but the behavior was correct and the methods returned correct values.

After making these changes, I tested the Release version of the application and the following operations and tools were ok:
- Extrude on default sketch, on sketch created on the face on an extruded shape and on sketch shape resulted after Trim
- Cut through all - through one extruded solid and through two superimposed extruded solids
- Cut to depth
- Array pattern with a 3D shape and a solid resulted after two extrudes and one cut through all
- Circular pattern with a 3D shape
- Basic Hinter and Solver logic
- Trim
- Draw 3D shapes
- Revolve line around line
- Fillet and Chamfer 2D and 3D
- New file, Save and Open saved file
- Dimension
- Arc (SER and CSE)
- Fuse, Intersect and Substract extruded solids
- Undo and Redo

There are still some problems with the selection of the drawn shapes and solids - the program crashes in IdentifyShapesUnderMouse.

Tuesday, April 23, 2013

Extrude fixes for Release mode

Over the past few days I investigated the issues we have with release mode and found that in some cases, in release mode, the IsNull property of a TopoDS_Shape was true, even if the shape was valid and the other properties were correct. Another property that had wrong values was context.HasOpenedContext.

Here is a short demo with Extrude performed on complex shapes, ran in Release mode:

The next issue to fix is the selection: when selecting a circle in release mode, the center point is returned as selected - this could be because the Context's selection is wrongly set, or the comparison method is incorrect.

Wednesday, April 17, 2013

Code changes integration finished and demo

Yesterday I finished the integration of code changes up to NaroCAD 1.7.6 into the solution containing the new wrappers and today I started testing.
The application works well in Debug mode, but there is a bug causing selection not to work in Release mode. Here is a small demo ran in Debug mode:

I will continue investigating the cause for the differences between Release and Debug mode and test it to make sure that the new version has the same functionality as 1.7.6.

Wednesday, April 10, 2013

NaroHost improvements

Today I worked on improving NaroHost and including the additional scripts I used into it, so there'll be fewer steps when we want to generate new wrappers. I also set the main structure for a tutorial on how to generate new wrappers, which will be published when all the code changes are done.

Monday, April 8, 2013

New wrappers built successfully

Today I successfully built the new wrappers in Debug and Release mode, ran NaroCAD using these new wrappers without crashes, and created the installer and ran it:

and here is the Process Explorer view, where we can check that no debug dlls are used:

The next step is to clean up the generation code, include all the external scripts I used into NaroHost and prepare a tutorial on how to generate the wrappers and how to add new wrappers.

Wednesday, April 3, 2013

Building wrapper on old .api file

Over the past few days I've tried to build the NaroOccCore.dll file using the files generated by the old OccWrappers.api file, to make sure that the base classes used by Naro are correct and that the build process is correct, and when I have an identical .dll file, build from that to create the new .dll file.

Unfortunately, even if the built dll file seems to be the same as the one found in the repository, there are some differences that cause it to crash.

Things I checked:

- the exports from both files using dumpbin: /exports, /imports and /dependents and they are the same, only the /rawdata results are different.
- the other files are the same and that replacing only the dll file causes the application to work correctly or crash, depending on the dll version.
- other versions of the code from different revisions, to make sure there weren't any changes that were used when building, but were commited later
- other branches for changes that weren't added to the main branch
- Qt version and install

I am now checking if there are differences in the compile options or other settings that might have remained uncommited.

Thursday, March 21, 2013


I did some more checks to find the causes for the crashes and one of the things I checked was the way the instances were created and deleted:
- there are no Dtor calls on instances that weren't created before
- there is not more than one Dtor call for the same instance
- for the program crashes during a Dtor call, the instance hand't been deleted before

There were situations when I drew as much as possible without the application becoming too slow, and there were no crashes.

I built the dlls in Release mode (I installed Qt version 4.7.3 from here: qt-win-opensource-4.7.3-vs2008.exe and fixed some wrong settings in the NaroOccCore project file) and created the installer for this version of Naro. The resulting file is slightly smaller than the one built with the old wrappers. Enter Sketch doesn't work on the installed Naro, I'll fix the bug and start testing the new wrapper functionality in the installed version, as well. The good news is that the dlls are built correctly and there are no calls to VS2008-dependent dlls as it was when we previously built Naro with these wrappers.

I also tried to improve the way 'const' in being handled in the generation code - I kept the other fixes and changed only the const keyword, but there were crashes after drawing one circle. I will continue investigating this.

Tuesday, March 19, 2013

Improvements to the new wrappers

This week I started working on fixing the new wrappers crashes in Naro.

The things I checked were:
- base class destructor calls - made some changes to NativeInstance.cs and updated some of the destructors to have try/catch blocks.
- base class destructors in .cpp - changed StandardTransient.cpp and MMgtTShared.cpp destructor methods to cast the passed instance to the base class instead of the Handle_ class
- checked that the OCC classes implemented the correct base classes
- updated some methods and constructors and added the const keyword

These changes caused the crashes to appear much later and in other methods (I've enabled debugging in the .cpp files) and it's now possible to draw many shapes:

I will continue investigating the reasons for the crashes and find a way to automate the manual changes I've done to the code over the past two days.

Friday, March 15, 2013

Update and new DLLs

Today I managed to build the NaroHost solution without errors, so now I have both new DLLs in the Debug version: NaroOccCore.dll is 887 KB and NaroCppCore.dll is 1,85 MB.
I've started testing Naro with these files (using the 3242 changeset) and it crashes after some shapes are drawn. I've tested Sketch creation and drawing circles, lines, rectangles and arcs. Next week I'll work on finding and fixing the cause of the crashes.

The last steps for making NaroOccCore.dll build were:
- improved the Generator to handle the string return type and convert it to Standard_CString and convert IntPtr to void*
- improved the IsHandle method to process other classes correctly
- fixed the .api template for empty constructors
- added handling for some strange cases in Open Cascade when setters and getters were returning different types

After generating the new .api file and running ApiWrappers for it, the generated files were correct and there were no errors, but when trying to build NaroHost again, using those files (to generate NaroOccWrappers.dll) there were several errors. The fixes for these were:
- commenting some variables in Extrema_FuncExtPS.hxx and Extrema_PCFOfEPCOfExtPC.hxx (they aren't used by the code, but we get 'error C2248: cannot access private member declared in class 'TColStd_SequenceOfReal'' if we build with them uncommented).
- adding the IsSameTransient method - this isn't part of the OpenCascade Standard package, so it isn't generated - I've added the code from source control, changeset 3242
- adding casts in 3 files where the proper overload couldn't be resolved

Friday, March 1, 2013

Xml file generation almost done

This week I improved the XML generation code (the resulting files are .api - the same as the old OccWrapper.api file) and the conversion program to:
* have better output for the templates
* convert types
* merge all generated files per package (will merge into one file eventually, but it's easier to check everything if they're split)
* add IsRef attributes
* parse methods and transform them into properties, with the corresponding XML attributes and children
* handle static methods and properties

With these changes, the NaroHost program doesn't need any changes - the .api file that it receives as input is correctly formatted and it can generate all the files as before. I've also created a little program that compares the files NaroHost generates using the old and new .api files (for now only the resulting .cs files) - since the new .api files cover all OpenCASCADE methods and classes, we have extra methods and new files and a regular line by line comparison wouldn't work. My tool splits the file in methods and DllImports and compares these, and for the .gp package, the results are good, with only two types of differences:
* the old code generated only getters or setters for some properties and the new one sometimes generates both. I will need to refine the code to cover these cases, as well
* empty Constructors were added when the old .xml file didn't have any parameterless constructors. If the new one adds constructors with no parameters, those aren't added anymore

The time needed run OCWrappersExt, the conversion program and NaroHost is under 10 minutes.

On Monday I will continue checking the .cpp and .h files and check the other packages.

Tuesday, February 26, 2013

Wrappers update

This week I continued working on the xml generating code and now all the methods, constructors and enums are translated to the format used in the api files. There were some extra packages needed to run aside from the ones specified on the website (will update the information there when I finish generating the wrappers, to make sure everything is ok). The command I used was:

-cppext -cppdir out -cdldir c:\OpenCASCADE6.3.0\ros\src\ Standard MMgt TCollection Quantity TColgp TColStd Message gp TopLoc GeomAbs Geom Bnd TShort TColQuantity SortTools Resource Aspect Viewer OSD MFT PlotMgt Image Graphic2d Xw WNT AlienImage Graphic3d Visual3d V2d V3d TopAbs TopoDS Geom2d StdFail math Adaptor2d Adaptor3d Geom2dAdaptor Precision GeomAdaptor BRepAdaptor CPnts GCPnts TopTools TopExp Intrv TopBas TopTrans TopCnx IntRes2d IntAna2d IntAna Intf IntImp IntSurf IntCurveSurface HLRAlgo MeshDS MeshShape MeshAlgo Poly Prs3d PrsMgr SelectBasics Select2D Select3D SelectMgr StdSelect DsgPrs AIS BRep LProp BRepLProp BRepTools Geom2dLProp GProp TColGeom2d PLib AdvApprox GeomLProp LProp3d AdvApp2Var FEmTool AppParCurves AppCont Approx AppDef BndLib Extrema gce GC GCE2d Convert Geom2dConvert TColGeom GeomConvert GeomLib GeomProjLib GeomTools Hermit ProjLib MeshVS CGM PS Prs2d AIS2D GGraphic2d BRepLib BRepBuilderAPI Primitives BRepPrim Sweep BRepSweep BRepPrimAPI IntImpParGen IntCurve Geom2dInt TopClass BRepClass CSLib BRepTopAdaptor IntStart IntWalk IntPatch BRepIntCurveSurface IntCurvesFace BRepClass3d TopOpeBRepTool TopOpeBRepDS TopOpeBRep TopOpeBRepBuild BOPTColStd BooleanOperations GeomAPI IntTools BOPTools BOP BRepAlgo BRepAlgoAPI Law Draft BRepOffset MAT GccInt Bisector AppBlend GeomFill MAT2d BRepMAT2d ElSLib Plate GeomPlate BRepFill BRepOffsetAPI Blend BlendFunc BRepBlend ChFi2d ChFiDS ChFi3d BRepFilletAPI ChFiKPart FilletSurf PStandard PMMgt DBC PCollection PColStd PTColStd TDF Storage CDM PCDM PDF MDF CDF TDocStd TNaming TDataStd AppStdL AppStd TPrsStd TFunction Dico MoniTool LibCtl Interface Transfer IFSelect XSControl StepBasic StepData StepGeom StepShape StepRepr StepVisual StepAP203 StepAP214 STEPConstruct TransferBRep STEPControl BRepMesh BRepExtrema BRepGProp ShapeExtend ShapeAnalysis BRepCheck

This added some new classes that we didn't have at all, many of them related to Step. The run time was not affected by the newly added packages.
There are 177 packages used by the old OccWrappers.api and 205 packages we need to parse in order to export the xml files for these. I wrote a LinqPAD program to check that all the required packages were exported and another program to concatenate the classes into one file for each package.

The next step is loading these partial files in the NaroHost solution and checking that the translation was done correctly. Aside from loading the xml files, it will transform the C++ types to the types used in C# and do the Setter/Getter transformation. After the check is finished, I will incorporate the test programs in the NaroHost solutions so that the checks and file merges are done automatically.

Friday, February 22, 2013

First version of the cdl-generated xml file

Here is the first version of the xml code I got from updating the cdl parser in OcWrappers (.api file on the left, generated code on the right):

The code was generated using .edl templates and the same code that is currently used to generate the .cpp and .h files, which means that changes are easy to make, propagate automatically to all classes and the new files can be obtained quickly. I've run the parser for all the packages, all classes and all methods in OpenCascade 6.3.0 and the files were generated in 1 minute and 30 seconds.

Next week I'll change the templates for constructors, destructors and properties and 'translate' the parameter types to the types used in C#. After these are done, I will check to make sure that the templates are correct for all classes used in Naro.

Wrapper update

Over the past week I worked on updating the wrapper generator that used to generate the OCWrappers.dll. In the current workflow the OpenCascade 6.3.0 files are parsed, generating full .h and .cpp files which are then compiled in the dll. This dll is used as a base for the NaroOccCore solution which generates an .api file used to load the needed classes and methods from the dll, extracts them and generates new .cpp and .cs files.

I'm working on improving the OCWrappers code so that the Open Cascade files are parsed and the .api file is generated directly from them, without having to compile the .dll and then use reflection to extract the information we need.

Monday, February 18, 2013

Wrapper enhancements for NaroCAD

Good news for the NaroCAD project users: we decided to allocate 4 weeks of development for wrapper work starting from today.
Beside enhancing the wrappers structure we'll work also at updating them to the latest OpenCascade version and improve the wrapper generator tools. By bringing the latest OpenCascade fixes into the project we plan to have many modelling issues fixed.

Another cool surprise will be announced soon...

Released NaroCAD 1.7.6 Beta

Today we released NaroCAD 1.7.6 Beta:
- Added the Three Points Rectangle
- Added the Perpendicular line Hinter and improved the existing Hinters
- Added coordinate increments for drawing and editing sketch shapes
- Fixed Copy/Paste for Boolean solids
- Fixed the Rotate Axis Tool for sketch shapes, solids and 3D shapes
- Fixed the Property Grid Translate
- Improved the Mirror Line, Mirror Point, Array Pattern and Circular Pattern tools
- Improved the Line tool to display the length during drawing
- Fixed the Measure Tool
- Improved TreeData, NaroSketchSolve and Action Tests

You can download it here

Wednesday, February 13, 2013

Updated tests

Today and yesterday I worked on improving the tests projects and cleaning up the code:
- removed the unused MetaAction classes and related tests
- updated the test methods that create regular shapes using clicks
- fixed the MetaAction tests (Sphere, Cone, Torus, Cylinder)
- reorganized the tests and fixed their names
- fixed a bug for the Three Point Rectangle
- replaced the setup code for the NaroSketchSolve tests - this allows us to correctly configure the ActionGraph and Document and run the Solver
- fixed a path bug that caused the NaroSketchSolve tests to crash
- removed some test methods that were duplicating existing tests

There are still some tests that need to be fixed, in the TreeData project, and we need to write more tests, as the tests we have now cover the creation of nodes and only a few of the possible cases.

The Tests projects status is:

Tomorrow I will fix a Hinter bug that is causing the Perpendicular hinter line to be wrongly displayed when working with 3D objects and continue fixing the tests.

Monday, February 11, 2013

Three Points Rectangle, Measure and Tests update

Today I added the Three Points Rectangle, which gives us more flexibility when drawing rectangles, as its sides don't have to be parallel to the axes. Here is a demonstration where three rectangles are drawn on the side of an extrude:

I also fixed the Measure tool and since it is applied only on Sketch shapes, I've moved it under the Dimension tool:

As you can see, the Dimension tool is used for lines, when we want the length to remain displayed, and the measure tool when we want to check the distance between any two points on the scene.

I also updated the tests, fixed some of them and added new methods for the Mirror Point and Mirror Line tests. There are 79 TreeDataTest, with 8 failures and 2 ignored tests:

Friday, February 8, 2013

Added Perpendicular Hinter for Lines

Today I modified the unused OrthogonalLineMatch so that we'd have Perpendicular hinter lines along with the other ones. These hints are displayed correctly for the default plane for now, because of the way the NodeHelper loads axes for processing:

You can find the changes here

Thursday, February 7, 2013

Coordinate increments and hinter improvements

Today I added a new feature for the GeometricSolverPipe which allows us to specify increments for the mouse coordinates - if defined, these 'force' the mouse pointer to jump to the closest multiple of the given value for each axis. It's possible to define these increments for any of the 3 axes and change them at any point to any positive value. The Hinter suggestions are not affected by this - all points are used, even if there are some whose coordinates are not multiples of the current increments:

Another improvement added today is the addition of the origin point to the Hinter geometry:

Wednesday, February 6, 2013

Line improvements and test updating

I started updating the TreeData tests yesterday, mostly the transformation related ones. They haven't been updated after we started using the Sketch concept, so there'll be a lot of changes for them.
Aside from that, I've modified the line tool to display the length while drawing:

Tuesday, February 5, 2013

Improvements for Rotate Axis

Today I submitted the changes for the Rotate Axis tool and it's now possible to rotate a sketch shape or a 3D object around a selected axis.
The rotation is performed on the points of the selected shape(s), which on the call to ExecuteFunction for the parent node causes it to be redrawn in the correct position. The only exception is the Circle node. Because it only has one point child, we also need to perform the rotation on the circle node. The center transformation is added to the circle transformation, causing the circle wire to be positioned wrongly, so we have to add a third transformation to return the wire to the correct position.

Here is a sample for Rotate Axis on sketch:

and Rotate Axis for an extruded circle:

Monday, February 4, 2013

Fix for Translate in Property grid

Today I fixed a bug in the Property Grid Translate, which applied the given translation only for the selected node's shape instead of all the dependencies, as it should have. Here is a short demo with the correct behaviour for sketch nodes and 3D nodes:

Friday, February 1, 2013

Released NaroCAD 1.7.5 Beta

Today we released NaroCAD 1.7.5 Beta:
- Fixed Copy/Paste for sketch shapes, 3D shapes and solids
- Improved the Mirror Point and Mirror Line tools
- Improved the Array Pattern and Circular Pattern tools
- Improved Revolve to work on the entire sketch face
- Fixed Translate, Undo and Redo for solids

You can download it here

The main feature of this release is the new Paste algorithm, which processes the nodes according to their type and creates copies for all dependencies and related shapes. This allows us to create independent copies of sketch shapes, solids and complex 3D shapes which can be edited and modified separately. This new method is used for the Paste operation and for Mirror Point, Mirror Line, Array Pattern and Circular Pattern and all shapes created by these tools can be modified independently.

Wednesday, January 30, 2013

Fixes for Mirror Point and Mirror Line

Today I commited the changes for the Mirror Point and Mirror Line action. The new version of the tools creates new copies of the selected nodes, with a mirror transformation. Here is an example with Mirror Point and Mirror Line applied to two ellipses:

I've also added the methods to create the new nodes in Boo scripts:

The changes are here

Tuesday, January 29, 2013

Copy/Paste update

The past two days I worked on updating the Copy/Paste code. Before the Sketch was used, the Copy/Paste method simply copied the selected node and pasted it, but now we need to create the entire sub-tree for the selected node.

For sketch shapes, we create new nodes for the selected shape and all its children, with all points referencing the sketch containing the copied node.
For 3D shapes, we need to copy all the sketches referenced by the 3D shapes and all their nodes, updating the points' sketch references accordingly. For example, for a Cut Through All applied on an extruded circle we need to copy the two sketches used for extrude and then cut:

Friday, January 25, 2013

Improvements for revolve

Today I improved the Revolve tool: if the selected shape is part of a sketch with a valid face, the entire sketch is revolved around the selected axis. Here is the new version of the tool applied to the result of an array pattern:

If there is no valid face, the selected wire is revolved, as before.
I've also updated the Boo script function for revolve:

Copy/paste and Array Pattern update

The Copy/Paste functionality for sketch shapes was updated and instead of referencing the original shapes, it now creates copies of each node, allowing us to edit the new instance separately. Since the pattern tools use the Copy/Paste method internally, they also create new shapes, and I've updated the transformation code to ensure that the new shapes are positioned correctly:

Thursday, January 24, 2013

Fix for Copy/Paste on Sketch

Today I changed the Copy/Paste functionality for Sketch shapes and now new nodes are created for the child nodes and are referenced by the pasted node:

Tomorrow I will update the Array Pattern and Circular Pattern tools so that the new point coordinates are calculated correctly.

Wednesday, January 23, 2013

Test shapes and copy/paste

Today I tested some of the recently implemented features and created some more complex shapes by drawing and running Boo scripts:

Now I'm working on fixing the Copy/Paste code, which currently creates a new node which references the children of the source node, making the newly pasted shape identical to the original one and unusable. The pattern tools have a similar behaviour, creating only new wires which reference the same base Points. This restricts the changes that can be performed on the newly created nodes:

Tuesday, January 22, 2013

Solids improvements

Today I tested the array pattern for the 5 types of solids that can be created in NaroCAD (sphere, torus, cylinder, box and cone) and fixed some problems with translate, undo and redo. Here is a short video with these:

Monday, January 21, 2013

Array pattern improvements

Today I started working on the Array pattern tool and fixed the bugs that caused shapes to disappear after the Array pattern was applied and added the ability to create array patterns in Boo scripts.

Here is an example where the Array pattern tool is applied for a cut solid:

and a screenshot of a shape in which the sketch obtained by using Array pattern is used to cut through an extruded rectangle (the Boo script is visible on the left side):

Friday, January 18, 2013

Released NaroCAD 1.7.4 Beta

Today we released NaroCAD 1.7.4 Beta:
- Improved the Solver parameter loading and processing speed
- Fixed undo/redo for translated solids
- Fixed translate for complex shapes
- Fixed Extrude mid plane
- Improved Cut through all and Cut to depth
- Improved TreeView selection highlight

You can download NaroCAD 1.7.4 here.

Here are some sample parts created using this version of NaroCAD (both drawing and using Boo scripts):

For the next release we will:
- Fix the Array pattern tool
- Fix the Circular pattern tool
- Fix the Translate Tool
- Improve the Copy/Paste functionality

Thursday, January 17, 2013

Translating after cut through more than one solid

Today I did some more testing and updated the translate method to improve translation of a cut solid resulted by performing cut through all for more than one solid:

Wednesday, January 16, 2013

Changes for undo/redo and translate

Today I finished the changes for undo/redo and fixed an issue that caused sketch faces to appear after a translate undo. The problem was caused by the MakeFace function, which in some cases created an incomplete Face node in the Document Tree. You can find the most recent code changes here.

Below you can see Translate, Undo and Redo performed on a solid obtained using Cut to Depth and Cut through all. One of the sketches is then edited and the changes are correctly reflected in the cut solid:

Tuesday, January 15, 2013

Cut, extrude and undo/redo fixes

Today I fixed the extrude mid plane bug which didn't allow us to change the extrusion type to Mid-plane for more complex shapes:

I've also improved undo/redo for solids affected by a cut operation:

and fixed cut and undo/redo for solids obtained from boolean operations. Here is an example where fuse, extrude and cut are applied to form a complex object:

Monday, January 14, 2013

Solver changes and undo/redo

Today I commited the changes for the Solver:
- fixed circle parameters loading order
- improved solutions for under constrained sketches by first applying the DFP Solver
- improved the processing speed by raising the number of free points for the first iteration
- added the positive parameter soft constraint for circle radius
- improved the solver call for changes in the Point3D and Circle property tabs

After these changes, it's possible to solve more complex sketches that have length constraints and point to edge constraints for all points.

I've also started improving the undo/redo functionality for 3D shapes affected by a translate:

Tuesday, January 8, 2013

Improvements for the Solver

For the past days I worked on improving the Solver:
- fixed the circle parameters loading bug: the circle parameters were loaded first, regardless of the circle's position in the shape list.
- added code to make sure that the circle's center is always loaded before the circle in the shape list (since both of the reference the same index in the shape to parameter index list)
- added a new constraint which forces a value to always be positive. This constraint is currently used to ensure that circle radiuses computed by the Solver (when the radius isn't locked by the user to a specific value) remain positive
- updated the soft constraints function to only add the positive radius soft constraint
- improved the Solver calling for circle tab changes

There is a bug which causes the Solver to sometimes miss the solution for more complicated shapes (possibly because it doesn't select a correct estimation for the first step if the new position is too distant from the original position). This is what I'll be working on next, as well as adding unit tests for the shape list creation method in DocumentToSolverAdapter.