Author Topic: 3d to 2d views engine  (Read 33874 times)

0 Members and 1 Guest are viewing this topic.

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #15 on: August 09, 2006, 07:39:06 AM »
Glad you got it working Bert, good stuff!

It will work on any 3d solid, nested or not. I have also had it working on normal entities such as lines, blocks etc. I will add that in also when I get time (think 'FLATTEN').
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #16 on: August 09, 2006, 08:08:12 AM »
I'll give a DWG that I'm using for testing
« Last Edit: August 09, 2006, 08:09:41 AM by Call me Bert' »

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #17 on: August 09, 2006, 08:13:14 AM »
This is the entire block I rendered with Penguin :



The problem is that the wood steps are spread and some other projections appear far from the base point.

Here is the file :

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #18 on: August 09, 2006, 08:30:02 AM »
Anotehr attempt

In red, some entities appear at a different X, so I put them in red and moved them to stick again to the yellow ones (there was a gap on X axe of about 13740mm, my current unit is the millimeter).

What we can see is that those 2 groups are composed of the same objects (floor goes with the metal support parts) than in the previous exemple where I had the same gap.

But don't worry, it still is very impressive.
« Last Edit: August 09, 2006, 08:34:43 AM by Call me Bert' »

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #19 on: August 09, 2006, 09:02:30 AM »
Hello, it's me again, the  :lol:  beta-tester !

If I explose one by one any of the block entities, and the sub ones, then it works better.

My 2 groups seem to obey to 2 different basepoint families. It is strange....

deegeecees

  • Guest
Re: 3d to 2d views engine
« Reply #20 on: August 09, 2006, 10:25:31 AM »
WOW! What a matrix nightmare this must have been! Just what I needed for the job at hand here. Trying it out, will post if problems arise.

This is one of the reasons I never stray too far from the puddle.

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #21 on: August 09, 2006, 05:55:23 PM »
Nice one Bert, it shouldn't(?) matter I wouldn't think, it takes each part one by one and calc's and projects the hidden lines to world, I've never tested it on nested blocks though. Also be careful when picking your 2 points for the view direction, make sure you use polar/ortho as it will take your view direction literally and may produce odd results, most projected views are orthographic so this should ensure good results

dgc's, it wasn't too bad once I worked out what was happening. ARX has some excellent tools for geometry manipulation.

I'll give you guys another tip, if you store xdata with the application name "DCS_3D" you will have access to this data in the new linework (hidden or visible) for 'each individual part'. This is pretty cool and handy for item balloons etc. when detailing ;)

You can test this by using express tools to add and read the xdata. Add xdata to the solid, produce the 2d drg and check the xdata, it will still be attached, now that took some working out :)
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

DaveW

  • Guest
Re: 3d to 2d views engine
« Reply #22 on: August 10, 2006, 01:09:08 AM »
Getting nothing with the Command: dcs_2dplan

Select objects:
Hlr returned 1806 curves

Very interesting idea Mick. I went a different route. I have automated dview down to 2 choices and one click. All orthographical though. I have second version of it for dealing with sections, when you do not want features beyond in the original solids to bleed through from that hollow effect the dview gives you. So it runs dview as the first code, but also runs the section command and generates regions through the 3D solids. I move it a hair closer to the camera so that the region is not exactly on the clipping plane, otherwise it's a 50/50 toss up of bleed through. It is strictly a paperspace utility though. Each and every time the second code is run I generate a new layer called section 1, section 2, etc. Then freeze that section in every viewport in every layout, except for the viewport the user is working in. I attach every field of xdata I have to the regions too, 18 in all I believe, lol. If I had your skills I would have taken a different route. It seems to work pretty good, but it will only generate the dview / with section planes through 3d solids. I may be able to get to deal with solids nested in blocks, but I have not bothered with the one yet. Great work man. I am very impressed. There are quite a few possibilities with what you have created.
« Last Edit: August 10, 2006, 01:20:27 AM by DaveW »

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #23 on: August 10, 2006, 02:09:52 AM »
Thanks Dave.
What I have there uses virtual viewports with clipping planes set by the picking points (for sections). I will be setting up auto ortho views for my own stuff but this is a simple tool that anyone can get good results with and can be used in any number of ways.
What it does essentially is it grabs all the edges from the solids (it can be made to use 2d lines and cirles too), creates planes of each edge that are perp to the camera and a plane for each clip and splits the edges at each plne intersection. Then it's a matter of  working out whats behind what and projecting the linework left to the final plane.
Quote
Getting nothing with the Command: dcs_2dplan

Select objects:
Hlr returned 1806 curves
are you sure? make sure you delete/hide or turn off the solids layers, it projects the linework directly below the solid (or onto the current ucs plane but I'd have to check).

Quote
If I had your skills I would have taken a different route. It seems to work pretty good, but it will only generate the dview / with section planes through 3d solids.

I'd be very interested in your thoughts/ideas Dave, this is still very extendable. :)
I don't get what you mean by genarating the dview... though??(no dview used in code) The 2dview will generate all linework for for all objects selected to any depth as clip planes are not set, the 2dsection will only generate linework between the 2 picked points (p1 = near plane, p2 = far plane) I had thought of taking a slice through to add hatch to but I just haven't got there yet :)

Thanks for the feedback,
Mick.
« Last Edit: August 10, 2006, 02:12:28 AM by MickD »
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #24 on: August 10, 2006, 03:44:51 AM »
still have problems when blocks are configured with different base points but one thing I can tell is that your appli is something I ever expected.
I've been trying it on other projects and it is impressive.

I didn't understand what is the manipulation with Xdata, so sorry but do you mean that your appli sticks informations to the solids that had been selected ? I'm lost.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: 3d to 2d views engine
« Reply #25 on: August 10, 2006, 04:06:21 AM »
Bert.
You can put XData on the Solids and the appliation will transfer the same XData to the lineWork. .. really nifty :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #26 on: August 10, 2006, 04:12:38 AM »
I've never used 3d solids in blocks before, groups are ideal though as you can group assemblies and still change things without too much trouble. They don't hold together with cut and paste though but I have tools to make this a lot easier.

Bert, you can add some xdata, say a part number, to the 3d solid and when you convert it to a 2d drawing the information (xdata) is still attached to each individual line generated that was related to the original solid.
You can then query the new lines for xdata and it will be attached. This is very handy!

You can try it by using the express tools to add and get xdata. When requested for appname, use "DCS_3D" as that's the only app name it works with at the moment.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #27 on: August 10, 2006, 05:24:41 AM »
Understood  ^-^

I'm ready if you want to make it a shareware.
Depending on the price, if not too much expensive, I could offer to introduce it on a french forum where I am very (very) active.

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #28 on: August 10, 2006, 05:48:46 AM »
Thanks Bert, will do. I'd like to add some tut's to get people going quickly. This module would be free but I guess I could put a 'readme' in the download with some info on other stuff in the works that will be available for a very reasonable price, I don't plan on getting rich from this but a few dollars for beer or two would be nice :)
I'm glad you like it Bert, thanks for the feedback.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #29 on: August 10, 2006, 06:07:46 AM »
I'm glad you like it Bert, thanks for the feedback.

Anyone who use blocks, 3D and SOLPROF know what I mean.
Using DXB or copy-paste DWF or any other annoying technic is a nightmare.

I'm leaving my home (Strasbourg, France) tomorrow for 2 weeks of holidays with my girlfriend, my little Mercedes and 2 bikes for a little trip to Netherlands, Germany, Danemark (ever dreamed to see LEGOLAND and its museum !) and probably Sweden (Europe is a little place).

So I'm not able to test more but it is planned..... for sure. I have daily 3D presentations to make.