News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

DWG CONVERSIONS

Started by MIKEB, February 05, 2013, 09:56:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

minstrel

Quote from: Lar on February 06, 2013, 09:32:01 AM
This new way of dcad cutting holes is actually an enhancement that was requested by menbers of the forum. No one foresaw the export problem at the time.

Ouch!  That's painful, but who could of known?

******************

MikeB, I've also struggle with this issue far too many times.  Interestengly , my latest approach to confront this issue does not involve the use of solid subtracts at all!  It instead relies heaivly upon polygon subtracts of 2D entities that are then extruded, etc. etc...

This, to my surprise has totally conqured [so far anyway] the 'Queen Mother' of my personal challanges...namely, eliminating those nasty 'z-fighting' issues with exported dwg's imported into SketchUp.  As an added bonus dwgs also reload back into DCAD properly.

Attachments are just a tease until 'ScreenCast' in online...

Minstrel



Lar

#16
Excuse my SU-Ignorance, but what is z-fighting??

**********
I'm with Prl, on that 'method-4'. I create the solids in dcad, export to c4d and dynamically punch holes there. C4D even has a macro language (based on c++, but I find it very limiting... not a roll in the hay like basiccad) that I know enough of to have a macro handle all the punching (yet to be tidied up). Then I still duplicate the base solids to another layer and have dcad cut the holes.

Lar
ps: I should say that I like the new way of cutting holes (when not exporting) because it does a good job of cleaning up.

minstrel

#17
Lar,

Sorry, thought everyone fights this beast!

Z-fighting, as defined by Wiki, is a "phenomenon".  This occurs when two or more primitives have similar values in the z-buffer. 

In my words, It's just an unpleasant side effect with DesignCAD 'dwg' exports which are then imported into SketchUp when solid subtracts were used.

It's really easy to fix while within SketchUp but I prefer the files [dwg's]] to be exported properly from DCAD.

Plus, for those who are focused solely on DesignCAD usage, this no doubt exposes the source of all problems regarding dwg exported from DCAD that are re-loaded with solid subtracts no being properly honored.

And yes, it is 'light years' easier to perform solid subtracts while within SketchUp yet I am still eager to sort out DCAD issues and make it, as prl suggests, a real 'Topper' piece of software that deserves the best.

As far as the other solution...  Shampie for me, my first version 14 was 2D only. [Thought I would never venture into 3D space back then...who could have know?  :-\]  Then I jumped to version 17 3D.  So option #1, for me anyway, is a 'no-can-do'.

Minstrel

Edit: animation shows what it looks like in SketchUp...the subtracted cylinder is there...just needs to be 'dressed' up a bit....and note: this is not a SketchUp problem.

prl

Quote from: Lar on February 06, 2013, 12:54:49 PM
ps: I should say that I like the new way of cutting holes (when not exporting) because it does a good job of cleaning up.

The newer method for defining planes internally is really very fascinating and efficient.  I don't suggest we change it.  Only thinking of the export triangulation. 

For those that are interested, in the attached jpg, I've removed the front facet from the version 22 wall.  It is a single plane defined by a single line.  I've converted the plane to a line to a double headed arrow to demonstrate.  The plane starts and stops at where the arrows point (beginning of line, end of line).

The version 15 wall is defined by four planes (four lines).

Dr PR

prl,

I'm with you on this one. In newer versions the program tries to make the entire side of a rectangular solid a single plane. If you explode the solid the side behaves as you would expect it to like a single entity (because it is).

In older versions ,when you exploded a rectangular solid with holes in it, the sides became two or more separate planes. Furthermore, because the internal edges were hidden lines, when you tried to move the side pieces there could be some that were invisible! I have been bitten in the rear by this problem more times than I like to remember!

Also, older versions don't always break up a side with holes into nice regular polygons. The angles at which successive cuts were made in the surface were unpredictable, and seemed to change with viewing angle, or maybe just as a result of other odd polygons that were created by earlier holes. Often the results were a real mess.

****

In older versions I often exploded solids, deleted all the crap that the program had created on a side, and redrew it myself to use the minimum number of polygons. Then I collected all the pieces together and defined them to be a solid again. I have done this countless times. Imagine my surprise and delight when DesignCAD started doing this automatically!

****

The export problem comes because some programs do not allow polygons to fold back upon themselves with two edges common, and DesignCAD does. When these programs import DesignCAD's "perforated polygons" they don't have the smarts to render the complex shapes, so they just fill in everything within the polygon's exterior outline.

In this respect DesignCAD is far ahead of simpler programs like AutoCRUD and Shetchup.

Phil
DesignCAD user since 1987

Lar

Quote from: Dr PR on February 07, 2013, 11:58:50 AM
In this respect DesignCAD is far ahead of simpler programs like AutoCRUD and Shetchup.
Phil, as Prl pointed out in an earlier post, it's the way dcad writes dxf that causes the holes to be close up. Now I can't say if that's really dcad's fault or dxf's. I do know that dcad appears to be the only program that can create surfaces with more than 3 - 4 points and I think that's where the issue lies.

**********
Quote from: minstrel on February 06, 2013, 11:19:47 PM
Sorry, thought everyone fights this beast!

Yeah, of course... I had to deal with it on many an occasion. It's easy enough to fix. Just move one surface away from the other or create with no surfaces passing through others. In c4d I see it during editing (lower quality for speed) but for 2 flat surfaces during final rendering, it seems the object created first is conceded to, so rather than a z-fight it's a z-concession.

Lar

Dr PR

This "z buffer" thing is an artifact of the way the image is built up for the screen, one thing in front of the other. For the screen image the image z direction goes into the screen - it has nothing to do with the drawing's Z axis.

The image is built up in layers of a finite thickness. If surfaces are closer together than the minimum z buffer increment they will appear to be coplanar. You can see this by placing a red circle inside a green polygon, with both in the same plane. In effect, you are telling the program the surface has two different colors. DesignCAD (any program) will have a hard time reading your mind to decide which should be "on top." The result usually is red/green stripes across the circle.

If you raise the red circle a slight bit above the green plane it will display as solid red when viewed close up (short viewing distance). But if you back off some distance you will see the red/green stripes again. The reason is that the close up z buffer increment is less than the separation between the two surfaces, so the circle appears above the polygon. When you back out a long way the z buffer increment gets larger. If it is greater than the sepparation distance between the two surfaces they both get displayed as red/green stripes on the same surface.

If you separate the two surfaces far enough that they display correctly at a distance you may get unwanted shadows around the edge under the upper surface.

I posted more about this here:

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

Phil
DesignCAD user since 1987

DrollTroll

Turns out if you load the DesignCAD drawing into TurboCAD Deluxe (or Pro) and save to DWG, it converts those complicated planes-with-holes into triangles. Not the most efficient representation, but at least the result shows the holes correctly. So if TC Deluxe can do it, there's a good chance we can figure it out for DesignCAD as well.
25 years with DesignCAD

prl

Quote from: DrollTroll on February 08, 2013, 09:43:32 AM
it converts those complicated planes-with-holes into triangles.

Does the way DesignCAD generates planar regions with the single line/switchbacks approach have a mathematical name (or credited to someone)?  I have to admit it is pretty slick.

Bob P

Quote from: DrollTroll on February 08, 2013, 09:43:32 AM
Turns out if you load the DesignCAD drawing into TurboCAD Deluxe (or Pro) and save to DWG, it converts those complicated planes-with-holes into triangles. Not the most efficient representation, but at least the result shows the holes correctly. So if TC Deluxe can do it, there's a good chance we can figure it out for DesignCAD as well.

When you export to DXF, the planes-with-holes are converted into triangles.  Import it back into DC and you can export to DWG if that format is absolutely required.

Dr PR

Bob,

That didn't work for me. I exported to a DXF file and then imported the DXF into a blank drawing. The results are shown in the attached image. The center example still has plugged holes.

Phil

V22.1 XP Pro SP3
DesignCAD user since 1987

Lar

Quote from: prl on February 08, 2013, 10:31:06 AM
Does the way DesignCAD generates planar regions with the single line/switchbacks approach have a mathematical name (or credited to someone)?  I have to admit it is pretty slick.
What's the big deal. I did that the first time I ever need a hole in a plane, before I even understood that solids consisted of planes and grids.

I remember I did get it wrong the first time. Then I realized that once you complete the hole you had to go back in the reverse direction.

This was around 1992. It wasn't until a few years ago that dcad adopted that technique.

Lar

Bob P

Dr PR,

What does that look like in wire-frame mode?  For me, the only surfaces that are broken up into triangles are the ends with the holes.

Dr PR

Bob,

Here is the wireframe image. It is pretty strange. It looks like the bottom side on the right hand solid is also messed up - I didn't notice that before.

Phil
DesignCAD user since 1987

prl

#29
Quote from: Lar on February 08, 2013, 12:23:13 PM
What's the big deal. I did that the first time I ever need a hole in a plane, before I even understood that solids consisted of planes and grids.

It isn't an algorithm I'm familiar with.  Usually mathematical papers are authored on topics such as this provided I know what this technique is called.  The single boundary line polygon routine may be an interesting study for the "point inside opening" test.  That point would test as True for being "inside" the polygon exterior perimeter but also True for being "outside" the polygon boundary.

The nerd in me I guess. Here is a link for the general type of topic description I'm researching. http://pe.org.pl/articles/2013/1b/55.pdf