DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Large drawing adventures

Started by Dr PR, December 08, 2014, 01:55:08 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Dr PR

I have been experimenting with very large drawings in V23.1 and V24.1 beta. The attached image is from a 286,802 Kbyte file, created with "Save Image File."

I was successful at generating images from the file twice before closing the program. It took over an hour to shade with Gouraud shading. After I restarted the computer and loaded this file back into DesignCAD it went into an endless redraw loop in wireframe mode, never finishing drawing everything before restarting the wireframe draw. ESCape does stop the endless redraw.

I tried shading with Gouraud and after about 75 minutes I got an "Out of Memory" error.

The file is corrupted - it fails to load in V23 and does strange things in V22. It does load OK in V15.3.

Fortunately, I do have backups.

****

Using Task Manager I recorded "Private Working Set" memory use by DesignCAD (with no other applications running).

DesignCAD without a drawing loaded:         13,912K
DC with the 286 Mbyte drawing loaded:    755,804K
DC + drawing + Gouraud shading:          1,088,564K ( after "out of memory" error message).

Note: 2^30 = 1,073,741,824

Entities:                        862,393
Points:                       6,433,165
Grid surface entities:    463,560
Planes:                         398,466

****

The file was modified from an earlier 283,924K file.

Entities:                        855,602
Points:                       6,375,306
Grid surface entities:    461,464
Planes:                         392,965

This file loads and shades OK.

****

So the maximum file size for the 32 bit V23 DesignCAD is between 283 Mbytes and 286 Mbytes, or about 860K entities.

When the file loads it uses about 2.5 times the original file size of memory. Note: this is not the .bak file which is often 2X the .dcd file size.

When the file is shaded the amount of memory used by DesignCAD increases to >3.8 the original file size.

The 32 bit program can address only 2^30 bytes of RAM (one gigabyte), no matter how much RAM you have in your machine (I have 32 Gbytes and most of it is unused).

Phil
DesignCAD user since 1987


Dempsey

Phil, I admire your patience to wait for over an hour and being "rewarded" with a failure. I typically hit the ESC key after 1 minute or so.

This only underlines why getting RedSDK bug-free is so very important so that a leap towards 64-bit DesignCAD can be made eventually/hopefully.
Dempsey

Dr PR

#3
Dempsey,

I couldn't agree with you more! I will gladly help debug a 64 bit version, and celebrate when it is a reality!

However, I realize that few people will create 200 Mbyte drawings, so the need for a 64 bit version doesn't lie there.  But RedSDK is a memory hog - it has to be, with all of the advanced graphics it is capable of. DesignCAD's rather antiquated Gouraud shading uses large amounts of memory. RedSDK's ray tracing, shading, reflections and other advanced graphics capabilities will necessarily need more.

Right now I think the largest drawing DesignCAD can handle with a crude shaded RedSDK image is about 50-60 Mbytes (but with that RedSDK rendered image DesignCAD is fast!). That's about what a detailed house drawing would be. For anything larger a 64 bit recompilation will be needed. For high quality images RedSDK is going to need a lot more RAM!

Phil

PS: By the way, V15.3 did succeed in generating a Gouraud image from the file that kills V23 and V24. I saved the file in V15 format. Now I'll see if V23 will work with it. To be continued ...
DesignCAD user since 1987

Dr PR

#4
After I saved the 286 Mbyte file from V15.3 it was only 202 Mbytes!

It loaded into V23.1 but the program went into redraw spasms. Parts of it won't display in wireframe mode. If I press ESCape the redraws stop.

Then if I open the Layers Dialog, disable a layer that hasn't been showing, and then re-enable it, that part of the drawing is displayed. But then when I close the Layers Dialog the program goes into redraw spasms again and that layer is no longer displayed.

In fact, neither V23.1 or V24.0 or V24.1 will open it - they all go into spasms.

****

V22.0 does open the original file. All layers display correctly.

In about an hour I may know if it will shade the drawing correctly.

To be continued ...

No luck. At about 62 minutes the program began display spasms. The menus and toolbars disappeared and the main window was blank (only the one window open). I pressed ESCape to stop the redraws and the menus/toolbars reappeared. The main window was still blank.

I used "Fit to Window" and after a few seconds a Gouraud shaded image appeared! However, the view toolbar is mostly blank with only the numbers showing. Eventually this came back.

Can't save an image file. When the file save dialog opens all of the folder icons are just black squares. I can enter a file name, but when I click "Save" nothing happens.

Task Manager says Dcad22.exe is using 1,108,080 Kbytes of RAM - maxed out.

****

So, the question is how did I ever manage to shade the original file and save two different image files initially?

I have seen this before, back in 2009 when I made the first whole ship model images of the crude, original low detail parts (about 275 Mbytes). After saving several image files and shutting down, I was never able to open the file and work with it again.

Apparently you can build up a file from smaller parts using Copy/Paste from other drawings until it reaches some threshold size and then work with it. But if you save it you can't open it and work with it again.

Odd.

Phil
DesignCAD user since 1987

Dr PR

#5
Ha!

I finally succeeded in getting the image I needed.

I opened the original 286 Mbyte file in V22.0 and deleted the layer with the missile launcher on it - I was trying to generate images with this layer disabled.

I saved the smaller file (255,415 Kbytes)  and closed DesignCAD.

I restarted the program, loaded the file and shaded it with Gouraud shading - that took about an hour. As before, the program became squirrely, menus and tool bars disappeared, etc. But when I pressed ESCape the menus and toolbars came back - but the screen was blank. I couldn't get a shaded image on the screen, only a blank window.

I switched to Wireframe and the full drawing reappeared. Then I used "Save Image File" to get an image - with "old" shadows - and it worked!

I selected "Use New Shadows" and tried again, and got a message "Not enough memory for image map" (I don't remember the exact wording).

I tried again, this time dragging a tight selection box around the elements of the drawing to select the image. It worked! Making the image just a slight bit smaller allowed it to work in the available memory!

So it took only two days and a dozen or so attempts to finally get this picture.

Phil
DesignCAD user since 1987

Dr PR

Here is a little more information about DesignCAD.

First I turn on the computer (Win 7 Pro 64) and then open Task Manager. Then when I open different versions of DesignCAD with a blank file I can see how much RAM each uses:

V15.3    8,880K
V22.0  29,188K
V22.1  28,868K
V23.1  32,808K
V24.0  36,120K
V24.1  32,760K

I guess this is why I could work with the 286 Mbyte file in V22 but not in V24 - the program is 3-6 Mbytes smaller and that freed up enough RAM to allow the images to be generated.

If I open V23.1, shut it down, and open V22.0 Task Manager reports 44,932K RAM use. So there is some residual RAM use that isn't freed up when V23.1 closes. So, after editing the file to satisfaction in Wireframe view I need to shut everything down and restart. Then I can do shading with the maximum remaining workspace.

However, every time I save the file the amount of RAM used goes up about 2 Mbytes - even if the file size hasn't changed. So I don't do any editing or file saves while I am generating images. Even so, the amount of RAM used keeps creeping up and after a while the program gets flaky or just stops working all together.

The number and size of windows open also influences the amount of RAM used. With the standard "DesignCAD Tile" four windows V23.1 uses 32,808K, but with the three small windows closed and the main window maximized it uses 34,700K.

Also, you have to wait a minute or two after DesignCAD opens to see the total RAM use. For the first minute or so the amount of RAM increases in steps.

****

After loading a large file the program uses an additional amount of RAM equal to about 2.5 times the disk file size.

Then after rendering with Gouraud the amount of RAM used increases about 1.5 times.

So, to shade a drawing you must have about 3.75 times as much unused RAM in DesignCAD's 1 Gbyte work space as the file size on disk.

With V24.0 using 36.12 Mbytes for the program, the remaining buffer size is about 1,073,705.7 Mbytes. Divide that by 3.75 and you get 286.322 Mbytes.

And the file I was having trouble with in V24.1 was 286.802 Mbytes, or 480 Kbytes too large.

But with V22.1 I had an extra 3.4 Mbytes to spare!

So, as a rule of thumb, with the 32 bit versions of DesignCAD - with RedSDk disabled - the largest file you can safely work with is about 285 Mbytes.

Phil
DesignCAD user since 1987

DrollTroll

At the very least, versions 7 and later for Windows were compiled in Visual C++. One or more of the early DOS versions may have been in TurboPascal though, and the later ones were in some variant of C (don't recall exactly which one).

25 years with DesignCAD

Dr PR

I have one other discovery - the display spasms (repeated incomplete redraws) don't happen in V22.1 if I enable "Off screen bitmap" in the Options Dialog. I haven't tried it in the other versions.

****

If I recall correctly the original Prodesign was written in Pascal (about 1986). Pascal was the darling "language to replace all other languages" in the 1980s. It replaced FORTRAN (1960s), which had been the ultimate language to replace all other languages.

Pascal was object oriented and interpreted, not compiled. DesignCAD was pretty slow, especially as more features were added. Then we were told it was completely rewritten in assembly language (about 1989). The resulting version was lightning fast! I don't know if this was just before or just after the change to DesignCAD.

That was all in DOS days. I'm sure it was necessary to program in C for Windows since so many of the libraries were in C.

Of course, C was the language to replace all other languages in the 1990s. Then along came C++, an object oriented version of C. It has survived for a couple of decades.

Phil
DesignCAD user since 1987