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 won't this solid subtract work?

Started by MarkX, January 20, 2012, 02:25:21 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

MarkX

I'm following an online tutorial. At the top of this drawing, I want to subtract the rod from the brace. Unfortunately, it doesn't cut the hole but instead leaves a hole with a plane stretched over it.

How do I fix this? How did this happen?

Note that I can successfully subtract the horizontal rod from the frame.

Thanks!
Mark

Rob S


Hmm, this requires the services of a full-fledged 3-D expert.

I'm getting the same results as you in both V20 and V21
User since forever

Bob P

There's something wrong with the "drilling rods".  They were apparently drawn by sweeping a plane. Neither reacts like a true solid.  I replaced them with new cylinders and the subtractions went well.

MarkX

Quote from: Bob P on January 20, 2012, 03:34:54 PM
There's something wrong with the "drilling rods".  They were apparently drawn by sweeping a plane. Neither reacts like a true solid.  I replaced them with new cylinders and the subtractions went well.
Yes, the tutorial called for making them by sweeping a plane. But the info box called the rod a "solid". Also, the lower rod was made the same way, and it worked fine.

Thanks,
Mark

Dr PR

Mark,

What has happened is this - when the upper cylinder was subtracted from the "U" fork the top surface was cut to make a hole but the resulting circular plane was not deleted. If you explode the "U" fork you can select this plane and remove it. Then you can select all of the parts and make them a solid again. Of course, you shouldn't have to do this.

I exploded the "U" piece and deleted everything except one side. Then I extruded it again to make another "U" shaped solid.

Then I created a plane and swept it around the Y axis to create another cylinder. The handle was on a corner of the plane.

Next I subtracted the new cylinder from the new "U" and it worked correctly! Go figure ...

****

Aha!

Select the top cylinder and go to Point Select mode (CTRL 1). Notice that there is no point in the center of the end surfaces where all of the lines intersect. This cylinder was created by sweeping a plane 360 degrees around the Y axis, with the handle set at the midpoint of the top edge and not at a corner.

Now select the bottom cylinder and note the point in the center of the end surfaces. This cylinder was created by rotating a plane around a corner and not a midpoint.

I created another "cyllinder" the same way as the small cylinder, subtracted it and got the same results Mark did - the holes are covered.

Here is an hypothesis: When you sweep the plane around a corner you create a cylinder where the plane passes through the interior of the solid only once. But if you sweep a plane around the midpoint of a side the plane sweeps through the interior twice - you get a cylinder that has two interiors in effect. Maybe even two cylinders merged as a single solid. It looks like DesignCAD is producing two circular planes where the cylinder passes through the surface of the "U" piece, and deletes only one to finish the operation - because there really should only be one.

When I exploded the small upper cylinder there was nothing but a single grid. When I exploded this grid there were two copies of every element. This must be the reason for the extra circular plane over the holes.

There was another potential problem - the end surfaces were made up of many "bow tie" surfaces instead of triangles. These are twisted rectangles, and I guarantee this will cause major problems with the solid Boolean operations!

The moral of this story is don't do that! Only sweep the planes around a corner and never the midpoint.

On the other hand, I guess you could argue that DesignCAD shouldn't create these "double solids."

Phil

DesignCAD user since 1987

MarkX

Hi Phil,

Quote from: Dr PR on January 20, 2012, 11:41:28 PM
There was another potential problem - the end surfaces were made up of many "bow tie" surfaces instead of triangles. These are twisted rectangles, and I guarantee this will cause major problems with the solid Boolean operations!

That was some great sleuthing!

Quote from: Dr PR on January 20, 2012, 11:41:28 PM
The moral of this story is don't do that! Only sweep the planes around a corner and never the midpoint.

This sort of reminds me of Ghostbusters:

Quote from: Ghostbusters as poorly remembered
"Don't cross the beams!"
"Why not?"
"Might destroy the universe!"
"Ok, important safety tip..."

Quote from: Dr PR on January 20, 2012, 11:41:28 PM
On the other hand, I guess you could argue that DesignCAD shouldn't create these "double solids."

Yeah, I think I would argue that. I was thinking as I was doing the sweep how nice it was that I didn't even have to worry about where I set the initial handle. Now I know. Maybe.

Thanks!
Mark

Lar

The bottom line is: when creating solids for boole operations make sure they are all 'proper solids'.

A proper solids consists of planes and/or grid surfaces only, is completely closed with no gaps anywhere, has no overlapping surfaces, every outside edge of every surface shares space with an outside edge of another surface and every point in the outside edges of every surface shares space with another point in the outside edge of another surface. It would be safe to make sure it is all on the same level.

Dcad does not check for proper solids (you can define any collection as entities as a solid) so it is up to the user to validate them.

Lar

MarkX

Hi Lar,
Quote from: Lar on January 21, 2012, 11:33:08 AM
Dcad does not check for proper solids (you can define any collection as entities as a solid) so it is up to the user to validate them.

Although you can define any collection of entities as a solid, shouldn't any standard process, like extrusion or sweeping, always produce a standard solid?

Just saying ...

Thanks!
Mark

Lar

#8
Mark,

Only extruding a plane can guarantee a proper solid and is automatically defined as such. ***edit: actually I 'm incorrect here, according to my own definition of a 'proper solid, posted above. The line should read 'Only extruding a plane away from itself can guarantee a proper solid, etc.' If you extrude a plane along itself you will get overlapping surfaces.***

Sweeping a plane does not guarantee a proper solid but is automatically defined as such (your sweeping from the midpoint of a plane is a good example).

Extruding or sweeping a line, an arc or a circle would produce grid surfaces that rightfully are not automatically defined as solids.

Sweeping a semi-circle 360 deg with the axis aligned with its 2 ends would produce a proper solid but is not automatically defined as such.

I guess a programmer can write code to determine whether a collections of entities is a proper solid or not but these guys sure didn't.

Lar

Dr PR

One really interesting thing about recent versions of DesignCAD is that it will clean up messy solids. This wasn't announced when it happened (V18 or V19?) and I discovered it by accident.

Sweeping an outline 360 degrees around a point is an easy way to create a solid with a complex outline - the typical goblet is a good example. However, this produces a bunch of triangles at flat ends instead of a single circular plane. The bunch of triangles make the file larger than a simple circular polygon, and to keep file size as small as possible I have made it a habit for years to explode such solids, delete all the triangles and draw a single polygon end. Then I collected the pieces and made them into a solid again. It is a lot of work but if you have large numbers of solids in your drawings it can reduce the file size (save/load times, shading time, etc.) significantly.

One day I used a swept solid with triangular ends with a sollid Boolean operation (Add/Subtract) at another place on the solid. To my surprise, and satisfaction, all of the triangular end facets disappeared and were replaced by a single polygon! I was planning to do that eventually and it was as if the program read my mind. A major unheralded improvement!

Try it. Sweep out a "U" shaped outline to create a solid. The use Solid Add to add another solid to it. Notice how the ends are cleaned up?

If you pay close attention you will see other slight solid cleanup events.

For example, with older versions of DesignCAD if you punched a hole in a flat surface with Solid Subtract the surface was actually split into two separate planes. In really old versions the edge between these planes was visible and you had to hide the edges manually (Edit/Hidden Edge). Then this was automated and the lines no longer were visible - but they were there. If you punched another hole in the surface it would be divided again.

In later versions you get only one plane wrapped all the way around the punched hole. Punch another hole then the program redraws the surface again as one plane that is wrapped around both holes. You can see this if you use the "Edit/Show All Edges" function. When I first discovered this I really tortured the program by punching a dozen holes into a single surface. If it is possible to surround them all with a single polygon it will!

I first feared this auto cleanup might cause problems with my carefuly crafted solids built up from many planes and grids. So far it hasn't, and in some cases it has actually improved them.

Phil
DesignCAD user since 1987

Bob P

Good improvements, but Not Perfect quite yet.

Try this:

Make a cube and subtract a cylinder from its volume.
Explode the solid.
Drag one of the faces that's been drilled, away from the original piece.

It's missing* one of the sides, even though it's defined as a plane and it shades correctly.

*The edge is still there!  You can snap to it.  It's just not visible.

MarkX

Hi Phil,
Quote from: Dr PR on January 21, 2012, 03:39:07 PM
Try it. Sweep out a "U" shaped outline to create a solid. The use Solid Add to add another solid to it. Notice how the ends are cleaned up?


I'm not sure what you mean by "U" shaped. I can envision this several ways. Could you post your u shaped solid with the problems and/or point out the anomalies in my attached drawing?

Thanks!
Mark

Lar

Bob is right. One of the edges of the drilled faces got caught up in the automatic 'hidden edge' that Doc talks about (collateral damage, I guess. To see be in wireframe or hidden line mode). To correct this go to Edit menu> 'Hidden Edge' (or 'by section'). the hidden lines will highlight yellow. You will also see the interior line from one corner to the hole (Note: this is actually 2 segments because if goes to the hole, goes around the hole then comes back to the corner, which is why 'hidden edge' won't seem to work on it - it will only hide one of the segments and the other will remain visible... you have to use 'hidden edge by section' to capture both segments. Click 'show all edges' and experiment). Click on the bad hidden edge with one of the 'hidden edge' tools to make it visible again.

Lar

Dr PR

Bob and Lar,

I suspect this is a holdover from the time when the surface would have been cut into planes, and not one. Then there would have been at least three or four hidden edges (if the surface cut was tangent to the hole there would be one hidden edge on the tangent polygon and two on the other polygon). I'd bet the hidden edge clean up routine wasn't fixed after the solid subtraction procedure was improved to create just one plane. The cleanup routine is looking for at least three edges to hide and it hides three edges, whether they need it or not.

Actually, the ability to create what Lar might call "improper solids" is a valuable feature of DesignCAD, but like all powerful tools you must use them carefully or you might "shoot yourself in the foot." For example, suppose you want to punch a hole in a grid surface. There is no tool to do this. However, you can select the grid and define it to be a solid with "Solid Define." Then you can use the solid Boolean operations on the grid.

For example, look at the attached image. The red object is not a cylinder - it is a grid created by extruding a multi-segment line created with the "O" function. It has no ends and is hollow. The blue grid was created with "Surface Connect." I defined both grids to be solids with "Solid Define" and then used "Solid Subtract" to subtract the red grid from the blue grid. This feature is extremely useful for cutting holes of any shape into irregular curved surfaces such as boat hulls.

As I have pointed out several times earlier this trick is not without it's consequences. If you explode the resulting "improper solid" you will discover that the blue surface is no longer a grid, but is just a  bunch of individual polygons. This causes the file size to increase significantly. But, would you want to try to create a surface with a hole in it like this manually, piece by piece?

Phil
DesignCAD user since 1987

Dr PR

#14
Mark,

Here is an exampl of the solid cleanup function - see the attached image.

1. I created the "U" shaped line (V) at the left. It is selected in Point Select mode so you can see the points.

2. This line was swept 360 degrees around the vertical axis at the handle (blue dot) with 36 "copies" in the sweep. This created the "gouda cheese" shaped grid.

3. As pointed out above by Lar, this object encloses the volume of a true solid, but DesignCAD does not automatically recognize it as such. I selected the cheese and made it a solid with "Solid Define."

Note: Perhaps DesignCAD should have an option to automatically define such objects as solids, but as it is it lets you decide on an individual basis. I can live with that.

4. I drew the blue cylinder with the "Cylinder" tool, and positioned it so it intersected the cheese surface.

5. After duplicating the two solids I used "Solid Subtract" to subtract the cylinder from the lower cheese.

****

Look at the top and bottom flat surfaces of the cheese. In the upper figure they each are composed of 36 individual trianglar polygons. After the solid subtraction DesignCAD replaced all of these triangles with a 36 sided polygon (plane) top and bottom.

When this first happened for me it was like a miracle! This was a feature I had long wished for.

I then exploded the perforated cheese and the top and bottom surfaces were true 36 sided polygons, not just the original triangles with hidden edges.

Phil
DesignCAD user since 1987