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

#30
Quote from: Lar
A. ...   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.

Quote from: Dr PR on June 20, 2013, 03:47:38 PM
B.  Even a line can be a solid
C.  Use "illegitimate" solids with the solid Boolean operations (and) The result may be an even more "illegitimate" solid.
D. DCAD's "illegitimate" solids WILL NOT work for creating 3D stereolith models used in 3D printing.
Phil
Lar and Phil , Many new topics.

1. I had never before adjusted "smooth shading" for instance, 
2. Nor considered adding missing facets manually (compare patching a tyre) - as mentioned back there somewhere.
3. Nor tried solid subtraction segregation using a biscuit cutter (not sure why I thought of that - just to see what would happen I suspect, since you have pointed out that solids are actually hollow anyway).

Firstly I checked, and sure enough you can get the Smoothest Shading with View\Display Types \Smooth Shading (dead simple). 

Then I patched the worst of the missing facets ( eg the purple one on the sectioned face.

Then, Starting with D.  I am not going to do the 3D printing , so I'd like to check the difference between...
C.  ... "illegitimate" and "more illegitimate". 

B. and A. Just trying something new, but I figured a biscuit cutter is a solid, so what would happen if I did a "Solid Segregate" using the 12 sided green polygon ( dodecagonal?) head of that shaft with a blue hex-head-biscuit cutter.  And sure enough, I end up with a set of facets that, provided I am  careful (compare a stamp- collector with tweezers handing $1000 stamps) , I am able to delete the unwanted facets, and end up with the blue hex-head.

so (A.) indeed an improper/illegitimate "solid" can be booled.

Finally, I tackled a small facet where there was z-fighting going on.  (see the common flat plane between the nipple flange and the top of the shaft head - where there are both green and gold colours - second jpeg).   Furthermore a shape identical to this was missing higher up the flange of the nipple.

So, INSTEAD of just deleting one of other of the z-fighting facets ( strictly y-fighting) , I set selection to "gold only", selected the gold layer, and moved it from where is was residing in common with the green face, to where it made more sense.
plus added a couple of gold section facets as well.

Finally, I made the entire "shaft plus nipple" (including these new facets) into a Group rather than a Solid - because I don't see further solid operations being required.

Basically I'm amazed as to how flexible all this becomes (when you can carry out running repairs like this).

PS This was more about experimentation - the other thing I have obviously learnt is to do it much better from the getgo next time.  Thanks for the invaluable lessons there.  Cheers

PS the third attachment ("z fighting resolved") shows the blue-dot handle in use to raise the gold plate to where it makes more sense.  Seriously Heath Robinson, but still encouraging, and my understanding is infinitely greater.  That's another beer I owe you both/all.   

samdavo

Last few jpegs ... (just to summarise)
a. firstly the original dodecagonal headed shaft with both flat and smooth shading.
b. the sectioned planes on the nipple manually added ( still pretty approx., but good enough).
c. and the final result.

... as they say,  "photos Before and After" the multiple makeovers / experiments mentioned above.

prl

Quote from: samdavo on June 21, 2013, 06:23:09 AM
Basically I'm amazed as to how flexible all this becomes (when you can carry out running repairs like this).

I like this too.  I find myself exploding malformed solids and then like a surgeon removing the cancerous surface and grafting new ones.  Then I select all the pieces of my "patient" solid and "bob's your cous" I'm back in business.

Also lately while working with SU, I find myself exploding DesignCAD solids and selectively fixing the "winding" order of surfaces.  This eliminates reversed normals and improves renderings.  I can do that in SU too, but programmatically I can do it quicker in DC.

samdavo

#33
prl - not sure what you mean by winding order -
(and another hint to DT, but your comment on the potential for really constructive interplay between DCAD and SU seems to be "going through to the keeper" - or to the catcher if you play baseball I guess)...

Anyway you mention winding - so here's another exercise - to satisfy my own curiosity if nothing else.
Call it a "bool on a Band-Aid" I guess.   Converting the shaft into a bolt.
Fooling around with boats last week, booling around with bolts this week :)

Quote from: samdavo on June 21, 2013, 06:23:09 AM
I made the entire "shaft plus nipple" (including these new facets) into a Group rather than a Solid - because I don't see further solid operations being required.
Sorry that was yesterday ...
So first I convert the Group of shaft + nipple to a Solid with Ctrl+D.  There are 12 facets around the circle.
I draw a Toblerone profile - Plane (as against Plain = no-almonds please).  The pitch is 12 btw.
It becomes a thread cutter for this exercise, i.e. I sweep it 10/12 of a circle,  with a "vertical offset"  of 10/12 of the pitch , i.e. 10.
And subtract this from the shaft.
You end up with a bolt, albeit the screw-thread doesn't go all the way round, so not sure how that would work.  Let's call it a screwed up bolt.  And the thread treats the pink bandaid the same as the rest.  i.e. DACD appears to have forgiven me.

GAMBLING ON Z-FIGHTING.
Note :- I only swept 300 degrees from the vertical plane of the pink/magenta face.  If you look at step 74, the white flat plane and the pink are coplanar.  As such I wouldn't have been surprised if that gave me some z-fighting on the triangles so formed in that plane.  But it didn't.

Let's say I GAMBLED that I wouldn't get it.  Because sometimes, to make sure it follows through is time-consuming ( bit like the simple holes I deleted from the solids extruded from plan view on another thread) - and got away with it.

If I was to ask another question of you generous gentlemen - but would the fact that I didn't sweep the thread the  full 360, and more particularly didn't "follow through" that pink plane ( the golf pro would advise - and maybe Phil would advise) - and DIDN'T get the z fighting...

Then what's
a. the general opinion out there /
b. call it a vote /
c. or maybe just a call to your collective experience..

... that the z fighting would return to haunt me in the future?
 
PS This is easier to demonstrate with that flat plate with the holes on another thread - where the subtracted solid doesn't break the surface(s), hence I post another jpeg of that to refresh your memory(ies).      I realise that Phil said it was bad practice to do this sort of gambling.

BUT... (and it's a bit but) ...
IF you get away with it, is there any chance it will come back to sting you?


And Phil, I repeat - please don't ask me to draw a battleship - I mainly work with stuff in the range 1kg to 1Tonne (1000kg for the Americans among us).

Actually, now I think of it , there was a totally unexpected effect of a z-fighting surface or two once when I exported to SU (posted on another thread). 
Reply #5 on
http://forum.designcad.com/index.php?topic=5013.0

So I guess - maybe?- the ghosts-of-errors-past linger?  And it's not just a case of " a clean set of facets have no memory of errors past" (??)   

Or maybe that was a problem in the exporting aspects of dcad software to DWG?  or is the importing software of SU from DWG?

But if you stay with dcd format, does it matter if you gambled, as long as you have clean facets to show for it?

samdavo

#34
prl
you have mentioned Section Trim a few times ( hotkey D).
I enclose the various outcomes.

Firstly you can select
(Trim) INSIDE the box selection only, (1);  or
OUTSIDE (2).

You can also choose
SELECTED ENTITIES ONLY *Y* ; or 
or not *N*.
Note that all options that refer to "Selections Only" ticked - mean that (just) the yellow spheres are selected.
F1 Help says "Selected Entities Only: If this option is checked, only selected entities will be affected by the Section Trim command."

Finally you can choose
INTERSECTIONS ONLY  **Y  ; or
or otherwise  **N.
F1 Help says "Intersections Only: If this option is selected, only objects that are touched by the trim boundaries are cut away. Anything completely inside the cut region and not touching the sides will be left intact. "

Hence typical options include
INSIDE, both other boxes unchecked (1NN)
or
OUTSIDE, both other boxes checked (2YY).

81. = two yellow spheres with a blue box including part of each - and a red sphere between them (within the blue "line-only-box);  and a green sphere off to the side (outside the blue box).

82. = 1NN or 1NY,  These give the same result.  The "Y" in 1NY means that "Intersections Only" is ticked - I don't see any difference between 1NN and 1NY on this occasion (?).  Red ball is deleted although it should not have been surely ??, i.e.  Help said ... "Anything completely inside the cut region and not touching the sides (should be) left intact. ?? "

83. = 1YN x 2, yellow balls selected, hence the red ball is NOT deleted.  Otherwise the same as 82.
Note that you have to do this twice because, although you choose both yellow balls, it only deletes a chunk from one at a time. Hence I call this 1YN x 2.

84.  = 2YN x 2, again yellow balls selected so cutting will not happen to red or green balls (nor to the text in the drawing etc).   But the rest of the yellow balls ( outside the blue line-box) is deleted.   Again you have to do this twice, "trimming" one yellow sphere at a time.

85. =  2YY.   Almost the same as 84, (and again both yellow spheres selected) - but sometimes some of the lines of the diabox are also cut. (?)

Summary - slightly different to solid subtraction of a box, (some positives there);  but the fact you have to do some steps twice detracts from its attraction (imo).
I also don't think that "Choose INTERSECTIONS ONLY" works very well - or at least I can't understand it if it does.  ( 2 cents)    You get the same result with 1NN as you do with 1NY for instance (??) 

PS There is a red plane which gets into the act there in option 82.   The only red around at the time was the red sphere some distance away ??   The layer of the red sphere was 2,  the layer of the red plane ( after the trim) is 3, which was the working layer at the time (albeit all layers editable).   I couldn't even begin to guess why that red turned up there (?)

samdavo

Here's what I mean when I say you need two (or maybe more) bites at the cherry for some of those steps, namely the ones requiring "trim selected entities only" ticked.

In each case I start selecting the two yellow spheres.  Feel free to try to get it to trim both at the same time.  I couldn't get it to work  ( 2 cents).

prl

#36
Quote from: samdavo on June 21, 2013, 05:00:02 PM
prl - not sure what you mean by winding order -

All surfaces are mathematical planes consisting of 3 or more points.  A surface normal is generated by using three points of that surface.  Whether the surface normal points out of the solid or into the solid depends on the winding order of the points (clockwise or counter-clockwise).  DesignCAD especially with grids, isn't consistent.  A solid will have surface normals pointing both in and out of the solid. Example is a typical DesignCAD cube.  It is two capping planes on opposite sides with a grid stretched between them. The capping planes both have surface normals pointing in the same direction because the winding order for DesignCAD grids requires this, otherwise the grid will twist from plane 1 to plane 2.  But this means one surface normal points into the solid, the second away from the solid. This causes problems in third party rendering programs.

samdavo

#37
ahh yes, and that would explain why one end of each cylinder ( after export to SU) is colourless - all as you explain on the parallel thread about CSG). thanks.

PS Interestingly, (comment from the peanut gallery) the "Solid Addition" seems to sort that out.   

PS :-
Quote from: prl on June 21, 2013, 08:59:51 AM
Also lately while working with SU, I find myself exploding DesignCAD solids and selectively fixing the "winding" order of surfaces.  This eliminates reversed normals and improves renderings.  I can do that in SU too, but programmatically I can do it quicker in DC.

So prl, this is exactly what you mention on the parallel thread yes? - rotating facets?  there you do it SU, but you say you can do it in DCAD.  So , do you have to sort each of those "blue" planes individually ? e.g. the anaemic blue ones on the SOLID INTERSECT of Cube and sphere individually. Wow.    Is it as difficult and/or time consuming as that in SU?

btw,  I understand you are talking orientation of planes / facets ok?   And just speculating if the order of drawings solids might have an effect as well?   BUT... lol ,  the sphere is also "anaemic blue".  I realise that drawing a cube can be done in a clockwise or anticlockwise direction (or rather LHS or RHS) - but ... Hard to imagine how I could have drawn that sphere differently (i.e. just two points, centre and radius, lol :) )

PPS I imagine the reason you like DCAD rather than SU for this unwind/flip/rotate operation has something to do with the ease of writing macros?  Maybe multiple rotations concurrently?

samdavo

#38
Just for completeness on the options, but as for Solids\Cross Section,  I posted most of this on another thread, but if there is a hole in the section, DCAD will have some minor problems.

THe enclosed dcd has a cylinder passing through a sphere, and three sections taken at latitude 15N, Equator and 15S.
1. = the result of Solid Subtraction
2 = Cross Sections taken, circular, (and subsequent to this stage, these 3 layers are separated using Dempsey's "pushapart" macro in Y dirn).  These planes have elliptical holes, BUT they are covered with manhole covers.
3a. =  Converting the planes of circle  and ellipse to solids, and using SOLID SUBTRACT, you get the holes.  This is probably what I would do.
4a. = Alternatively you can use Edit/Cut Plane, after changing the elliptical hole to a vector ( using VC)
Trouble then is that you have unwanted "hidden edges", and the manhole cover is still there, but also split in two (in each of the 3 layers/sections). 
5a. = Delete the manhole covers = (shoe print shape), and  Use Edit\Hidden Edge to "remove" the lines - strictly temporarily hide them (which is why I personally don't much like them).  I also find them to be unstable.
6a. = Back to 4a for a minute - Just for fun, I tried to weld the two plates in each layer  together,  i.e. instead of that Hidden Edge (Removal), I used   Edit\ Selection Edit \ Convert \ Weld.   Trouble is this gives a completely unexpected result.  The circular plane becomes a vector - and the elliptical hole becomes a plane (??)
Cheers
sam   
(edit - I have re-posted the dcd - some corrections necessary. )

prl

#39
Quote from: samdavo on June 22, 2013, 05:17:27 PM
the "Solid Addition" seems to sort that out.   

Once you start adding or subtracting solids with grids, DesignCAD usually creates a resulting solid composed only of facets (planes).  These seem to be more consistent with regards to winding order.  I often explode a solid with grids into a solid with only facets for this reason.

Quote from: samdavo on June 22, 2013, 05:17:27 PM
the sphere is also "anaemic blue".

A sphere is a pure grid (no planes) that when exploded apparently has ALL the surface normals pointing the wrong way.  Easy to fix in SU when ALL are wrong.  Also in case this isn't generally known, the DesignCAD dwg/dxf export routine explodes all DesignCAD grids into faces (DC planes) before exporting.

Quote from: samdavo on June 22, 2013, 05:17:27 PM
I imagine the reason you like DCAD  . . .  has something to do with the ease of writing macros?

100% correct.  I can whip out basiccad code easily.  Plus I know what it can and can't do.  Mathematically I can get it to most everything.  Occassionally there will be some missing key hooks into the DesignCAD drawing database.

Lar

#40
Quote from: prl on June 23, 2013, 05:14:13 AM
  Also in case this isn't generally known, the DesignCAD dwg/dxf export routine explodes all DesignCAD grids into faces (DC planes) before exporting.
This may not be always so. When I export a solid (with no hole) to Cinema4D it comes over with the same 'point/surface anatomy' as in dcad. Ie, dcad's Planes come over with seperate points and dcad's Grid facets come over with shared points (except that dcad's planes are triangulated). My dcad dxf export is setup as '3d Faces (rectangular mesh)' - I don't know if this has something to do with it. My c4d dxf import is setup to combine surfaces on the same layer and of the same color to be a single c4d polygon entity.

In C4D a 'polygon' is equivalent to a dcad proper solid but a c4d polygon is an entity, as opposed to a dcad solid being a definition. However, in c4d points and surfaces are 2 different things. The points are the foundation. A surface is defined by which points it uses (points can exist without surfaces but surfaces cannot exist without points... if you can delete a surface the points remain but if you delete points the surfaces that use them get eliminated). This was very important for me to understand since I export to c4d a lot (and it did take a while to grasp that something had to be figured out).

Lar

prl

Quote from: Lar on June 23, 2013, 09:01:03 AM
Quote from: prl on June 23, 2013, 05:14:13 AM
  Also in case this isn't generally known, the DesignCAD dwg/dxf export routine explodes all DesignCAD grids into faces (DC planes) before exporting.
This may not be always so. When I export a solid (with no hole) to Cinema4D it comes over with the same 'point/surface anatomy' as in dcad.

Hi Lar,  I use the "rectangular mesh" too.  In the past I had dissected an exported dxf file and I thought that is what it (the export routine) did.  I'll look into it sometime again.  Thanks for the info about Cinema4D.

samdavo

Quote from: prl on June 23, 2013, 05:14:13 AM
Once you start adding or subtracting solids with grids, DesignCAD usually creates a resulting solid composed only of facets (planes).  These seem to be more consistent with regards to winding order.  I often explode a solid with grids into a solid with only facets for this reason.
So prl, referring to that sphere = the one that ends up anaemic in SU ...

could it be that, if I had exploded the sphere in DCAD into a grid
and further exploded the grid to a set of facets,
and made that a solid with Solid Define,
then that would have changed the "winding" of the facets to get the colour back in its cheeks ? 

Also you say you often do this - for what purpose please ?

prl

#43
Sam, regarding the sphere, once you explode it into facets, you can simply select it all, do a "Solid define" and try importing to SU.  If it comes in backwards, go back to DesignCAD, select the sphere you just made, and use "reverse points" to change the winding order.  Or in SU, select the sphere and right click and "reverse faces".

As to why I bother,  for visual things, initial ideas, renderings and pretty presentation things with shadows etc., I use SketchUP and the various 3rd party programs for that program. I, however, most often build the 3d model in DesignCAD.  Knowing that I'm going to SketchUP, I will fix up the DesignCAD model as best I can to reduce the problems in SketchUP.  Backwards faces in SketchUp leads to incorrect materials and rendering problems.

Lar

Quote from: samdavo on June 25, 2013, 06:35:27 AM
could it be that, if I had exploded the sphere in DCAD into a grid
and further exploded the grid to a set of facets,
and made that a solid with Solid Define,
Sam, in your scenario it is not necessary to Solid Explode then later Solid Define. Just select the Sphere and (regular) Explode. This would convert the Grid surface mesh into individual Planes while keeping it defined as a Solid. Solid Explode and Explode are two different functions.

It is good to keep in mind what happens to an entity type when it is Exploded.
   Some examples:

  • Grids facets become individual Planes...
  • Dimensions become Arrows, Vectors and Text...
  • Multi-Line Text become individual Text lines...
  • Text lines become Vectors...
  • Hatch patterns become Vectors...
  • Symbols and Blocks become regular entities...
  • Planes and Vectors don't explode, and dcad would tell you so...
  • If Groups and Solids are Exploded only the explodable entities would be exploded and dcad would not say anything about the unexplodable stuff...

Lar