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.

Flatten solid onto XYZ "walls"

Started by samdavo, April 25, 2013, 07:27:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

samdavo

For some reason (at 2.00am) I got it into my head that it might be useful to flatten a solid against a wall or floor.  :)
(this is getting to me lol).

Gotta feeling it was triggered by Lar saying that some of his drawing (Retro thread) was a flattened plane or some such.   
PS, Lar, if you could comment it would be appreciated.

Anyway, it didn't take too long to achieve.
and I enclose the result of what I was thinking of.

One thing I like about it is that the dimensions are easily read in the XY , YZ walls and ZX (floor) planes, when often they would get in each other's way (between themselves, and also with the solids in the drawing).

I quickly add that I would not entertain doing this for a drawing at work, although it does help with some understanding.
(Indeed for work I am thinking of really simplifying this stuff - doing mainly 2D, with a 3D drawing only where necessary, and probably on a different page/drawing - and /or in a report - because that way I am super quick to respond, and can follow up with 3D on a separate document - and also clients hopefully won't insist on a DWG version, and I can maybe get away with jpegs made with boxwrapped threads etc, but I digress).

Firstly I enclose the screendump of the isometric.  plus the dcd.

samdavo

Next , how I did it ( you might have an easier way?)

If you go to Tips & Tricks\DT's Toolbox, you'll find a macro called FlattenZ.d3m.
For this thread, I'm gonna call it
Flatten"tempZ".d3m
for reasons as I point out below, i.e. "Z" can be the temporary z axis.
 
I set working plane (XY)  the same as the XY in the enclosed jpeg (ie right hand wall) - ran the macro - saved the flattened drawing so achieved;
Started again , this time set working plane as YZ ( left hand wall), flattened it ditto, saved;
And ditto in the XZ floor.
In each case "Z" in the Flatten"tempZ" is the temporary working "Z" , not the permanent Z.

Then I brought them together in a 3D drawing, where the relevant flat drawing was "projected" onto the relevant wall.

PS DT,  I believe there's a problem with the macro, in that it only wants to work with setting "flag = 0 = flatten all", and not with "flag = 1"

more to follow...

samdavo

Then I thought to myself, why not try some inclined "tempZ"? 

and that's when I came up with the quasi-isometric shown in the enclosed version of that same drawing.

I'm sure there are easier ways to get isometric views.
Still, it has helped me understand a stack of 3D principles.
And it's more about the principle of "Flatten-tempZ-even-if-inclined".d3m   rather than pretending it's an efficient way to get a view drawn.  (2 cents)

samdavo

#3
The same thing after exporting  into Sketchup. (2 cents) - I include one error in that one "projection pane" is half- blank, probably a bug.

PS BTW, lol - here's me accusing Sketchup of having a bug (!?) - when I look carefully at that "central isometric of the 5 instances", I see it has been wrongly placed, and the plane of the flattened "isometric" is not the same as the plane of the normal to that direction-line.   Doh.
(I flattened it ok - but pasted it onto the little inclined plane wrongly somehow.  I'll do it again and post it below, see reply #5 )

samdavo

#4
and the jpeg of the original drwg , flattened on orthogonal walls and floor.

Minstrel, don't know if you're gonna read this, but I believe I have done more or less what you say in your Youtube tutorial,
i.e. well I came into his expecting to have to rotate something 90 degress - 

In fact I found that you have to rotate BOTH
a) the DCAD drwg 90 degrees (about the X axis) -
AND
b) the Sketchup once imported, ...

Reason being that I wanted to get the sun above the object, and use shadow - and the default for Sketchup appears to be a plan view (?)  i.e. you are looking almost from the sun's position when it opens (2cents).   Thanks for those tips BTW.

PS I enclose the 2 Sketchup files (zipped) - but I suspect they are read-only.   Hence I have also zipped up the DWG files, already rotated 90 deg -  (in case you can be bothered loading it in a Sketchup file.)  Appreciate any tips.

PS To rotate it in Sketchup, I used "Camera/Position Camera", and stuck it down at the bottom of the screen - which seemed to spin it about the X axis.  Then I simply turned on "View \ Shadows".

PS  When I exported the DCD to DWG, I tried resetting the working plane.  After all, that was good enough to "spin" Flatten"temp-Z",
But it didn't fool Sketchup (2 cents).  As you said on your Youtube, you have to actually rotate it 90 deg about the X axis. 

samdavo

#5
As per my discovery (reply #3)  that I had screwed up with that central "quasi-isometric", I enclose the corrected one (Sketchup screensnip).

I also enclose the dcd incl 90deg rotn.
I also enclose a zipped file with the corrected DWG ( incl 90 deg rotn)
and also the Sketchup file  (with its additional 90 deg rotation - or rather 90 deg viewing angle).

Actually, I enjoy the fact that the reason for that error was "human error" - great that this technique of DCD > DWG > SKETCHUP  is "reliable",  even if the shading looks like a kindergarten kid was been doodling with crayons - but hey, it's clear yes?

PS.  I realise that this discussion has gone off on a tangent a bit (i.e. discussing Sketchup)  - but, as for the "random crayon" colouring, simply twigging the roller of the mouse back and forwards a bit will change the extent of those colours (in particular the extent of the green and the brown).

PS. The other thing about Sketchup is that AFAIK you can rotate selected bits in the drawing - not unlike you rotate them in DCAD.  Just that I personally don't have the smarts to do it there - and it was easy to go back to DCAD and correct it  by running FlattenZ again (normal to that bi-axially inclined plane).    As Minstrel says, the two programs compliment each other quite well.  (2 cents)

prl

Sam,

I'll admit I haven't fully read nor digested your posts (DC blog?).

So in DC are you simply trying to project a 3d assembly onto a plane of your choosing as opposed to actually flattening a 3d assembly onto a plane?  The latter is easy to do but not really useful having all those facets/ planes occupying the same plane.  It will lead to hidden line display order conflicts.

Lar

Quote from: samdavo on April 25, 2013, 07:27:01 PM
Gotta feeling it was triggered by Lar saying that some of his drawing (Retro thread) was a flattened plane or some such.   
PS, Lar, if you could comment it would be appreciated.
In that 'Going Retro' thread (http://forum.designcad.com/index.php?topic=4967.0) I spoke of 2d Text entities always 'facing the camera', which is totally foreign lingo to dcad (22, maybe 23, and below, I hope). All I mean is that 2d text always appears flat to the screen and always reads left to right. You can never see the back side of 2d text (ie, it never appears reversed). This same principle applies to bitmaps.
I have a  technique that achieves the reverse of samdavo's flattening on a solid. Instead of producing 2d flats from 3d solids I can generate 3d solids from surrounding 2d flats.

Lar

samdavo

#8
Quote from: prl on April 26, 2013, 05:25:19 AM
Sam, … are you simply trying to project a 3d assembly onto a plane of your choosing as opposed to actually flattening a 3d assembly onto a plane? 
(beware of)  hidden line display order conflicts.
prl,
What am I trying to achieve? - to be honest, mainly stretching the boundaries (and very little practical application within my "known knowns" - possibly of use some day in my "unknown unknowns" dept) - I was aware of DT's macro because he sent it to me to sort out a 2D drawing (well I thought it was 2D) - and it successfully flattened everything to be z=0 (whatever the x and y coordinates.
I suddenly realised it might work to "flatten" a drawing onto any plane, if the z axis (permanent or temporary) was suitably chosen.  And it turns out that both permanent OR temporary z axis works. 

Quote from: Lar on April 26, 2013, 05:47:08 AM
...  I spoke of 2d Text entities always 'facing the camera', …  always appears flat to the screen and always reads left to right.
...  I have a  technique that achieves the reverse of samdavo's flattening on a solid. Instead of producing 2d flats from 3d solids I can generate 3d solids from surrounding 2d flats.  Lar 
Lar, I probably totally misunderstood, and on re-reading that thread, I note you are usually talking about images, which I assume are jpegs(?) formed from pdf’s (?)    Almost all of that paragraph went over my head.
Anyway, my subconscious seems to have recorded it as a challenge to get a drawing into a single plane – (and for a drawing of that size, it would help with the final size) - apologies for the confusion.
As for reversing that FlattenZ macro, I was thinking of that as well – that it must be possible to record the z values in a giant matrix before flattening – then “unflattening” it again.   Again, I can’t immediately think of a reason for it though.   You obviously have found a use for it, yes ? lol .  No need to go there.   

One thing I can tell you though - DCAD is so so much easier and quicker (for me anyway) for doing a drawing like the "five pseudo-isometrics"  than using Solidworks.
I am seriously impressed how easy it was.

Actually, I'll explain my latest philosophy a bit better in the next post.

Lar

#9
Quote from: samdavo on April 26, 2013, 06:35:03 AM
Almost allof that paragraph went over my head.
Sorry, Sam and the rest of the forum, for sounding like a manual.

In the early days of the forum I tried to be complete in my posting so as to avoid unnecessary questions. Now I do it for mostly selfish reasons: if I myself read one of my posts years after writing it, I am [1], impressed by my accuracy and [2], may have forgotten all of the little particulars of a situation and find my own advice quite informative. Many of my posts I have totally forgotten ever writing and am really thankful that I was thorough in my answer.

Also, as new members become more knowledgeable of dcad I don't want them throwing me under the bus for something I wrote years ago, the way politicians do each other.

Lar

samdavo

#10
Undoubtedly off topic, (this thread is all about fairly complex geometry after all, and turning 3D into 2D) ,  and undoubtedly bound to bore and /or confuse  ... (skip this post unless you've just had at least two cups of coffee)...

What I am REALLY thinking is that I would like to keep to 2D "as long as possible" in the client approval process, and develop 3D images as late as possible - and maybe submit 3D drawings/images only as and when required, either as follow up drawings ( sheet 2) or better still as jpegs in a report rather than as part of a drawing.

Please appreciate that frequently I have to submit final "as-constructed drawings" as other formats such as AutoCAD (if I'm lucky) or Bentley Workstation (if I'm not - bludy nightmare), and it is inviting trouble to make drawings any more complex than they have to be.    And submitting 3D images in reports avoids having to convert them to this or that CAD format.   And heck, even texture wrapping works for jpegs - where it doesn't always work for exported CAD drawings (whether DWG or DGN or ...)

OK, so let's assume a drawing is quickly whipped up as a 2D drawing.  (and the other thing about my modus operandi is that I try to generate the skeleton of most drawings in a spreadsheet, which is imported into DCAD via a couple of macros, one in said spreadsheet, and one in the drawing).  - All goes back to DOS days , as discussed on the nostalgia thread :)

So the left hand side of the drawing is a plan and elevation, and maybe a detail or two - all in 2D. 
And let's not forget that it is possible to choose part of the full drawing (alias "crop", alias "Section zoom" in the Paperspace toolbar) and hence just choose this simple part of the total "combined front elevation plus plan" ViewFrame  (irrespective of what else is on the drawing in the way of 3D drafts etc) ...

Then somewhere on the right (in Model space), or maybe on a second copy of the drawing, you have the option of doing a 3D solid - (starting as a draft),  and somewhere on Paperspace ( say top right) you COULD have a space reserved in case you want to add an isometric "later" - but I'm suggesting don't go there...

Now suppose the client expects a set of say 4 x A4  drawings in less than a couple of days - why not keep them simple? and send just a 2D drawing.   

Anyway - speaking of Retro, lol - what I am arguing here is
1. that (just as in the old days), one could assume that a 2D drawing gets the message across.
2. But there is still a place for 3D images, possibly even in a second drawing ( sheet 2 of 2) or better still a pdf report.   

As I say, almost certainly off topic , sorry, but I alluded to this in the first post as well.

PS - the other benefit of an Isometric that has no dimensions on it (because it wasn't included in the first 2D drawing)?  - who's to say it has to be to scale ?    :) :)  Who's to say I have to do a new one for every drawing of like components ??  Like, I could pull out "sheet 2 of 2" in no time at all - the same one I used yesterday for a different job :)   (and leave the scaled drawings to the 2D version). 2 cents

MarkX

You can do it in whatever way accommodates your work flow.

However, the industry as a whole is moving the other way: Design in 3D (with a detour perhaps to make 2D profiles), and then with a couple clicks, the paperspace views, sections, elevations are set up for you, sometimes including hatching.

Mark

DrollTroll

Thanks for the heads-up on the FlattenZ problem, samdavo. Fixed now (I think).
DT
25 years with DesignCAD

samdavo

#13
Quote from: MarkX on April 26, 2013, 09:23:54 AM
You can do it in whatever way accommodates your work flow.

However, the industry as a whole is moving the other way: Design in 3D (with a detour perhaps to make 2D profiles), and then with a couple clicks, the paperspace views, sections, elevations are set up for you, sometimes including hatching.
Mark
Mark
You're probably right.
And by the time the market "insists" on 3D and only 3D,  I'll be up to speed, having done an isometric a week ( instead of 4 a day :))

PS FWIW, I would be a happier with DCAD's isometric etc Views if you could somehow delete the dimensions in that ViewWindow, but not in the others. 

PPS (edit) (But not a pivotal gamechanger on that score I guess - it's more about the other little things, ...  lining up 3 views in Paperspace  (plan above front elevation etc)  rather than just sticking in a single ViewFrame with combined Plan-and-Elevation(s)-and-details-and-notes etc etc,  all done in 2D with all my time-honoured hotkeys and layering options etc etc. 

Quote from: DrollTroll on April 26, 2013, 09:24:47 AM
Thanks for the heads-up on the FlattenZ problem, samdavo. Fixed now (I think).
DT
DT - thanks for that.   Again FWIW,  I started off thinking , maybe I'll have to copy your macro (Flatten Z) and make a Flatten X and a Flatten Y - (or maybe a "Flatten-X-Y-or-Z-or-even-a-combination-of-these-axes.d3m"  with an input flag in there somewhere) - but that's (arguably) not necessary with the temp Z allocation mentioned above.  Cheers 

PS And since prl challenged me, I'm struggling to think of a need for anything other than your basic FlattenZ - (which is perfect for rectifying 2D drawings where for some reason people have managed to get some various values of z in there.  But only an idiot would do that yes? lol)  cheers

samdavo

#14
Maybe I should give a plug for that macro FlattenZ for those who haven't discovered it yet.
Basically it sets everything to z=0.  and that corrects errors of z <>0 that might have crept into 2D drawings ( but obviously don't use it for 3D drawings - or be real careful !!  (even though that's just what I do above - but why did I do it? lol, who knows? in hindsight, I don't)

But - For months if not years I had a few drawings in the archives which (unknown to me) had elements in other layers than z=0 (and which slowly polluted much of my entire library , what with copy and paste  etc and importing symbols etc) - 

I started off saying "WHADDAYA MEAN THOSE  (#**^##)   LINES DON'T MEET!!!??" in louder and louder tones, then decided I must have annoyed some computer in a past life ...   then found this forum,  DT sent me that macro , and ,,, I have hardly had cause to swear since :) :)