I am using OpenCASCADE for a new 3D modeling software, using
a custom OpenGL rendering.
Current results are good, in fact, but I am trying to improve
the OpenGL look of shapes, so that they look as in other 3D
cad like SolidEdge etc.
A problem is that, if you do BOOLEANS on two shapes (ex, fuse
or subtraction), in case of cohincident faces you end with
the result which is shown in this image:
You see what I mean: I would like that merging two
cubes with coplanar faces, you end with a longer face and no
original edges where there were the original edges of the
coplanar faces.. This happens in most 3D kernels: why not
Is there a way to avoid this? I tried to use the
BRep_Tool::Continuity(edge,faceA,faceB) to understand if
an edge is C0, otherwise I could make it invisible, but
looks like this does not work as I want... Look at the
following image: after FUSE there are edges which are
more that at least C1, but I always get C0 from
BRep_Tool::Continuity(), so I do not know how to set
You can test this effect by your own, if you modify the
OpenCASCADE sample "Topology Operations", for the FUSE sample,
just by changing coordinates so that the two cubes are
collinear on some faces, for example...
TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(50,200,70);
TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(-30,150,70);
TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2);
Maybe there is some kind of healing to upgrade two
coplanar surface to become a single one, loosing the
edge(s) in between, but I do not know... maybe I am
going too far and this feature is not yet in Cascade?