.NET CAD Kernel

Technical discussions
Post Reply
nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

.NET CAD Kernel

Post by nickz »

Hello all
This post is related to viewtopic.php?f=2&t=2988

A natural question appears in this regard: Why not rewrite entire KernelCAD as a .NET component? It would make the whole software self contained and will be
a more secure pure .NET component for the developer’s application.

Despite the fact that this is what some of our colleagues are doing I am positive this would be a bad idea. Do not get me wrong. I love C#. It has limitations though and
it has its target audience. CAD kernel software is one of the main types of software which should NOT be written in .NET.

.NET is an end user framework. It makes everything simple, fool proof, high level, productive for the developer. There are costs though. The main one is
performance. There are lots of redundant checks and runtime processing going on under the hood in .NET, starting with the fact that it is only partially
compiled. So it is a half scripting language.

This is particularly important and sometimes critical in CAD applications. Heavy geometric computations with huge sets of data appear in CAD all the time.
Surprisingly, multithreading does not significantly help with that. I hope to write about that in another post.

Another one is memory consumption. Although memory is plentiful these days, this still has an effect. Modern 3D scanners produce very fine meshes and
whatever memory is available is consumed very quickly.

New faster computers and huge amount of memory definitely help, but, again these resources are very quickly consumed by developers doing work which
was not possible before. And it still is not enough. Imagine that an average new computer cannot load a complete model of a small house with all the details.
Simplifications are always necessary. A full model of even modest precision would be terabytes in size.

So, even with a pure .NET control interface for developers, we intend to keep the core of KernelCAD as C++ components. Another reason is that, no matter how
much a company can do - there are lots of very useful components to be consumed. They are all C++ dlls because it is the industry standard.

It looks like our friends are rewriting OpenCascade in .NET. It is not where we want to go. Legal issues aside, Open Cascade works fine as it is. It is being
actively developed. Rewriting would create a huge number of bugs. Some issues are pretty subtle, precision-sensitive, etc.

Post Reply