Author Topic: Another Lovely DC3 idiosyncrasy...  (Read 253 times)

BlankMan

  • Jr. Member
  • **
  • Posts: 54
Re: Another Lovely DC3 idiosyncrasy...
« Reply #15 on: May 15, 2019, 07:31:46 AM »
Thanks Lar, I'll give it a try.

I'm not real up on t DC3's internals so I have a question. As I've said I draw by subtraction. I create one big block usually with the "Box" command and then whittle away at it by drawing other overlapping boxes and cylinders and cones and extruded objects and swept objects etc. and subtracting them from the original box to get to the final shape.

So, in that case would I only have one entity? The original block I started with in what ever form it currently is in?
Newbie? Not.
Been using DesignCAD 3D since ~1990
Still have version 4 floppies from 1992...

BlankMan

  • Jr. Member
  • **
  • Posts: 54
Re: Another Lovely DC3 idiosyncrasy...
« Reply #16 on: May 15, 2019, 08:18:11 AM »
Lar, I get an error when I click on Yes and select an object, see the attached screenshot. There are 4 pieces in the drawing, none overlap but all touch. I included the exploded view too.
Newbie? Not.
Been using DesignCAD 3D since ~1990
Still have version 4 floppies from 1992...

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Another Lovely DC3 idiosyncrasy...
« Reply #17 on: May 15, 2019, 09:07:07 AM »

Okay,there's a 8) that's supposed to go between the yal\ and the =1 at the end of that line of code.


I fixed in the code in the post and tested the macro and it worked for me, so re-copy and re-paste the whole code from my post and give it another go.


Like I said in that post, this forum usually skips out stuff when you paste things in, or adds crazy text when I publish a post, so anything who know what gonna happen.


Lar

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Another Lovely DC3 idiosyncrasy...
« Reply #18 on: May 15, 2019, 09:10:10 AM »
Sorry, no
Okay,there's a 8) that's supposed to go between the yal\ and the =1 at the end of that line of code.

Sorry, not a 8) but an eight and a close bracket, that's apparently forum code for Mr Kool Smiley;D ;D ;D 8)


Lar
« Last Edit: May 15, 2019, 09:23:30 AM by Lar »

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Another Lovely DC3 idiosyncrasy...
« Reply #19 on: May 15, 2019, 09:20:46 AM »
So, in that case would I only have one entity? The original block I started with in what ever form it currently is in?

No, you will end up with a number of Planes, which will together form a closed shape and be defined as a Solid. Even the box you started with consists of 3 entities: 2 Planes and a Grid Surface (and to complicate things more, the Grid Surface consists of s Grid Header and a number of Lines).


If you Solid Explode the shape you can individually select each of the Planes. To make them back into a Solid just select them all together and Solid Define (but if you edited any of the points of any of the Planes make sure there are no gaps between Planes).


Lar

Dr PR

  • Hero Member
  • *****
  • Posts: 5682
Re: Another Lovely DC3 idiosyncrasy...
« Reply #20 on: May 15, 2019, 09:23:31 AM »
BM,

Cutting parts away from a "work piece" with different "tool pieces" (like working with a lathe or milling machine) is the best way to create complex solids. You get the minimum number of "leaks" in the resulting solids. You should have only one object remaining after each "Solid Subtract" operation.

You said you "draw them all at once." What does that mean? Are you creating multiple objects with a single macro?

****

There is a limit to the number of facets an object can have. Somewhere on the Forum is a post describing these limits.

A simple box is made up of one grid with four facets and two planes. You can see this by creating a box and using "Solid Explode." A sphere can have many thousands of facets, depending upon the number of longitudinal and latitudinal facets. If you subtract a sphere from a box the remaining nibbled box can have a large number of facets.

If you cut a grid with another grid with "Solid Subtract" lots of little facet fragments are created. It is very easy to exceed the maximum allowable number of facets.

****

One trick I have learned for "Solid Subtract" where I want to create a lot of holes or cuts in a work solid is to create all of the "tool" solids, select them and use "Solid Define" to make them all one solid - they do not need to overlap for this to work. Then I subtract the combined tool pieces from the work solid in one operation.

I discovered a long time ago that there is a limit to the number of "Solid Subtract" operations that I can perform in a row. So if I want to drill a lot of holes in a work solid, and do them one at a time, the subtractions stop working before I am finished. But if I combine all of the tools into one solid the probability of the operation completing is much higher.

****

Often I run into a limit of some sort when trying to create a very complex solid - too many cuts on a single work piece creating too many facets. In that case I create several separate parts of the final solid and whittle away on them until each is complete. Then I combine all the parts into one new complete solid. So far this has always worked.*

The simple way is to use "Solid Define" - this always seems to work. If you are braver you can try "Solid Add" but I have a lot of problems with this.

****

"Solid Subtract" and "Solid Define" can produce overlapping facets, fragmented surfaces and internal surfaces. There is a very simple way to repair these faults. Create a new solid (box) somewhere distant from the work solid. Then subtract the box from the work solid.

There is nothing to subtract, but this causes DesignCAD to "inspect" every detail of the work solid and overlapping facets, internal facets and fragmented facets are magically repaired!

I do this after using "Solid Define" to combine multiple solids into one new solid just to be sure the new solid is "clean."

It doesn't hurt to do this occasionally just to be sure that your work piece isn't accumulating hidden faults.

****

When the solid you are working on "disappears" have you tried enabling all layers to see if it has moved to a hidden layer for some reason? A VERY common problem with "Solid Subtract" is that some facets of grids are moved to the Layer 0 (zero). In some cases I thought I found wayward facets in high number layers, but this is rare if it happens.

I have been seeing this problems for maybe 20 years now - since 3D was added to DesignCAD in the '90s. I have never been able to figure out why it happens.

I always keep Layer 0 empty, and check to see if the Layers dialog shows it to be occupied. That is a sure sign that one of my solids is fragmented between layers.

If a facet is moved to layer zero it always seems to be converted to the "Aluminum" material (material 0) with a black color (RGB = 000). If you shade the solid you will see black facets.

If just one facet ends up on a locked layer you can no longer select the solid to edit it. This will cause your macros to fail.

The solution is to enable all layers, select the solid, move it to the desired layer, and assign the desired material and color.

****

Create really large and complex solids in a new empty drawing to avoid complications with selection of parts and the total number of objects/facets in the drawing from other objects. Then "Cut/Paste" the finished solid into the drawing with other necessary pieces.

Phil

* I have worked with files up to about 750 mbytes in the 64 bit versions of DesignCAD. Beyond that I have seem pieces disappear from the files, especially when combining multiple hundred-plus megabyte files into one file with "Copy/Paste." So there is a maximum file size that is far less than 64 bit numbers should allow. But I have never created a single solid over 750 mbytes.
« Last Edit: May 15, 2019, 09:28:34 AM by Dr PR »
DesignCAD user since 1987

Dr PR

  • Hero Member
  • *****
  • Posts: 5682
Re: Another Lovely DC3 idiosyncrasy...
« Reply #21 on: May 15, 2019, 09:33:32 AM »
In the "Post reply" dialog, in the "Attachments and other options" section, you can click the "Don't use smileys" option to prevent what you write from being converted into silly juvenile symbols.

"Don't use smileys" should be the default.

I don't have the proper words to express my contempt for "smileys."

Phil
DesignCAD user since 1987

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Another Lovely DC3 idiosyncrasy...
« Reply #22 on: May 15, 2019, 11:01:30 AM »

Don't use smileys Phil??? That's a cardinal sin in this new millennium world order. But I feel your pain, I detest the rampant use of  the el followed by an oh followed by another el. Never use it myself.


Lar

BlankMan

  • Jr. Member
  • **
  • Posts: 54
Re: Another Lovely DC3 idiosyncrasy...
« Reply #23 on: May 15, 2019, 01:40:12 PM »
Phil, thanks for taking the time to provide all that info. I appreciate the brain dump.

Yes I think it was you and Lar that got me to stop using SolidAdd and start with a block of material and machine it away with SolidSubtract's just like I remove material on my lathe and milling machine.

Draw all at once: Well, yeah, sorta. The BasicCAD code for the project I've been showing has exceed 11,000 lines of code. It's divided into main blocks a block being one of the four pieces, base, box, cover, display, with many subroutines. Blocks share subroutines.

If I'm putting 4 holes in the base that have to align with 4 holes in the box the same subroutine does it. Also even though I'm putting 4 holes in there is only one Cylinder command and one SolidSubtract command in the subroutine to do that. Two for-next loops (for PosX = -1 to 1 step 2 -- for PosZ = -1 to 1 step 2 ) take care of positioning.

The big advantage here is that everything is done by variables, If I need to move something or make something bigger or what ever I change the value of the variable and rerun the program. That display housing is on a 15 degree angle if I want to change it to say 22 I change the variable. Widen the box? No problem. Shrink the box? No problem. Everything is done off axis's center.

I just did a rough count, there's 550 variables, and over 1700 DesignCAD commands.

I do a lot of SolidSubracts so from what you said I do believe I got a really really big number of facets. I can see doing things like drawing the 4 cylinders and then doing one subtract. Those cooling louvers would be good candidates for that. The fan cutout is done by making the pattern out of a cylinder the using that cylinder to cut it in the cover so that's only one subtract there.

I'm going to try your subtract a block to regen things. I'm interested to see if that improves the quality of the STL export.

If I try in one sitting to draw the cover, box, and display housing in that order it will get to the display housing but inevitably the display housing will disappear before it completes. I haven't looked anywhere for the solid that disappeared but will next time. I too leave layer 0 empty. But I keep all layers visible so it something went to another layer wouldn't I still see it?

What I've found is that if I draw the box and cover, save them to a file, exit DC3, open the drawing with the box and cover then draw the display housing it completes successfully. So definitely running out of something and saving it to a file apparently cleans what ever up.

I've being poking around, is there any way to see say the statistics on what's in the drawing? How many of each of this that and the other things are being used/exist?

Newbie? Not.
Been using DesignCAD 3D since ~1990
Still have version 4 floppies from 1992...

Lar

  • Hero Member
  • *****
  • Posts: 2866
Re: Another Lovely DC3 idiosyncrasy...
« Reply #24 on: May 15, 2019, 07:54:17 PM »
I've being poking around, is there any way to see say the statistics on what's in the drawing? How many of each of this that and the other things are being used/exist?




Help menu, Drawing Info.


« Last Edit: May 15, 2019, 07:55:52 PM by Lar »

BlankMan

  • Jr. Member
  • **
  • Posts: 54
Re: Another Lovely DC3 idiosyncrasy...
« Reply #25 on: May 15, 2019, 08:43:42 PM »
LOL Really. The one place I didn't look. The Help menu. Who woulda thought. Obviously not me...
Newbie? Not.
Been using DesignCAD 3D since ~1990
Still have version 4 floppies from 1992...

Dr PR

  • Hero Member
  • *****
  • Posts: 5682
Re: Another Lovely DC3 idiosyncrasy...
« Reply #26 on: May 15, 2019, 09:44:22 PM »
BM,

Now I understand what you meant by "all at once!" You have a macro to do all the operations to create the pieces. Parametric macros. Pretty cool!

The only other time I have seen that done was when a fellow I work with used a macro to generate drawings for meter faces (remember analog meters?). He entered a few variables and the macro drew a pattern for a face for a milliampere meter scaled to the proper units for the instrument he was designing.

****

Unfortunately, the "Help/Drawing Info" dialog does not show the number of groups, blocks or solids in the drawing. Macros have been posted to show the numbers of groups and solids.

Older versions of DesignCAD allowed only about 32,000 groups or solids in a drawing. When this number was exceeded the program began combining new groups/solids with existing older groups or solids.

To make matters worse, when existing groups or solids were deleted their group/block number was not reused, so the group/solid numbers continued to climb even if there were only a few of each in the drawing. For example, if you create solids 1 and 2, then delete either, the next solid will be number 3, and so on. The deleted solid number was not reused.

It was pretty easy to drive the group/solid numbers past 32000 - I did it several times in hand drawn designs with large files. New groups and solids were numbered starting over at 1 so the newest groups/solids were combined with the oldest. I started getting really bizarre solids - an older solid combined with a newer one.

The last 6-8 versions still have maximum numbers of groups and solids but they are 64 bit numbers and are much larger.

I mention this because with a macro you can create huge numbers of solids quickly. Even if they are eliminated by subtracting them from other solids, the maximum solid number will remain high, and continue climbing as more solids are created.

When a file is saved the group and solid numbers are reassigned, starting over at 1 and continuing with no skipped numbers to the maximum group/solid ID, so the maximum group and solid numbers do not grow excessively. However, the numbers of existing groups and solids are reassigned and do not remain the same.

The program has the "Tools/Groups .../Pack Group IDs" and "Solids/Pack Solid IDs" functions to repack the numbers without having to save the file.

Phil
DesignCAD user since 1987

BlankMan

  • Jr. Member
  • **
  • Posts: 54
Re: Another Lovely DC3 idiosyncrasy...
« Reply #27 on: May 16, 2019, 09:03:01 AM »
Thanks Phil, and... Ha!. Meter faces. Well versed in them. Still have some Modutec meters shrink warped on their cardboard display wrappers.  Worked for Allen-Bradley Drives Divisions in engineering for a while, ordered many a many custom GE industrial panel meters...

Thanks for the history and information, it explains a lot of the behavior I see. I am always amazed at the depth of knowledge you and Lar have of DesignCAD. And thanks for the tips on the packing and macros, I'm going to take a look around for them, I'm curious to see what all's being used.

Food for thought, it be nice of DC3 would warn you when getting close to using up some finite resource it has...

But in this day and age, and I've done a lot of programming and still do and have packages in the OpenSource world and Linux distributions, having limits like that should not be... My server and desktop both have 32G of RAM, and then there's always swap, no need for arbitrary artificially small limitations.

Even if variables have to be pre-allocated so there's a finite number available there are ways to to do memory allocation calls and set up more variables on the fly. I know, I've done it in programming languages that had limitations like that. I remember setting up linked lists and using them to set up b-tree linked lists for data searching before I even knew what a binary tree was... LOL

I've always said, the impossible can be done. It just takes a little longer... Telling me you can't do that is nothing more then a challenge...

-Curt

Newbie? Not.
Been using DesignCAD 3D since ~1990
Still have version 4 floppies from 1992...

Dr PR

  • Hero Member
  • *****
  • Posts: 5682
Re: Another Lovely DC3 idiosyncrasy...
« Reply #28 on: May 16, 2019, 12:25:17 PM »
My dear aunt Catherine wouldn't allow me to use the word can't. "Can't never did anything!" she would say. My mother often repeated the same thing. I wasn't allowed to quit without at least trying.

****

Apparently much of DesignCAD's code still dates back to windows 3 or perhaps MS-DOS days. It has been patched so many times the patches have patches. I think this is the primary cause of problems in the video display routines. But I also suspect that somewhere in the code are variables, arrays, whatever, that still have 16 bit or 32 bit limits. It all needs to be rewritten.

With 64 bit variables there is no reason (other than processor speed) why the program won't work with file sizes in the tens or hundreds of gigabytes. But I haven't been able to get it to work with files much larger than about 750 megabytes.

Like you, I have 32 gigabytes of RAM (the highest speed RAM I could get), and only about a gigabyte ever gets used for program storage for the operating system and user programs, and a few terabytes of unused drive space, so there should never be a file size limit.

Back in the early 2000s DesignCAD was limited to file sizes of about 60 megabytes or less. I ran into this limitation with several drawings I was creating. Files were not paged to hard disk while they were being edited. Somewhere along the line file size limits were expanded with 32 bit code, and then 64 bit code. But something is preventing the program from working with gigabyte size files.

For comparison, Photoshop would work with gigabyte image files decades ago by paging them onto the hard drive. It was VERY slow, but it worked!

****

DesignCAD used to give a warning when it was running out of usable RAM, but it was accidental and subtle. One by one various commands would just stop working. You could select the command from menus, tool bars, hot keys, etc., but nothing would happen. At that point you had to save your drawing, shut down DesignCAD, restart it and open the drawing again. This makes me think that the program wasn't releasing resources after they were used, so the operating system ran out of RAM. Closing the program released the resources.

When I have reached the ~750 megabyte limits with DesignCAD files I have tried shutting down everything - turning off the computer and rebooting. But even this doesn't allow me to add to a ~750 megabyte file. But in the latest releases I don't see commands stopping working like they used to. You can draw new objects but they won't be in the file the next time you open it. If you paste objects into a file some parts of the pasted objects just don't appear in the file.

Phil

Note: I have been working on a CAD model of a guided missile cruiser for about 14 years. It includes almost all details of the real ship down to 3/32 inch diameter (screws, rivets, etc.).

It is currently in four files of 200-350 megabytes totaling a bit more than a gigabyte. I have succeeded in pasting two of these files together to create a >500 megabyte file. But if I try to paste a third file into the composite drawing only part of it gets added, and some parts are lost. The resulting file is 720-750 megabytes.

Just loading files this size takes many minutes, and OpenGL Gouraud shading can take up to 90 minutes (4.3 GHz 6 core i7, full speed DDR1300 RAM and fast USB3 hard drives). This is what I use to test the limits of new DesignCAD releases.

https://www.okieboat.com/CAD%20model.html
DesignCAD user since 1987

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4237
Re: Another Lovely DC3 idiosyncrasy...
« Reply #29 on: May 17, 2019, 08:21:33 AM »
Sorry I'm late to this thread.
BlankMan, when using PointSelect, as Lar pointed out earlier, it's best to select by setting the point on a vertex of the object to be selected, not at its center. If you can't find a unique vertex that can't be confused with some other object (though you certainly can in this case), sometimes setting the point on a unique edge will work.
25 years with DesignCAD