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.

Slice vs Solid Subtract vs Section

Started by samdavo, June 17, 2013, 04:52:14 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

samdavo

#15
Thanks Lar.
I'll throw this bit of evidence out there as well.
When I did that quick sketch of (Shaft + grease nipple) in reply #11, I noticed that the inside of the thread was visible on one side of the right-angled section;  whilst the other has a "solid" plane ??  This could be explained as the shaft being part solid and part skin-of-plate-metal-only (SOPMO).

Why it happens? don't know.

I can repeat/create that effect as follows :-
And I even make the topic simpler than the (shaft + grease nipple).
I zoom in on just the grease nipple.  ( ok there is a small red spherical ball at the tip as well).

Steps 21 to 25 are the same as 31 to 35, except for one apparently important difference,  ... step 23, which SOLID DEFINES everything (nipple, red sphere, and the plane of the sketch).  And this act seems to cause the SOLID SUBTRACT to give the hollow thread.  i.e. Solid Define causes the problem (here anyway).

In detail:-
Step 21. Sketch of the Section to be swept.   Make Plane.  There is a small red ball there as well.
Step 22. Sweep the Plane.
Step 23. Select everything, nipple, sketch and ball, and Solid Define
Step 24. Draw a solid box to be subtracted
Step 25. Subtract the box from the "Solid Nipple".
Note the error is there, i.e. there are two cut planes at right angles - you can see the inside of the thread on one side, (SOPMO), but you can see an opaque (solid) plane on the other.

ok, Alternative (better) method as follows :-
 
Step 31. Sketch of the Section to be swept.   Make Plane (all as above)
Step 32. Sweep the Plane (all as above).
Step 33. N/A  (i.e. Skip the Solid Define step).
Step 34. Draw a solid box to be subtracted
Step 35. Subtract the box from the "Solid Nipple".
Note there is no longer the SOPMO error.  There is however so "Z-fighting" on one of the new section planes - which at this point is brown with occasional streaks of yellow.

Step 36.  Drag the original brown MP-sketch off that "z-fighting surface", and both sectioned faces become yellow. Clean and apparently error - free.

Moral of the story?  (As I see it, sitting here, now; and assuming I didn't screw up somewhere) ...
1. Probably best to get rid of the plane once you sweep it - by dragging it out or moving everything else and leaving it behind - otherwise it ends up a potential z-fight; 
2. Probably best NOT to solid define (Ctrl+D) after the sweep if you plan to section the resultant "solid" this way.  (i.e. otherwise some of the solid may be plate-covered SOPMO voids instead).
3. In summary, probably best to follow steps 31 to 36.  ending up with a yellow sectional plane ( as per the box used for the solid subtraction - in this case anyway).

PS The red ball should not have been sectioned is step 35. (and it wasn't - ok so far); 
but SHOULD have been sectioned in step 25 ( when again it appears that it wasn't ??) instead it resembles a small multi-coloured spherical z fight? - curiouser and curiouser.


Lar

#16
Sam,

The fatal mistake was that the red curve entity that surrounds the red sphere got included when you did the solid definition. The reason that happened was probably because you drag selected the nipple, so the red sphere and the red curve got caught in the drag-selection. It so happens that the red curve and the red sphere were already solid defined together, so if you had even click-selected the sphere the curve would have come along. I'm assuming you did not want the sphere included in the solid definition of the nipple, which is why I assumed you drag selected.

If the curve was not included in the solid definition of the nipple and the sphere the subtraction would still have worked, since the sphere and the nipple do not interfere with each other (and both would individually be properly solids).

Thing is, you did not have to solid define the nipple (as you mentioned in step 33) since using a plane entity for the sweep resulted in a solid automatically. If you had used a vector for the sweep the resulting grid entity would then have to be solid defined. Note that versions prior to 22 may have not automatically created a solid when the plane was swept.

Tip: when selecting stuff to be solid defined that was created using commands like sweep (that involves a profile shape) that would eventually be involved in a boolean operation always open the info box, click the 'show details' button and examine the drop down list of the selected entities, looking for things other than plane and grid entities. If any are there deselect them. Conversely, before selecting you can open the selection filter and use it to select only planes and grid surfaces. Note however, that if the collection of surfaces do not form closed shapes and/or if the the closed shapes interfere with each other the resulting solid would be 'improper' (Lar's term, not dcad's).

Also note that some improper solids would still be booled as expected. Eg, if non-solid surfaces are involved in a slice they get totally erased (bug) but if they are solids they get sliced properly, so it is necessary to solid define them first.

The moral here is that smart as dcad appears to be it actually has absolutely no intelligence. It only caries out instructions and the results depend on what it started out with (aka "garbage in garbage out") and whatever bugs are written into the code. It is up to the user to learn these circumstances and work accordingly (aka "buck ya toe as you go").

Lar

Dr PR

Lar brought up something that you must always watch for. When you sweep or extrude a line the original line may remain after the extrusion/sweep. This line will appear as a bright highlight at the edge of the resulting surface when you shade the drawing. If it becomes incorporated into a solid the line can cause all sorts of problems if the solid is used with the solid Boolean operations.

The moral of the story is to always eliminate the template lines (or move them to a "junk" layer) after an extrusion or sweep. When possible, do not use lines or curves but draw polygons directly with the "Plane" command.

You can check for such residual garbage with the "WireFrame" view by deselecting the "WireFrame Renderable Objects" option. The resulting view will not show solids, grids or polygons. Only simple lines and curves will be shown, allowing you to see the residual garbage lines in a drawing.

Phil
DesignCAD user since 1987

magic

Hi Phil,

Quote from: Dr PR on June 19, 2013, 10:02:42 AMWhen you sweep or extrude a line the original line may remain after the extrusion/sweep. This line will appear as a bright highlight at the edge of the resulting surface when you shade the drawing.

Actually in Sweep you can just uncheck the Keep Original box.
It's a kind of magic!




samdavo

Wow, thanks Lar, Phil, and Magic
Some gems there.
Quote from: Lar on June 19, 2013, 06:57:16 AM
Sam,

1. The fatal mistake was that the red curve entity that surrounds the red sphere got included when you did the solid definition. ...
2. because you drag selected the nipple, incl red sphere and the red curve
3. the red curve and the red sphere were already solid defined together.
4. I'm assuming you did not want the sphere included in the solid definition of the nipple.
5. the sphere and the nipple do not interfere with each other

6. Thing is, you did not have to solid define the nipple (as you mentioned in step 33) since using a plane entity for the sweep resulted in a solid automatically. If you had used a vector for the sweep the resulting grid entity would then have to be solid defined.

7. Tip: when selecting stuff to be solid defined  etc
Lar
spot on as to the red curve in the sphere.  Long story - I needed to find the centre for sweeping as an afterthought - wouldn't normally have a circle as well as a sphere  - should have removed the circle, BUT  I thought I could "sweep it under the carpet" by doing Solid Define of sphere and circle, which I THOUGHT (wrongly obviously) would somehow amalgamate and neutralise such loose ends - bad housekeeping there, sorry)

But apart from that,
A. I misunderstood Solid Define completely;
B. I should have unclicked "Keep original" in the sweep command
C. I must pay more attention to sweeping correctly - rather than sweeping "loose ends" under the carpet.
D. And I should not have solid subtracted the yellow box from the sum of (red sphere and gold nipple), - i.e. the initial summing of these red and gold solids into a combined solid was wrong - made worse by the fact that they don't touch.

In more detail...
1 to 5.  I included sphere with nipple intentionally in the Solid Define - stupid now that I understand Ctrl+D better.

6. " If you had used a vector for the sweep the resulting grid entity would then have to be solid defined".   Wow - I CERTAINLY didn't expect to get a "solidgold-solid" if I swept a line and Solid Defined. 
I would have expected a "gold-plated-solid" (= and just the gold skin only, void internally) which is still a solid. 

7. Great Tips , both Lar and Phil.  More caution required on my part.

I enclose the result of
a. getting rid of the sphere altogether
b. just sweeping the vector,
c. with keep original unchecked, and
d. then solid defining.
Perfect result, (albeit dead simple example) -  thanks again for your collective time and knowledge.

Steps 41, 42, 44 show VC (vector convert), W ( sweep vector), and slice (XY plane through centre).  Result = gold plating only.

Steps 51, 52, 53 and 54 are the same except for 53 = solid define. Result - solid gold.

samdavo

#20
PS  I'm really surprised that that is solid gold (after sweeping a vector, plus solid defining).   If I extrude a line, - and solid define - it becomes a thin-bladed biscuit cutter,  and infobox still calls it a "solid", albeit a thin-skinned one. - maybe the fact that the nipple is enclosed makes it solid-solid?

I enclose steps 61 to 63.
61 = the same vector as just swept
62 = extruded ( no tickbox option offered in this case to keep or delete original - I leave it there, no biggie)
63 = solid define.
no need for 64 = slice, because you can see that it is extruded gold-skin only = prism without ends ( 2 cents).

Anyway, FWIW, that's why I'm surprised that I got solid gold above.    Assuming you care what surprises me lol.

PS I have only 2 attachments, so I'll throw in the sort of 3D stuff I occasionally do for the workshop - all eveolved from the 2D drawing by extruding up from the plan view view by the height of the line given in the elevation.

Note that, rather than section it later, I only extrude up 3 quadrants.  Dead simple (and easier than section).

Also , sometimes I intentionally extrude up a vector rather than a plane - that way you can see the boltholes better (and easier than transparency) .

Finally I add a map of the world with Antipodean pairing of Gibraltar and Whangarei, and also (extremely approx.  Perth and Bermuda).  I'm half way between Whangarei and Perth (= Sydney) :)   
cheers

samdavo

Here's another example of sectioning :)
(and box mapping - jpegs attached. )

samdavo

#22
PS  plus this one along the way (Tools\Texture Mapping \ Box Mapping  settings)

and this fake set of three planes - with earth moved out of the way.  As Archimedes said,  "Give me a lever and a place to stand and I will move the earth".

samdavo

#23
This one might be of more practical use. (again, box mapped onto those planes).
(And no reason this cross hatching couldn't be used for the other sections above.) 

Actually I have a question if anyone knows Box Mapping (beyond lesson 1, as in my case).
But the third attachment shows that I had the Box Mapping set to its default, namely "Box Front".  How then does it ALSO strip the "Box Left" and "Box Bottom" ? 

And do it neatly? Not like the streaked effects when the map is stretched over the bumpy face of the earth. 

Anyway, it's good that it does it neatly ( three planes as a group ok)

samdavo

#24
 Actually I have a question if anyone knows Box Mapping (beyond lesson 1, as in my case).
But the third attachment shows that I had the Box Mapping set to its default, namely "Box Front".  How then does it ALSO strip the "Box Left" and "Box Bottom" ? 

And do it neatly? Not like the streaked effects when the map is stretched over the bumpy face of the earth.  (see attachment)

Anyway, it's good that it does it neatly ( three planes as a group ok)

Lar

Sam,

You often refer to ''solid-plated" and "solid-solid" or something such. I'm not sure how you distinguish the two but no "proper" solid in dcad's digital realm is "solid through and through" like a solid in the natural universe would be. Only the surfaces exist and it is actually hollow inside.

What makes a "proper' dcad solid is the assumption that if a boolean operation is performed on the solid then dcad would be able to cut away the unwanted parts and then create new surfaces to close the openings the cutting away would create. To do this it is necessary for there to be no gaps in the original overall surface. Many times I had to create solids by drawing planes for the surfaces and carefully snapping the points together. However, this is a guaranteed way to create an "improper" solid because no matter how careful I was, zooming in extremely close to points would reveal 99% of them do not meet, leaving many gaps in the overall surface. The majority of times dcad would still slice the surface "as expected" but if a solid is complicated chances are dcad would leave out one or two of the "expected new surfaces".

Another important aspect about a "proper' solid is that when shaded it can be 'smoothed', so as not to reveal every crease in the surface and so cut now on the number of segments required to make the surface appear smooth when shaded.

Remember though, as far as dcad is concerned a solid is a collection of entities that were somehow solid defined, ie, either by the user, in a macro, or in a command (such as 'sweep' or 'box', etc). Dcad does not check the validity of a "solid to be booled or not to be booled".

Lar

prl

#26
Quote from: samdavo on June 19, 2013, 02:56:04 PM
A. I misunderstood Solid Define completely;

"Solid define" will always be misunderstood by most users.  It is one of DesignCAD's most flexible and most unclear commands.  Its original purpose and proper name should be "Define multiple solids into one solid".   But since it doesn't do error checking on the selection set, you can define most anything as a solid.  Gives you the power to create a gem or garbage.

Also "solid define" in no way validates or cleans up "dirty" or malformed solids. 

And I would say the normal user creating something in 3d with boolean operations should not be using it.  Consider it an advanced command with a "medicinal poison" sign on it.



samdavo

#27
Quote from: Lar on June 20, 2013, 06:16:54 AM
Sam,
You often refer to ''solid-plated" and "solid-solid" or something such. I'm not sure how you distinguish the two but no "proper" solid in dcad's digital realm is "solid through and through" like a solid in the natural universe would be. Only the surfaces exist and it is actually hollow inside. ...
Lar
Ahh that makes sense as well. Thanks
The above options of "closing planes" refer   
a) both left and right (masquerading as solid),
b) left only, (eg the original shaft+nipple - enclosed;  or the nipple only as at step 25); and/or
c) neither (= obviously hollow).

By closing planes I mean the ones that would cover up the inside of the thread.  If you can see the thread, then there is no closing plane.

I've already posted examples of both or neither -
Here's the example of left only; 
and even ( as per my first drwg of the shaft done in a hurry) where HALF the right side is paned-up, but the top half of the pane (above the red bolthole ) is missing.
Interesting times.  As Lennon would say "most peculiar mumma". 
cheers and thanks for that explanation.

PS I note that cross hatching with that zebra crossing doesn't work so neatly when the three planes to be hatched  are not equal - needed some rotating.  That hatching was obviously done after I exploded the solid and manipulated individual panes.   But the "half -full solid" on the left is what I ended up with when drawn in a hurry - without any manipulation (see reply #11 -shows it in hidden line removed mode).  The right side "section-plane" stops at the red hole. (2 cents). 

PS So referring to that "half-full solid",  is that half full?  or half empty? :))


samdavo

Quote from: prl on June 20, 2013, 09:06:46 AM
"Solid define" will always be misunderstood by most users.  It is one of DesignCAD's most flexible and most unclear commands.  Its original purpose and proper name should be "Define multiple solids into one solid".   But since it doesn't do error checking on the selection set, you can define most anything as a solid.  Gives you the power to create a gem or garbage.
...
And I would say the normal user creating something in 3d with boolean operations should not be using it.  Consider it an advanced command with a "medicinal poison" sign on it.
thanks prl.
that "gem or garbage" - I want to live in a world where the rule is "garbage in, gem out" :)
then again - a bit of pressure and /or grit never hurt anyone.

after all that's how you get diamonds and pearls respectively.

PS as for the yellow and black stripes I found on the internet - I think they imply 'Hazard' yes? :)

Dr PR

To follow up on something prl said, DesignCAD doesn't enforce any rules, as far as I can tell. This means you have total freedom to create impossible things. While this may seem like a good thing (and it often is), you can easily get yourself in trouble if you don't understand the consequences of your actions. And since none of this is documented, new users always learn the hard way.

In DesignCAD "solids" are just a bunch of objects collected together to behave like a single object. This is no different from a "group" except that some operations work only on things that are defined as solids. You can define anything to be a solid - even a single line segment.

Legitimate solids are volumes of virtual space that are bounded by planar polygons, with no gaps between adjacent polygons. There is nothing "inside" solids - just the surrounding polygons. These objects seem to always (?) work correctly with the solid Boolean operations.

Users can create "illegitimate" solids in several ways:

1. Use "Solid Define" to make a bunch of objects a "solid" that do not actually meet the definition of "legitimate" solid given above. These may have open sides, gaps between polygons, or non-planar polygons.

2. Use "Point Select" mode to move points in a solid. This may seem like an easy way to patch gaps between neighboring polygons, but do this with caution! This may create non-planar polygons. This is easy to do if the solid has flat sides with more than four edges, such as pentagons or hexagons. All edges/points should lie in the same plane, but you can move them out of the plane and the program won't complain. However, non-planar polygons will render in strange ways, and if a solid with non-planar facets is used with the solid Boolean operations all bets are off! Also, operations like Surface Intersect, Contour Lines, Slice and other functions that must find the intersection of surfaces may produce strange results.

DesignCAD actually uses two triangles to represent each four-sided facet of grids, with the hypotenuse hidden, so messing with points on a grid surface may not actually create a non-planar grid polygon.

3. Use "illegitimate" solids with the solid Boolean operations. The result may be an even more "illegitimate" solid.

****

DesignCAD's "illegitimate" solids WILL NOT work for creating 3D stereolith models used in 3D printing.

****

The safest way to work with solids is to use the "subtractive method" - do things the way you would do it in a machine shop. Start with a large legitimate "work" solid that was created with one of the solid tools (Box, Cylinder, Sphere, etc.). Then use Solid Subtract to remove bits and pieces using additional "tool" solids that were also created with DesignCAD's solid tools. Think of it as if you were using a milling machine or lathe to remove material from the work solid. As long as you use solids that DesignCAD has created with its solid tools you probably won't have any problems.

Use the other solid Boolean operations cautiously, and only with "legitimate" solids.

If you must assemble a solid from bits and pieces ("additive method") it is up to you to ensure that the result is "legitimate." If it isn't, IT'S YOUR FAULT so don't blame the program!

Phil

PS: I learned the hard way.

DesignCAD user since 1987