[Gmsh] Connecting faces.

Mark van Doesburg mark.van.doesburg at technolution.nl
Thu Apr 16 16:24:41 CEST 2009


Hello Christophe,

I've attached the sources including a makefile. It currently is a
standalone program which translates a BRL-CAD model into a BREP file
which gmsh can read.

To compile it, you need to have BRL-CAD installed.  You also have to
modify the makefile to compile, because the paths are in there.

If you want to embed it into gmsh, you only need OCC_Connect.h and
.cpp, I didn't have the time to do this yet. If you build it into gmsh,
BRL-CAD is not required. Using it should be something like:

	TopoDS_Shape shape; // existing OCC shape, used for input
	OCC_Connect connected;
	for(TopExp_Explorer p(shape,TopoDS_SOLID); p.More(); p.Next())
		connected.Add(p.Current());
	connected.Connect();
	TopoDS_Shape result=connected;

Known issues are:

1.  Faces are merged if they share the same edges. This should only
    be done if these faces are never seperated by more than a small amount.
    (The code is there, but it doesn't work)
2.  Cutting a sphere does not work. (OCC bug, the program will crash)
3.  If the cutting wire is a closed wire with less than three edges, the cut
    is ignored. (OCC bug, with workaround which is ignoring the edge)
4.  Boolean operations fail in some cases. Cutting a solid ring by a box
    should result in two partial rings. In some cases (it depends on
    the location of the box) the result is a partial ring with two zero
    height boxes. (OCC bug)
5.  TopOpeBRep_ShapeIntersector does not find all intersections. I added
    a very simplistic algorithm to add the ones missing in my test models.
    It's highly unlikely this is good enough.
6.  Tolerances are not updated (TODO)
7.  Locations and transformations are ignored, both in BRL-CAD (which needs
    to be fixed) and OCC (which may not even be a problem, but I need to
    look into this)
8.  Leftovers from previous attempts are still there.
9.  A lot of the debugging info is not conditional.
10. Most (known) problems in the code are marked with FIXME.

regards,

Mark van Doesburg

Christophe Geuzaine <cgeuzaine at ulg.ac.be> wrote:

	Mark van Doesburg wrote:
	> Hello,
	> 
	> Some time ago I reported that I was working on a method to connect
	> overlapping faces in OpenCASCADE models. At that time expected it to
	> be two weeks of work.  Unfortunately OpenCASCADE is not as capable
	> as it appeared at that time, in fact I have yet to find a moderately
	> complex function/class that actually works in all cases. So if anybody
	> is interested in what I have so far I am willing to post it to the list,
	> but I don't think it is ever going to be a robust solution.
	> 

	Hi Mark - even if it's not perfect you can post it on the list: we would 
	be interested in having a look.

	Thanks!

	Christophe

	> regards,
	> 
	> Mark van Doesburg
	> 
	> _______________________________________________
	> gmsh mailing list
	> gmsh at geuz.org
	> http://www.geuz.org/mailman/listinfo/gmsh
	> 
	> 


	-- 
	Prof. Christophe Geuzaine
	University of Liege, Electrical Engineering and Computer Science
	http://www.montefiore.ulg.ac.be/~geuzaine
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g-brep.tgz
Type: application/octet-stream
Size: 11135 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090416/cded9eb0/attachment.tgz>