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.

Boolean operations on Surfaces?

Started by SManMTB, May 19, 2015, 10:55:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SManMTB

Are there any functions similar to the Boolean operations for Solids that work on Surfaces?

It is possible to hack this by converting the (curved) Surfaces to solids with 'Solid Define' but the results are let's say a bit unpredictable  ;).
To get the end result as one would expect to get from a Boolean performed on a surface it's then necessary to explode the resulting solid to a grid and remove the 'excess' remainder of the unwanted result from this hack.
The drawback of this is that the trimmed end result is not a surface anymore but rather a large amount of triangular planes which are impossible to extrude into one nice solid.

Ideas?

Thx.


Edit:
Another side effect of this is that when exporting the result of all this to OBJ there seems to be duplicates of all the vertices (the corners of each polygon). This shows up when importing the OBJ to Blender where this surface is extruded.



samdavo

#1
Sman,
I will try to contribute and/or advance the discussion by asking what you mean by "surfaces"?  i.e. do you mean "V22 grids and/or solids",   or "V24 surfaces"?
cheers m8

PS Just to show you that DCAD is capable of showing a "V22-surface-as-part-of-a-solid", I enclose a PNG screen snap, using a macro called qs2.d3m,  and ALSO a command called edit\hide edge by section - which removes a lot of the wireframe lines that I suspect are causing you problems - just my guess (?)  cheers 

PS I have added a boolean operation, namely to drill a cylindrical hole through the tyre. 

PPS Apologies if I have misunderstood your question - and I am starting to wonder if you are in fact miles ahead of me lol.

SManMTB

A Surface in this case is an object created by for example the 'Surface Connect' tool. In the Info Box this data type is called 'Grid' as opposed to a Solid (cube for example) which shows up as a 'Solid' in the Info Box.

So the question is if there are 'legal' or 'native' Boolean functions for this data type?
The 'Define Solid' hack does kind of work (with extra elbow grease and) but not in a very good way. The result 'look' fine in DCAD but.... well... the resulting data type is less than desirable. Maybe there is a way to convert between a selection of many objects of the type 'Plane' to a 'Grid'?

The hide edge command is worth looking into so THX for that!  :D

Not sure if this actually is the new v.24 surface which I btw have no clue what it really is and how it is different from a normal surface.
The settings are shown in the screen cap.

cheers  :)

samdavo

#3
PS I also have no clue of the V24 surfaces lol - I'll step back and let others explain :) They are new to V24 I believe (and I'm pretty old fashioned lol) - cheers

PS To be honest I can't even remember how I achieved this "stitched seams" effect  - a combination of
a) wait till you get to my age, and
b) a preference for sails rather than anchors :)

Dr PR

SMan,

Your observations are correct with respect to classic DesignCAD grid surfaces. "Surface Patch" and "Surface Connect" both produce grids.

A grid is a regular surface array with a N x M configuration, where N = the number of segments along one side and M= the number of segments along another side that is more or less perpendicular to the first side. A chess board is an example of a grid where N = 8 and M = 8.

The DesignCAD grid is a simplified way to define a surface. It cannot define an irregular surface or a surface with holes in it. When you punch a hole in a grid it "disintegrates" into a lot of rectangles and/or triangles, and the file size becomes much larger. Once Humpty Dumpty is broken you can't put the pieces back together again.

****

V24 introduced a new type of solid entity, the "Solid Surface." It is not made up of grids like classic DesignCAD solids. You can punch holes in a Solid Surface, and it retains it's identity. If you use "Solid Explode" on a Solid Surface what results is identified in the Info Box as "multiple." As far as I can tell you cannot break up a solid surface into individual polygons.

Solid Surfaces are supposed to export in a better behaved manner that the traditional solid or grid.

In "Options/Options/General" you will find an option for "Use surface representations for solid operations." If you select this option the results of any solid Boolean operation will be a solid surface.

So you can first use "Surface Connect" to create a grid. Then use "Solid Define" to bless the grid and make it a solid. Now if you subtract a solid from the grid with "Solid Subtract" the resulting surface will be a Solid Surface. It will not be broken up onto a bunch of rectangles and triangles.

****

In the attached image the green Solid Surface was created with "Use surface representations for solid operations" enabled. The blue grid surface was produced without "Use surface representations for solid operations" enabled.

Try using the Solid Surface and see if that solves the export problem.

Hope this helps.

Phil
DesignCAD user since 1987

SManMTB

Phil (PR),

Thanks for explaining the 'Solid Surface' data type in simple terms. Unfortunately using this type didn't solve the issue completely. Doing the Boolean operations worked fine. Solid Intersect with a Solid Surface and real Solid resulted in the desired shape but two weird things happened.

1). DCAD 24 crashed hard the first time. Here is the dump for it:
--------------------------------------------------------------------------------------------------------------------
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   Dcad24.exe
  Application Version:   24.1.0.0
  Application Timestamp:   546f02cb
  Fault Module Name:   StackHash_3355
  Fault Module Version:   6.1.7601.18839
  Fault Module Timestamp:   553e8808
  Exception Code:   c0000374
  Exception Offset:   000cea5f
  OS Version:   6.1.7601.2.1.0.768.3
  Locale ID:   1033
  Additional Information 1:   3355
  Additional Information 2:   3355591ebac7e7ded08cbec7dc23fa91
  Additional Information 3:   c9ff
  Additional Information 4:   c9ff18d3939cd2962fcaf7fb531cba87

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\windows\system32\en-US\erofflps.txt
--------------------------------------------------------------------------------------------------------------------

2). The shape of the resulting mesh were still triangles..... but not shown as such in all four views! The main window showed triangles and the other smaller windows showed rectangles.  ???
OBJ Export does not work with 'Solid Surfaces' just as mentioned in the 'random crash thread' so dxf export was the only option.
The main issue still remains when working with this exported mesh. It contains duplicates of many Vertices and Edges in non predictable locations when imported to Blender and this (unfortunately) makes it impossible to use. In Blender, a 'Vertice' is a point in space and an 'Edge' is a line between two of those points. These are two of the three basic building blocks for a Mesh object in Blender. A 'Face' is the third which is a plane between three or more 'Vertices' (3 points gives a Tri face and 4 points gives a Quad. Any more than that and it becomes a N-gon) or a plane between three or more 'Edges'.
It would be easy to handle exact duplicates (in location) of 'Vertices' but in this case there must be duplicates created with such a ridiculously small offset to each other that it is practically impossible to detect and remove.

The Export dxf settings and the weird mesh type are attached.


Phew, a lot of writing but it seems that DCAD is not suitable for this kind of work (or at least it is pushing the limits of what will work). It's to bad because the interface and drafting functions are logical and easy to use in most cases.
Drafting the basic outline for a 3D model in DCAD for export to Blender works fine for simpler geometries but once there are more complex surfaces created with Boolean functions it falls short.....  :(

In this example the final model is supposed to become a propeller where the pitch, diameter and rake defines the general surface shape of the blade on the high pressure side of the propeller (calculated with a script) and a final Boolean operation defines the final shape of the blade.
The next step is apply a blade profile (cross section) to the radial sections based on this 0-thickness blade generated here.

Thx again for the support on this issue. As it looks now it's time to move past DCAD for this task.

cheers,
Christian

DrollTroll

#6
Unlike Blender and many other 3D modelers, DesignCAD doesn't separate geometry into points, edges, and facets. Each entity in DesignCAD has its own, separate set of points; if two planes share one edge, each plane has two separate points for that edge. This will be especially noticeable if you have had to edit a grid -- it then becomes a truckload of planes, each with its own coordinate set.

Another point about grids; the point structure is such that each grid facet is essentially a "quad"; however, there's no guarantee that the points of any given "quad" are coplanar; hence the OBJ Export macro converts each facet of a grid to triangles -- the points of a triangle are by definition coplanar. To do otherwise would risk occasionally bizarre rendering artifacts in some programs attempting the use the exported OBJ file. DesignCAD can handle non-coplanar quads when rendering, but not all programs will do so.

Most 3D modelers that work on separate collections of vertices, edges, and faces  (Lightwave and Cinema4D, in my direct experience, probably also Blender and many others) have a way to merge duplicate points, usually also providing a method to specify a tolerance for how close two vertices must be to be considered duplicates. Usually this should take care of the matter. Without access to your actual DesignCAD file, I can't comment further on what other issues may be involved.
25 years with DesignCAD

SManMTB

That makes perfect sense and explains why the mesh is un-workable in Blender. Big thank you for that clarification!

Joining vertices usually takes care of this problem but it is not practical to check every intersection and merge vertices by hand. There is a feature to automatically join vertices located in the same location but it doesn't seem to work in this case but I'll look into any tolerance settings for this. You're absolutely right that this is very likely to resolve the issue.


DCAD file with blade attached. On my machine this one looks just like the screenshot with Triangles in one window (Hidden Line Mode) and Quads in the three other (Wireframe mode).
The hub is a regular 'Solid' and the resulting blade is a 'Solid Surface'.



SManMTB

#8
Modeling in Blender is done best with coplanar quads. The editing functions just works better. That's why I need something that can create a mesh with quads and not triangles.

Edit:
Turns out that the latest tests actually didn't create duplicates (as far as I can see) and that the main problem is the triangular mesh. It makes it harder to work and the results are not as predictable as with a mesh with quads. The exported normal were also all over the place in some cases.
The latest test (dxf export) looked good however. There are a few option in the dxf dialog I don't understand...

Exporting a 'Grid' created with 'Surface Connect' to OBJ with the macro results in quads. If only the majority of the resulting mesh could be exported in quads with the OBJ macro then I think DCAD can still be used but it is probably easier to script all this with Python in Blender instead.

DrollTroll

It's never been DesignCAD's mandate to preserve quads, but rather to stay as close as possible to the original shape.
In this case you've sliced a grid, resulting in a bunch of no-longer-"quadded" planes.

What you can to to try and get back to a grid is draw four curves -- one along the base of the propeller, one across each of the "ends" of the propeller, and one across the curved edge of the propeller, then use Surface Patch to generate a grid across those curves. You'll still get the triangulation when you export to OBJ, but it shouldn't be nearly as extreme.

Here's a rough draft of what I mean -- I draw four curves on layer 30 across the ends and across the front and back of the blade, then used Surface Patch to generate a surface between them on Layer 29. You can see the new blade lies pretty close to the original.
25 years with DesignCAD

SManMTB

That surely looks like it is the way to go in DCAD. It preserves the overall shape of the blade while keeping the quads intact. Definitely worth looking into further.
Great job and thanks!  :)

Had another idea that might work and that is to find the intersecting curve of two surfaces with 'Surface Intersection'. That should give the same/similar result as drawing by hand. Then 'Surface Patch' that.

Yes, I know the quads are not a 'priority' shape for DCAD to preserve but was hoping there was a way to keep the majority of the surface as quads with a few triangles at the edges. That would have been fine.

Now the big job is to put all this in a script that is generic enough to work with just a few input parameters.

SManMTB

This thread can die in peace now I think.  ;)
With the feedback from all here in the thread it very clear what can and can not be done in a simple way. Just the details about the 'Solid Surface' entity was worth the keyboard time.  8)

So what is the deal with 'Quads' anyway some think. Well, it's just a convenient format to model with. Take a look at this 54 min time-lapse  showing the design of a generator from start to finish. It goes by quick but it definitely shows a lot of tricks.

Every software is good at a few things and needs to be used as intended. DCAD have a nice work flow and tools to draft with precision. It's still part of the tool box.

https://www.youtube.com/watch?v=Ofup7iBipxw

samdavo

#12
Will check that out.
Meanwhile, just for fun, here's a representation of the shells of the Sydney Opera House with alternate quad elements deleted.

Also one which demonstrates the principle of how the various girders were theoretically able to be cast with the same curvature (eg from one mould, with variable stop-ends)  - effectively from the same sphere ( 2 cents)

SManMTB

That Opera House is a recurring topic here for some reason.  :)

samdavo

#14
PS I can see how those quad elements (on a sphere) could be (approximated as) coplanar - I still have to get my head around how these could be as well :)  Hyperbolic paranoid thingos. = two way curvature.

PS the blue (cyan) one is drawn using Surface Patch - more accurate than the magenta one, which was drawn with Surface Connect (on this occasion) - cheers