DesignCAD 3D Max23. Paper-Space Crash and File Corruption.

Started by DaveTK, April 03, 2014, 02:26:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DaveTK

Quote from: samdavo on April 04, 2014, 03:27:20 PM
.................................  I mean, I tried resetting the view distance from 1000 to 3000 to 5000 to 20000.(!)  As far as I could see it wasn't helping.  Then I realised I wasn't wearing my long distance glasses, so if it did reappear, I wouldn't be able to see it anyway :)   .........................


Hi Samdavo,
You're a funny man. Made me laugh quite hard with your banter. I liked the picture of the cat and ex-mouse.

There has been a lot of activity while I've been sleeping so a few replies to be made now I'm awake again. Us old'uns need our sleep.

What you said about increasing the view to 20000 and you wouldn't have been able to see it anyway ...... Well, the distance function doesn't seem to work as though it has any specific unit of measurement. You try it on any drawing; after a while it doesn't do much at all. The image certainly doesn't disappear when the number gets very large as you might think it would.  As I replied to Mark earlier it appears to be a non-linear function. Your question to Mark,  "would it have helped if the cube was 2x2x2, and placed at 500 (?) ", is an interesting one. I did this and with distance set to 50milion I can still see it – my eyesight isn't that good either!
David


DaveTK

Quote from: Rob S on April 04, 2014, 07:01:23 PM

I have no idea why I had to save, close and reopen, all I know is I thought this fix should work, and when it didn't right away, I tried that and then it did.............................


Hi Rob,

Thanks for getting back to me. I had hoped you were going to be able to give a well known and rational explanation about the close-save-open, but it is worth remembering, if all else fails, "close – save – re-open".
It looks as though resetting the origin only resets X & Y co-ordinates to zero and the program assumes that Z is taken care of by virtue of the fact that any drawing object connected to X and Y would automatically fix the Z axis co-ordinate.
It seems like the faulty drawing has a value set that is not reset by setting origin. It would be useful if the View/Regenerate_All function had a bit of script added to it that does a parity check between known and implied co-ordinates to look for out of bound conditions. Such a piece of programming code would have little implication on a sound drawing but would overcome the problem I encountered.
I think we, (forum members et al), have collectively beaten this one to death. There is a quick fix to retrieve the drawing and you get the acknowledgment for finding it – well done.
Though not to underestimate the valuable feedback and insight into other aspects of DCAD from the many other contributors to this thread.
Thank you all.
David

DaveTK

Quote from: Dr PR on April 04, 2014, 10:48:51 PM
Dave,

The "viewpoint" thing is a bit complex and non-intuitive (for me). .............................

Phil,
The "viewpoint" thing is non-intuitive for me also. I too was thinking there was only the object and camera, the other aspects, very well explained by you, are indeed confusing on first reading but hopefully will become clearer with time.
Do you have any comment on why the Distance setting seems to be non-linear such that for large settings it doesn't make any further reduction in size of the viewd object? (see my reply to samdavo reply#60). Prl did make a brief reference to viewing in reply #44.
Thanks
David

samdavo

Quote from: DaveTK on April 05, 2014, 03:00:52 AM
It looks as though resetting the origin only resets X & Y co-ordinates to zero and the program assumes that Z is taken care of by virtue of the fact that any drawing object connected to X and Y would automatically fix the Z axis co-ordinate.
Dave
Just on one point of your post back there, concerning "setting origin doesn't necessarily set z= 0".  I would maintain that it does - assuming you are in 3D when you set "origin".   

BUT I find you may be right  ...  IF you are going back and forwards between 2D and 3D, i.e.  I think there is a way to confuse DCAD with this strategy.

i.e. I suspect if you set origin in 2D, (where objects are scattered in the z dirn) -  it will not necessarily use the z coordinate of the point you choose, but ( think I'm right) - maybe it adopts the z coord of the current XY plane. 

Moral of the story ,  set origin whilst in 3D. (imo,   E&OE)
For discussion
cheers
sam

(edit)  Another way to say that ...  If you set "origin" in 3D (say isometric to avoid confusion / ambiguity), then x=o, y=o, and z=0 at that point.

But if you set "origin" in 2D (= front view by default), then when you click on a point (x1, y1, z1) to set it as origin - you will actually set the coords of that point to (0, 0, z1).
Rocket science !! beware lol.
   
sorry - not trying to be patronising, even if I am lol. 

PS your assumption has to be wrong - i.e. what if a stack of "objects" meet at a point in 2D, but not in 3D.  Which one would DCAD choose as the (new) z = 0 ?? (2 cents)

DaveTK

Quote from: samdavo on April 05, 2014, 04:24:57 AM
Quote from: DaveTK on April 05, 2014, 03:00:52 AM
It looks as though resetting the origin only resets X & Y co-ordinates to zero and the program assumes that Z is taken care of by virtue of the fact that any drawing object connected to X and Y would automatically fix the Z axis co-ordinate.
Dave
Just on one point of your post back there, concerning "setting origin doesn't necessarily set z= 0".  I would maintain that it does - assuming you are in 3D when you set "origin".   

BUT I find you may be right  ...  IF you are going back and forwards between 2D and 3D, i.e.  I think there is a way to confuse DCAD with this strategy.

i.e. I suspect if you set origin in 2D, (where objects are scattered in the z dirn) -  it will not necessarily use the z coordinate of the point you choose, but ( think I'm right) - maybe it adopts the z coord of the current XY plane. 

Moral of the story ,  set origin whilst in 3D. (imo,   E&OE)
For discussion
cheers
sam

.......................................................................


Re reply #63
Sam,
I find you are quite correct in your analysis. Setting origin in 2D space doesn't reflect on the Z axis when you move from 2D to 3D.
Setting Origin in 3D space works on all three axes. Good spot!

So what I suggested to Rob S, (Reply #61), about checking for out of bound co-ordinates is nonsense – I think!

I am now even further from an understanding of what cured the problem with the Save-close-re-open routine; but it works so what the hey.

.................and, no I don't think you sounded patronising at all. Also, often using humour on the internet can get one into hot water because what the sender implies is not what is inferred by the reader. I always assume that everyone is being friendly until it is obvious even to a blind man that offence is being meant. 
Keep em coming!
David

prl

Quote from: DaveTK on April 05, 2014, 05:51:35 AM
I am now even further from an understanding of what cured the problem with the Save-close-re-open routine; but it works so what the hey.

Well I do know there is a bug in the "origin" command because I can access points with coordinates that are no longer in those positions.  Hence by closing down and reopening DesignCAD, you are forcing DesignCAD to make permanent the origin change transformation and so it cleans up the database.  Probably purging the undo buffer etc. 

My observations only, never been behind the curtain at that level.

DaveTK

Quote from: prl on April 05, 2014, 06:14:07 AM

Well I do know there is a bug in the "origin" command because I can access points with coordinates that are no longer in those positions. ..........................................................

..................And so the plot thickens.
David

prl

Quote from: DaveTK on April 05, 2014, 06:54:44 AM
..................And so the plot thickens.

A tip.  Once you start investing lots of time in making something, make "save as" backups frequently.   Example,  myperpetualmotionmachine v1.dcd  . . . . . myperpetualmotionmachine v23.dcd.   The highest number is always the most current.

There will be times either you or DesignCAD or both of you will get lost-in-space and it is best to go back to a known working version of your drawing/model.  Many a times, my fumble fingers have hit hotkeys that I didn't intend.    Heck, half the time I can't write posts without screwing up the grammar or spelling or intention of what I'm trying to say.

Edit: As evidenced by me repeatedly editing my posts so I don't have so many dumb errors in them.

DaveTK

Quote from: prl on April 05, 2014, 07:39:04 AM
Quote from: DaveTK on April 05, 2014, 06:54:44 AM
..................And so the plot thickens.

A tip.  Once you start investing lots of time in making something, make "save as" backups frequently.   Example,  myperpetualmotionmachine v1.dcd  . . . . . myperpetualmotionmachine v23.dcd.   The highest number is always the most current. ............

So basically you’re saying the .bak file is useful for immediate cock-up recovery but not reliable for deep seated tragedies.  I’ll certainly take that one on-board.

I look forward to investing a lot of time in drawing, although the drawing isn't the "be all and end all" of my interest in the process, it is only the beginning. So far though I have spent a lot of time discussing the problems I’ve encountered and not really drawn anything useful.

I know what you mean about the spelling and grammar, I write everything in MS Word with spell check turned on and cut’n paste. I don’t pay too much attentiion to the grammar though, I wouldn’t necessarily know when it is right or wrong – such was my early education. Given that youngsters nowadays seem to speak in predictive text speak I don’t know if I should be too worried about my own deficiencies. :)

David

prl

Quote from: DaveTK on April 05, 2014, 07:59:55 AM
So basically you're saying the .bak file is useful for immediate cock-up recovery but not reliable for deep seated tragedies.  I'll certainly take that one on-board.

Personally, I don't trust *.bak files.  They can "bake in"errors and by the time you find out your drawing is hosed, it has been backed up hosed.

Besides, the "save as" approach forces you to append the file name.  Also the "save as" command does some cleaning up.

Dr PR

Dave, changing the view distance does change the apparent view distance to objects. Try setting the distance to 1000 and then use "View/Fit to Window" (CTRL W). Then change the distance to 1,000,000,000. Notice how the image gets smaller?

Admittedly, it really isn't as small as you would expect by increasing the distance from you to an object by a million times, but it does get smaller.

If you use "Fit to Window" again the view changes so the objects fill the window.

This is one way DesignCAD allows "impossible" things (real world) to happen. No matter what the view distance is you can see the objects with the same clarity. It gives you vision much greater than an eagle's.

****

The primary effect of changing view distance is to change the perspective angle. View distance applies only to "Perspective" view.

If you draw a cube and set the view distance to only about the length of the cube's side (with the view center inside the cube) you will see a very "close up" view with lots of perspective distortion.

In the "cube distance 5.jpg" image the cube is 4 units on a side, and the view distance is 5 units from the corner.

Now change the view distance to 100 and you get a less distorted image of a cube (cube distance 100.jpg).

So changing view distance is a lot like changing the focal length of a camera lens - the view angle from the camera to the objects gets smaller with longer view distances. At a view distance of infinity you get no perspective distortion. This is essentially what you see in "Isometric" and "Parallel" views.

****

So why not set the view distance to a very large number and avoid all this distortion? OK, now take a deep breath. There is an undesirable side effect of very long view distances.

The two images of the boat are from the same angle, but the distance in one is a thousand units and the other is a billion units. Notice how screwed up the image is at a view distance of one billion. Notice how more distant parts of the drawing that are supposed to be hidden behind nearer objects "bleed through" in odd ziz-zag stripes?

When DesignCAD (or any CAD program) generates a view of a scene it examines all of the objects and assigns a relative distance to each (this is the "Z buffer"). Then it pieces together the image, showing some parts and hiding others, depending upon which parts are "in front" of others (longer or shorter Z buffer distances).

The depth resolution of the Z buffer is not infinite - like everything else in the computer the depth value is a binary number with a limited number of bits. This means the total depth of the view must be divided into a finite number of "slices" that are planes perpendicular to the view direction. This is what the Z buffer does. It is a lot like the little view boxes children make in school where a sequence of flat images at different depths gave the impression of a continuous 3D view when seen through the opening in the end of the box.

Objects on a nearer slice are displayed over objects in more distant slices.

DesignCAD has a limited number of "slices" in the Z buffer. All objects or parts of objects within the space between increments in the Z buffer depth are displayed as if they were in the same plane.

In the case of the picture with a view distance of 1000 the Z buffer resolution was a relatively short distance compared to the total object depth, and the program did a good job rendering the image (this is just the screen image, which has relatively poor resolution). But in the image with a view distance of a billion, every part of the boat fell within a single Z buffer distance increment, so all were displayed as if they were in a single plane. But the objects have many different colors, and the program had to guess which to display on top, taking into account surface normals, colors and such. As you can see, what you get when you tell it to do this (by setting a huge view distance) is more or less a montage of bits and pieces and colors.

Assume that Z buffer resolution is 10,000 planes (I don't know the real number, but it probably isn't more than 2^15), so each plane is 1/10,000 of the view distance. The boat is 352x147x132 units XYZ. So at a view distance of 1000 the Z buffer distance resolution is 1000/10,000 or 1/10 a unit. Side on the view of the boat would be sliced into 1320 Z buffer planes.

But at a view distance of 1,000,000,000 the Z buffer resolution would be 1,000,000,000/10,000, or 100,000 units, each about 750 times the depth of the boat! So all parts of the boat fall within a single Z buffer slice, and we see a kaliedoscopic image.

That's why you don't use very large view distances.

This problem shows up in more subtile ways. You can't "paint" one surface over another by separating them by very small distances, because both surfaces will fall in the same Z buffer plane at fairly short view distances relative to the overall object dimensions. See this link for more about this problem:

http://forum.designcad.com/index.php?topic=3357.msg18034#msg18034

Phil
DesignCAD user since 1987

MarkX

Quote from: Dr PR on April 04, 2014, 10:48:51 PM
In DesignCAD the camera ALWAYS points at the "viewpoint." The "viewpoint" is an XYZ coordinate in the drawing. When you rotate the view the camera spins in a circle around the "viewpoint" coordinates at the "view distance." While this may sound crazy, it is what happens when you walk around an object while looking at the object. It is sort of a machinist's way of viewing the world.

All true. In the model space you set the 'viewpoint'. The problem is, that there doesn't seem to be a way to set the viewpoint from within paperspace.

Mark

DaveTK

Quote from: Dr PR on April 05, 2014, 10:06:07 AM

..................... Admittedly, it really isn't as small as you would expect by increasing the distance from you to an object by a million times, but it does get smaller. ......................................


Phil,
I don't disagree with anything you said, in fact you confirmed my point to some extent.
I wasn't suggesting that anyone would want to set the distance at a very high level but the visual effect doing so ought to be more representative of what would actually happen. It should then be up to the user to start zooming in if the image begins to become too small.

The distance control appears to both increase distance while at the same time increasing the focal length of the camera lens to make the change in apparent size less noticeable to the user.
In fact in your example of increasing the distance and pressing Ctrl+W, this effectively increases the focal length of the camera lens to perfectly compensate for the distance increase, the image stays the same size but the depth of field changes and perspective becomes less pronounced. I guess what I am saying, using far too many words to do so, is the Distance setting is actually a compound Distance+Focal Length setting, which isn't obvious to new users such as myself.  – Becoming clearer by the minute though.

I fully understand your point about the aliasing effect of crushing too much data into too little resolvable space. For most real life situations I wouldn't expect it to be necessary to ever set the distance to more than 10 times greater than either the largest object dimension or depth of the object, whichever is the largest. Moving away any further and one might as well be in parallel view.

I hope we're on the same page now but it wouldn't be the first time today I am in error.

David

Dr PR

Dave,

I agree with you about the behavior of the view distance and it's affect upon the view. I have been using the program for decades and it still isn't obvious to me exactly how it works.

I normally set the view distance to about 5X the greatest drawing dimension for working in Perspective view. Occasionally I reduce it to about 2X to 2.5X to enhance the perspective. The attached picture shows two perspectives of the same object. I think both were created with the same view distance, but I am not certain. The view on the left is more like what you would see as you walked up to the house.

The picture also shows a bug that is view distance related. The image on the right shows the real color of the porch deck. The image on the left has a different view angle and the porch deck is rendered black. Sometimes you have to fiddle with the view angle to get everything to render correctly with a short view distance.

Phil
DesignCAD user since 1987

Lar

Ok, I know I'm very late here and no way I will read everything but I have two things to contribute (if these are already said I apologize):

1] Rather than change the origin it's probably better to select everything and move them to the original origin. One thing I have noticed about changing the origin is that when exporting to other program they tend to go by the original origin (I guess saving and reopening will fix this).

2] When I downloaded Dave's file (a few days ago) and didn't see anything I immediately, in point select mode,  selected all and saw that the points for the cube was visible, but dimmer than usual. This is a sure sign that the object is outside of the cameras clipping plane (I didn't post then because I checked back a few pages and saw that my solution was similar to RobS', except as per point 1). One way to bring things into view in such circumstances is to set the viewer focus on the object. One way to do this is to use the 'set viewer points' command (the camera with the red x in the view toolbox) and snap the 1st point on a point of the object then ignore the 2nd point by pressing enter - the viewer focus for the active window will remain there until you set it somewhere else. Or you can use the macro that sets the viewer focus at the geometric center the selected object. It might be called "svc.d3m" or "vfc... .zip". I use my version of the macro very often when working in tight areas in a 3d model and have to orbit around different points as I work.

Lar