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.

Why does this subtract destroy my solid?

Started by MarkX, May 07, 2013, 10:05:42 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

DrollTroll

#15
Solid 1 on layer 1. Solid 2 on layer 1. Current layer is 1. Solid Add (or subtract) 1 and 2. Easy case, all pieces *should* go on layer 1, right? (DesignCAD fails on this one, at least sometimes).

Solid 1 on layer 1. Solid 2 on layer 1. Current layer is 2. Perform a boolean on solids 1 and 2. Should the new solid be all on layer 1, or on layer 2?

Solid 1 on layer 10. Solid 2 on Layer 11. Current layer 1. SolidAdd (or subtract) the two solids. Where should all the pieces go?

Current layer is 1. Solid 1 composed of a grid on layer 5, a plane on layer 11, and a plane on layer 7. Grid is red, planes are blue. Solid 2 composed of  6 planes on layers 12-17, all green. Solid Add (or subtract) 1 and 2. Where should all the pieces go? What colors should they be?
Different users have different expectations for these things. I'm willing to try and make reasonable changes, if we can all reach some kind of concensus (and it can be reliably programmed without blowing something else up).
25 years with DesignCAD

Dean

#16
Can you create a pop up window that asks what layer you would like to put the "New" entity on?
DesignCad 3D max 2021
Lenovo 17.3"Laptop Intel(R) Core(TM) i7-9750H CPU @ 2.6GHz/Turbo boost 6 cores 12 threads.16GB memory.SSD 256GB/HDD 1TB 7200 Rpm.Nvidia Graphics GeForce GTX 1660 Ti 6GB
Windows 10 Home 64 bit

prl

#17
Quote from: DrollTroll on May 08, 2013, 12:36:23 PM
I'm willing to try and make reasonable changes, if we can all reach some kind of concensus (and it can be reliably programmed without blowing something else up).

Based on Dt's example, I created a DC file with those solids.  It is attached.  Because I intend to try these test cases in SU, TurboCAD, and AutoCAD and see what they do, I decided to label the layers specifically, layer 1 is string Layer1.


Edit:

I have also attached the same model backsaved to a SketchUP version 5 file just to be sure it will load for others.  Folks using the free version 8 can do the solid additions. 

Dean

Prl,
Using your attached file >
Sketch up 8 pro >
Creates a "new group" entity on the current active layer yet maintains the layers of the solids used, in any of the six solid tool functions.
In Dcad 3d max 22.1  solid subtract >
solids that exist on different layers > creates a "new" solid with multiple layers.
Solids that have the same layer > creates a "new" solid with the same layer. In Dcad the active layer has no influence.

> I like the idea of having the option of a target layer for the "new" solid yet maintaining the original layers of all entities.
DesignCad 3D max 2021
Lenovo 17.3"Laptop Intel(R) Core(TM) i7-9750H CPU @ 2.6GHz/Turbo boost 6 cores 12 threads.16GB memory.SSD 256GB/HDD 1TB 7200 Rpm.Nvidia Graphics GeForce GTX 1660 Ti 6GB
Windows 10 Home 64 bit

prl

#19
Thanks Dean. I agree with you on the SU 8 Pro results.

To do something similar in TurboCAD or AutoCAD, I needed to convert the DesignCAD solids to ACIS types and those only want to exist on one layer.  No multilayer solids.

Dean

Prl,
In Turbocad > part tree enabled > when doing a solid subtract on ACIS object the "new" solid goes to the minuend's layer and all entities maintain their original layers > accessible in the part tree. The active layer has no influence when performing the Boolean operation.
Design cad file in Turbocad >
Tc reads entities as surfaces > Boolean subtract on Tc surfaces > the "new" Tc surface goes to the minuend's layer and since there is no "part tree" with surfaces the original layers of the subtrahend used in the Boolean are lost with the subtrahend un-less you enable "don't remove subtrahend" then the subtrahend maintains its original layer, active layer still has no influence.

With the booltest dcd file I tried export–import a dwg  in Designcad. Then re-defined the grids as solids. The results were the same. Design cad continues to create a "new" solid on multiple layers if the minuend and subtrahend are on different layers.
DesignCad 3D max 2021
Lenovo 17.3"Laptop Intel(R) Core(TM) i7-9750H CPU @ 2.6GHz/Turbo boost 6 cores 12 threads.16GB memory.SSD 256GB/HDD 1TB 7200 Rpm.Nvidia Graphics GeForce GTX 1660 Ti 6GB
Windows 10 Home 64 bit

Lar

#21
Now that I had a chance to reflect... in my experience dcad normally only puts booled parts on layer zero with the 'slice by curved surface" command. When it does with other boole operations it's because something is illegit. I checked Marks black solid, exploded it, vector converted one of the plane sides then clicked the 'make plane' button. Dcad informed that the vector was not all in the same plane and asked me if I wanted to flatten it. That was the problem. The planes were not flat so dcad freaked and dropped the new booled planes on layer zero. It's amazing that dcad recreated these planes with them not being flat.

As for what layer/color booled things should take:
In any boole operation that require 2 solids, a certain amount of each surface is "kept" and some amount may be "gotten rid of". What dcad normally does is the part of the surfaces that is "kept" keeps its own properties.  This way, everything works out. I'm ok with that. This is how Cinema4d works, except that the bools there are not pernament. If (or should I say "when") dcad incorporates dynamic bools at least that part of the operation won't have to be recoded.

This same principle could work for 'slice with curved surface' but for 'slice' (edit-- I forgot 'section trim' and 'section cutoff', which are similar to 'slice') there is no slicing surfaces so maybe there should be an option to either use the majority layer/color (as dcad does now) or let the new surfaces take the current layer and active color. The 'slice by curved surface' command could have these options too.

Lar


Dr PR

#22
DT,

(Edited to correct a mistake)

This is an extremely complex problem. Here are my thoughts after having lived with this problem for years:

1. All of the solid Boolean operations should operate consistently in the same way. Solid 1 modifies solid 2. The result is always something new.

2. The resulting object should be on the layer of the second solid.

Reason: This is the only outcome that makes sense with "Solid Subtract." Drilling a hole in a solid should not change the layer of the solid.

Reason: The resulting solid should not be on more than one layer. If one layer was locked and the other unlocked the part on the unlocked layer would not be selectable. If either part was on an invisible layer only part of the solid would be visible. These are problems with the Layer 0 bug now.

3. The resulting material should be that of the second solid.

Reason: This is the only result that makes sense for "Solid Subtract." Drilling a hole in an object should not change the material. *

Reason: All Boolean operations should operate consistently so the second solid determines the final material.

Reason: It makes no sense to create a solid with multiple materials. That is the problem with the current Aluminum material bug. *

4. The transparency of the resulting object should be determined by the transparency of the second solid.

Reason: Drilling a hole in a glass object with "Solid Subtract" should not change the transparency of the glass.

5. If a solid has a texture mapped to it, and it is used in a solid Boolean operation the resulting texture should be the texture/material/color of the second solid. Or maybe the texture should just be discarded?

****

6. The resulting color(s) should be the colors of both solids - pretty much like what DesignCAD does now except when it screws up and makes some materials "Aluminum."

Reason: This will preserve the ability to create sectional slices with "Solid Subtract" with the cut areas the color of the first solid and the rest the color of the second solid. This is a nice feature of DesignCAD.

However, this will require some thought. The Shading Dialog "material properties" controls how materials appear in shaded images.

If "material properties" is enabled in the Shading Dialog and a solid has a defined material other than "Default" the native color of the material is displayed, regardless if some other color has been assigned to the object.

You can assign the color green to an object with the "Pearl" material assigned. The object will not be green if "material properties" is enabled but will display the pearl color. If material properties is disabled it will appear to be the "Default" material with a green color.

The resulting object should always be a single material - that of the second solid. So if you subtract a "Steel" material object from a "Ruby" material object, the sides of the hole should be "Ruby" and not "Steel." This is the way the real world works.

However, if you disable "material properties" neither ruby nor steel properties are displayed. In this case you could have a red object with a gray hole through it.

Perhaps only the "Default" material should display different colors on different surfaces.

****

7. Color by layer really complicates the issue. Personally, I think layer colors make no sense in 3D drawings, but apparently some people try to use them.

The Boolean operations should still operate as described above, and the color by layer functions should only change the display of the objects, and have no effect on the object properties. Moving objects between layers should change none of the object properties.

****

* In DesignCAD it is possible to create several polygons with different colors and materials and then lump them all together with "Solid Define." This is a powerful, if peculiar, feature of DesignCAD. It allows us to defy any rules we make for the solid Boolean operations. For example, a solid may have multiple materials, multiple colors, and be on multiple layers.

What do we do if such a solid is used as the second solid in a solid Boolean operation? Which color/material/layer will be used for the final solid? Just use the first color/material/layer that the program finds for the solid?

Thinking about this hurts my brain!

Phil
DesignCAD user since 1987

Dr PR

Lar,

I do not think the "stray facet" (Layer 0/Aluminum material) problem is that simple.

You can make solids using the basic cylinder, box and other functions, and then use them with "Solid Subtract" and "Solid Add" and get parts scattered all over the place. Usually the stray facets end up on layer 0, but not always. I once found stray facets on a high numbered layer. However, this was long after the Boolean operation that created the stray facets and I don't know what all happened between the creation of the stray facets and when I discovered them.

So far all of the stray facets I have seen have been the "Aluminum" material.

The problem seems to occur when you modify a grid surface. Remember, a simple cube made with the "Box" function consists of a four-sided grid capped with two polygons. Likewise, a cylinder is a cylindrical grid capped with two circular polygons. These are "legitimate" objects created by the program. Use a solid Boolean on either of these and you may end up with stray facets if the grid is modified.

This is especially true of solids that have an irregular grid surface. Create a grid with "Surface Connect" and make it a solid using "Solid Define." Then subtarct a cylinder from it and you will almost always get stray facets. There were no "illigitimate" opjects involved, but the program screws up anyway.

The same is true for objects that have irregular surfaces that were created by ordinary processes. For example, subtract a sphere from a cube - the resulting object will have a complex grid surface. Then use this solid with a solid Boolean operation and you are almost guaranteed to have stray facets.

If you use the solid Boolean operations often enough in a drawing you eventually get to a point that every Boolean operation seems to generate stray facets.

****

Wierder still, if you find an object with stray facets and use the Info Box to redefine the layer and material, the object will behave normally for a while. But I have a complex object (fire strainer) made up of many grid surfaces that I created long ago that I have copied into several drawings. Somewhere along the line while I was creating it stray facets appeared, and I corrected them with the Info Box. Now occasionally one of the copies will revert to stray facets on layer 0 with the "Aluminum" material! This happens in drawings where the object was just copied, and not originally created. It almost ALWAYS happens if I mirror the object, but usually it is the original and not the mirrored object that develops the stray facets! But sometimes it is the mirror copy that has the stray facets. However, not all copies in a drawing revert to stray facets - at least not all at the same time!

I have attached the drawing and an image. The red surfaces are all supposed to be the "Default" material. Occasionally about half of the complex "Y" surfaces will revert to the "Aluminum" material. This is the part where the larger part angles down to the ball valve and the smaller part diverges horizontal to the brass hose fitting.

I can't guarantee this copy will revert to stray facets, but you can examine it.

This has happened in two drawings subsequent to the original drawing where this thing was created. If you look at this picture you will see an example near the bottom center. There are several fire hoses to the left of the strainer that also have parts that have turned into aluminum. This is a nasty bug!

http://www.okieboat.com/Copyright%20images/missile%20battery%2028%20Mar%202011%201024%20C.jpg

These things were a bear to draw and I really don't want to have to do it again!

Phil
DesignCAD user since 1987

prl

#24
Quote from: Dr PR on May 08, 2013, 10:39:37 PM
1. All of the solid Boolean operations should operate consistently in the same way. Solid 2 modifies solid 1. The result is always something new.

2. The resulting object should be on the layer of the first solid.

Be careful with your wording.  In DesignCAD and many other programs, for subtraction, we pick the subtracting solid first,  subtract solid 1 from solid 2.  The newly reformed solid 2 (actually some other number, say 3) using the original solid 2 layer is the logical layer if you are using the concept of the subtracting solid is just a volume (say an anti-solid, negative solid, void solid . . .  :) ) and its layer is irrelevant.

For addition it is less critical though,  add solid 1 to solid 2.   But with regards to the final layer for the newly formed composite solid, you may get some debate saying for consistency you should again only use the original solid 2 layer or some who say a combination of both original solids layers (think welding two different metals together).

samdavo

#25
Quote from: Dr PR on May 08, 2013, 11:33:45 PM
I do not think the "stray facet" (Layer 0/Aluminum material) problem is that simple.
... Phil
Phil
can I ask please - or rather make this proposal re this  fenomen... phenomma ..effect. 

How difficult is it to totally correct the problem?   I would claim it is dead simple.

eg I found I could draw that gravity mesh under the earth+moon.
then shoot a hole through it ( solid subtract a pencil-like cylinder from the "mesh-as-solid")
then find I had a stack of ALements (layer 0)

I enclose dcd and jpeg

1 = multiple layers , wiremesh blue = layer 1, wiremesh white = layer 0
2 = ditto with the layer o changed to layer 1
3 = ditto with all changed to colour white  (ok colour blue would have been easier to follow the logic , but done now, and we move on)
4 = the mesh changed to "solid define"  (again all white)  - HEALED!

I also enclose a jpeg of those elements (and ALements) exploded with Dempsey's pushapart
(2 cents)

But in summary, I would claim you can easily repair it (on those rare occasions it happens)

samdavo

#26
PS I shot a hole in that original mesh (just trying to get that effect intentionally - small hole at 3 oclock on that surface) ...
As I say, I think it helps visualise the shape of that 3D mesh - and personally I like it .

LOL
ok - and I go on to do it all over again  (REPEAT the procedure) ...
i.e. having separated that mesh into layers zero and 1

I then repair it ( as per steps 1-4 in previous post)

then shoot another hole in it ( see the blue cylinder) = step 5

then get THE SAME layer 0 pattern !!! - step 6
how cool is that !!   :))

(2 cents)

Lar

#27
Quote from: Dr PR on May 08, 2013, 11:33:45 PM
Lar,
I do not think the "stray facet" (Layer 0/Aluminum material) problem is that simple.
etc...
When strays facets happen it a sign that something is not legit. Taking the "subtract from a grid surface" example: a grid surface is not a legitimate solid unless it is completely closed, like a sphere. If a not-completely-closed grid is solid-defined then it's an improper solid, to coin my own term. No telling what dcad will do with such things. Luckily in works out ok most of the time.

Try this example:
1] Turn on layer 0. On layer 1 create a cyan cylinder primitive (so we know it's a proper solid) so that the flat surfaces are in the xz plane and we can call them top and bottom. Then create a blue box primitive on the same layer as the cylinder so that it intersects half way into the side (the grid surface) of the cylinder only. Duplicate these two off to the side. Move the duplicated box up so it intersects the top and side of the duplicated cylinder...
2] Solid subtract both blue boxes from their respective cylinders. Both resulting solids should be on layer 1, consisting of red and blue surfaces...
3] Undo back to the original cylinders and boxes...
4] Select both cylinders and in point select mode move any one of the top points upward a good distance. This would make the top plane surfaces improper planes, since all of their points are not flat..
5] Solid subtract the boxes from their respective solids...

The results would be that the solid-1 would keep all the layer and color properties of the originals but the 2nd solid may only consist the side and the bottom of the cylinder

6] Now undo the 2nd solid subtract and move that point of the cylinder downward a lot but still out of line with the other top points, so the top plane is still improper.
7] Now solid subtract this 2nd set...

The result would be that the top improper plane is black, alum. and on layer 0.

This demonstrates that dcad actually has a certain tolerance for improper elements but beyond that it will refuse to replicate the improper elements.

You will also see this intolerance if you try to 'extrude along a curve' and parts of the curve have a smaller radius than the size of the profile. Dcad will simply skip extruding along these parts of the curve.

Lar

Dr PR

prl,

You are absolutely correct! I must have had a teen-age moment.

It is the second solid that remains after a "Solid Subtract" and it is this solid that should be the determining object for layer and material. I'll edit my original post.

Phil
DesignCAD user since 1987

Dr PR

#29
Sam,

As I said in my posts:

1. It is not a rare occurrence. In some drawings it happens on EVERY solid Boolean operation.

2. Although you may think you have "repaired" the problem, it can pop up again at a later time.

This is especially true if you duplicate/copy or mirror a "repaired" solid. Either the original or the copy may end up with scattered facets.

3. I agree with Lar that there is something about particular solids that is not "legitimate" (especially non-planar polygon surfaces) but it isn't always the user who creates these problem surfaces. You can use DesignCAD functions as they are supposed to be used and still get problem solids.

If you look at the geometry of some surface intersections - such as the intersection of a helical surface with a curved surface - you will realize that a perfect intersection would involve an infinite number of surfaces. Therefore, ANY solution will be imperfect. This requires polygons that are not planar (it cannot be done correctly even with less than an infinite number of triangles). This is probably the cause of DesignCAD originated "illegitimate" surfaces.

Phil
DesignCAD user since 1987