Friday, October 27, 2006

Use Runas in Windows XP for increased security

Summary: Windows Administrators logged in as regular users needing to perform occasional administrative tasks can use Runas built into Windows XP. This post tells you how to manage files and folders in Windows Explorer using Runas.exe as Administrator while logged in as regular user.

I know, I know this post has nothing to do with Open Source or CAD, but in my defense I used this solution while fixing the problem in my previous post with 3ds Max. Runas is what I use since I am normally logged into my Samba domain as regular Domain user but still need to perform administration tasks. We all know that logging in to Windows as administrator causes the most problems - so I avoid it.

To test whether the changes I made to 3ds Max folders (license = "C:\C_Dilla\" and program folders = "C:\Program Files\3dsmax42\") solved the problem I was required to log in as Administrator, make changes, log off, log in as regular user, test 3ds Max - rinse and repeat as required numerous times.

Well with this simpler (compared to multiple log offs and log ins) process I was able to avoid that problem. Thanks to Microsoft Windows XP - Runas.

1. Log in as regular user.
2. Start Task Manager using Ctrl + Shift + Esc.
3. Find explorer.exe in Processes tab. Click on "End Process".
4. Go to Applications tab. Click "New task".
5. Enter "runas /user:administrator explorer.exe" without the quotes.

(Click image to enlarge)

6. Enter administrator password.
7. Voila. Windows Explorers start in administrator mode including the desktop and taskbar.
8. Once you are done playing with Windows Explorer and want your regular user's explorer, close the Task manager that you had opened in step 2.
9. Once again open Task Manager using Ctrl + Shift + Esc. This is to ensure that the Task Manager that opens up is running as administrator and not as regular user that opened up in step 2.
10. Find explorer.exe in Processes tab. Click on "End Process".
11. Go to Applications tab. Click "New task".
12. Enter "runas /user:[regular user] explorer.exe" without the quotes. Make sure you replace [regular user] with the username you are logged in as and know the password of.
13. Enter regular user's password. And Windows Explorer, desktop and taskbar will start as the regular user.

This process can get irritating after a while - especially if you have to enter the password numerous times. Try the following to save password (as long as your administrator password and your regular user password does not change).

runas /user:[regular user] /savecred explorer.exe

If the above does not work or you need more help leave me a comment. I will be more than happy to help.

Run 3ds Max as regular user

Summary: Running 3ds Max 4 as regular user causes problems but as administrator it works fine. The following is my solution.

In my lab we are still running 3ds Max 4, which at time of post is 5 versions too old. But one problem that was nagging us (till date), and were never able to solve, was that 3DS would run fine as administrator but on a regular user account it would never startup and throw a [16.1.7] error. A quick Google search will pull the following solution from Autodesk's website. The basic solution to the problem is stated as follows:

  1. Find folder "C:\C_Dilla". Make sure Hidden folders are visible. You can change this in Windows Explorer-> Tools -> Folder Options. The Autodesk page has the required screenshots for this.
  2. Give your Users account Full Control to the "C:\C_Dilla" folder and sub-folders.
This definitely fixes the problem while starting 3ds Max. But we were still having major problems while closing 3ds for which I suggest following solution. It turns out that 3ds Max needs to write to the location where it was installed and some sub-folders [UI sub-folder in "\Program Files\3dsmax42\" to be precise].

[Disclaimer: This solution is actually a crappy workaround that shows how poorly some applications are developed in a manner that reduces security on a Windows PC].
  1. Log in as Administrator to your Windows PC.
  2. Open Windows Explorer.
  3. Scroll down to your Program Files folder [most probably "C:\Program Files\" or "D:\Program Files\"] and expand it.
  4. Find the "3dsmax42" folder. [Providing access only to the UI sub-folder was not sufficient. Don't know why.]
  5. Right click on it and select Properties. Click on the Security tab.
  6. Select the Users group and give Full Access to this group [and weep a little].
  7. Log off and log on as regular user. Start 3ds Max and watch it open and close like it is supposed to.
I don't have access to the latest 3ds Max and don't know if they have fixed this problem. If yes then do let me know. And more importantly if this does not work for you then please leave me a comment and I will look into it.

Thursday, October 12, 2006

Part 2 (Constructive Solid Geometry) - Open Source Software in Mechanical Computer-Aided Design/Drafting

Welcome back to the 2nd part of my review of open source software in mechanical computer-aided design/drafting. In this post I will identify open source (OS) constructive solid geometry projects (CSG). Keep in mind that when I talk about CSG I will focus on projects specific to Mechanical CAD (MCAD) solid modeling. If you are interested in knowing what I mean by those terms visit Wikipedia (Computer-aided design, Solid Modeling, Constructive Solid Geometry). This means that I will not go into details about Povray, even though it is a CSG tool it is not often used for Solid Modeling. If I am mistaken please correct me by dropping me a comment.

Open CASCADE (http://www.opencascade.org)

Open CASCADE is probably the most well known of all OS CSG projects. It also seems the most mature in terms of age of project, documentation and scale of use.


Open CASCADE Technology (3D modeling and simulation software)

Open CASCADE is primarily a set of libraries (or components) that allow others to build CAD/CAE Computer-aided Engineering) systems. To download Open Cascade go to the download center to select the right package for your operating system. Fortunately Open Cascade is multi-platform and available for Windows, Linux and Solaris. I chose the current version (at the time of this post current version was 6.1) for Windows as that is my main development platform. You download a self-extracting executable. Execute the downloaded file and extract the contents to a temporary folder and as Administrator execute "install.bat" in that temporary folder.

Upon install you see the following menus in your Windows Start menu.

Open Cascade Menus in Windows

If you need support for custom development you can purchase support from the commercial wing Open Cascade S.A.S.

But keep in mind that Open Cascade is a development platform i.e. no system exists for use by modelers. Modelers who need a CAD system depend on freely available software such as FreeCAD hosted on sourceforge.net that are based on Open Cascade. A list of all such projects is available from Open CASCADE's Project page. I will delve into developing applications using Open Cascade in another post. The current series is focused towards Modelers and not developers.

FreeCAD (http://free-cad.sf.net/)

Since I was looking for as complete an OS solid modeling tool as possible, I decided to give FreeCAD a try. The description for this software on sourceFORGE states:

"FreeCAD is an OpenSource CAD/CAE, based on OpenCasCade, QT and Python. It features some key concepts like Macro recording, Workbenches, ability to run as a server and dynamicly lodabel Application extensions and its designed to be platform independend (sic)"

I downloaded the Windows version of FreeCAD from sf.net available in MSI format and installed it. On starting the GUI version you can see the following menus in your Start menu:

FreeCAD Menus in Windows Start Menu

After playing with FreeCAD for about a half an hour trying to read the User Manuals and trying to find and help files I finally gave up. Upon program startup there are very few options available to the user. But FreeCAD does allow users to import BREP, STEP and IGES files.

FreeCAD window

FreeCAD is still in development (current version is 0.5) and does not do much yet in terms of solid modeling. In many ways it offers a platform for others to develop solid modeling capabilities. While this is quite useful, modelers would not be able to use this program just yet. From reading the User Manual that was provided with FreeCAD it implied that the goal is a Feature-based parametric modeler providing numerous workbenches such as Sketcher, Part Design, Surface Design, Assembly and 2D drawing extraction. These are commonly observed functionalities that one would expect from a solid modeling tool but I was unable to find any of these workbenches in FreeCAD. I guess that this is the goal that FreeCAD hopes to achieve.

So as far as FreeCAD is concerned: - the short answer to the question - "is it a useful solid modeling tool?" - is - "check back later!"

BRL-CAD (http://brlcad.org)

The U.S. Army Ballistic Research Laboratory (BRL) developed BRL-CAD in 1979 and in its current state is claimed to be a powerful CSG modeling package. BRL-CAD is also hosted on sourceFORGE and can be found at this link. The project's description on sourceFORGE is:

"BRL-CAD is a powerful cross-platform constructive solid geometry solid modeling system that includes an interactive geometry editor, ray-tracing for rendering & geometric analyses, network distributed framebuffer support, image & signal-processing tools."

The project's home page is at http://brlcad.org and is a good site for an overview of BRL-CAD, introduction and application development information. Just keep in mind that most documents available on http://brlcad.org are in PDF format.

Once again I downloaded the Windows version (which at the time of this post was version 7.8.0). It comes in a zip format which needs to be extracted. Once extracted just double click on setup.exe as Administrator to install BRL-CAD. On install you will find the following menus in Windows Start menu.

BRL-CAD menu in Windows Start menu

On starting MGED (Multiple-Device Geometry Editor) which is BRL-CAD's graphics editor you are presented with two windows - a command window and a graphics window.

BRL-CAD command and graphics windows

BRL-CAD is unlike any commercial solid modeling tool I have used. First there are no workbenches to speak of. There isn't a sketcher tool nor are there any tools to create your regular features such as extrusions, cuts or holes etc. BRL-CAD does allow you to create some standard pre-defined shapes but I found little use for that. And for being a CSG tool the default view is wireframe. BRL-CAD does offer a Raytracing tool that shows you what the solid model would look like but you cannot edit the objects in that mode. Overall I found BRL-CAD rather lacking in features that I am accustomed to and would not use this as my CAD system, but I must say that it has a lot more features than FreeCAD.

BRL-CAD is also extensible and you can find information on the following page regarding developing BRL-CAD applications.

If you are interested in learning more about BRL-CAD then there are some Tutorials (in PDF) format available for download from the Military site:
  1. BRL-CAD Tutorial Series: Volume I - Overview and Installation
Conclusion

From this brief survey all I can tell is that if modelers are looking for off-the-shelf open source solid modeling (CSG) CAD systems then they will be disappointed. I will continue my hunt for a full-featured solid modeling tool and will continue this series if I have any luck. For now modelers have no option but to use commercial CAD systems.

Next post in this series will detail my survey of OS 2D drafting tools.

Wednesday, October 11, 2006

Open Source Software in Mechanical Computer-Aided Design/Drafting - Part 1 (precursor)

This post is sort of a pre-cursor to what I hope to delve into with this blog i.e. try to identify the state of the art/research of Open Source Software (OSS) in Mechanical Computer-Aided Design (MCAD), Product Data Management (PDM) and Product Lifecycle Management (PLM).

While open source software has had its fair share of success in numerous technology domains e.g. operating system kernels (Linux), operating systems ( Debian, Red Hat), web browsing ( Mozilla Firefox), databases (MySQL), middleware ( JBoss) and others, there is not much we hear about open source in the domain of manufacturing e.g . computer-aided design or product data management. I believe this is primarily due to the following reasons:

  1. Firstly the end users of CAD software are not usually programmers. This means that unlike the other popular open source projects the end users of CAD will not contribute code back to the open source software they are using.
  2. Secondly programmers rarely delve into the domain of CAD (of course this is when compared to the number of programmers in the other OSS projects)
  3. Thirdly (and I believe the most important) most CAD companies such as PTC, Dassault , UGS and Autodesk rarely foster an open attitude or community for their products. These companies build strictly proprietary software providing little in terms of interoperability between each other. Sound familiar? Companies such as Microsoft have been accused of this kind of behavior for decades. But CAD companies, while not as big as Microsoft, will not have such accusations hurled at them and one reason is that there is no clear Monopolist.
So where does this leave open source projects? Well that is what I intend to find out - what kind of support can open source projects give to the users when dealing with MCAD?

Well it turns out from scouring the web that the idea of using open source software for CAD design is quite common but most leads do not end well. While open source software has some great advantages over its proprietary counterparts in other domains, when it comes to CAD, proprietary software has little competition from open source counterparts.

With the next few posts I will try and identify some successful open source CAD projects in addition to some of the not so successful. You may also find some free MCAD software mentioned here even though they are not truly open source. I do not intend this to be a comprehensive list as I but one individual. If I have missed an important open source CAD project do let me know and I will review and include it.

I invite any comments you may have as it would help improve the quality of future posts.

Sunday, October 01, 2006

In sync with UNISON

Unison is an amazing backup tool that is fortunately available on both Windows and Linux. Since it is open source it is available readily on various Linux distros (e.g. on Unison on Debian) so that you can just perform an "apt-get install unison" for Debian and have it running and accessible from computers in your network for example. But getting it work seamlessly on Windows is a little more work.

Fortunately there is an alternative (not to Unison) but to actually deploying it on Windows. This alternative comes from Cygwin which sets up a Linux-like environment for Windows (that last part was from the Cygwin website). Cygwin includes unison as part of its package and by installing Unison with Cygwin you can setup your Windows box as an SSH server with Unison so that you can backup files to this Windows box from anywhere with an internet connection.

To make sure you install Unison while installing Cygwin make sure that on the "Select Packages" window click on "View" button (on top right corner) once till the text next to the button says "Full". Scroll down till you see unison2.9.1 in the "Package" column. Then click in the second column from the left once so that the latest version shows up instead of "Skip" (at the time of writing this blog the version was 2.9.1-3). If you want to access Unison from over a network then make sure you install "openssh". The steps to install "openssh" with Cygwin is available here. And for good security make sure you setup SSH Keys using either this method or this method. I will try and add more details to the steps in future blogs. If you need help then post a comment and I will respond.