Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forum
Open Source community
Training and e-learning
A la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forum / BRepMesh_FastDiscret doesn’t triangulate holes

Forum

BRepMesh_FastDiscret doesn’t triangulate holes
NadjaS2010/08/31 10:21
Hi everybody,

I have a problem using BRepMesh_FastDiscret:

I create a face with a hole inside which I wanna triangulate.
Therefore I create first the outer face by a surf:

TColgp_Array2OfPnt array_2d(1, 2, 1, 2);
array_2d.SetValue(1,1, list_boundary_points_occ[0]);
array_2d.SetValue(1,2, list_boundary_points_occ[1]);
array_2d.SetValue(2,1, list_boundary_points_occ[3]);
array_2d.SetValue(2,2, list_boundary_points_occ[2]);
Handle(Geom_Surface) surf_handle = new Geom_BezierSurface(array_2d);
GeomAdaptor_Surface new_surface_adaptor(surf_handle);
BRepBuilderAPI_MakeFace whole_face_builder = BRepBuilderAPI_MakeFace();
whole_face_builder.Init(new_surface_adaptor.Surface());
whole_face_builder.Build();

Then I create a smaller wire representing the hole:

TopoDS_Wire wire_of_current_hole = …

And then I use “Add” to add the wire as hole to the face:

whole_face_builder.Add(wire_of_current_hole);

Everything’s fine, the resulting face includes the hole.
But when triangulating the face, the whole face without the hole is triangulated:
BRepMesh_FastDiscret mymesh(0.01,whole_face_builder.Face(), boundingBox, 30, true, true, false, true );

Does anyone know why?
NadjaS2010/09/01 09:37
I figured out, that using

BRepMesh_FastDiscret* my_mesh = new BRepMesh_FastDiscret(0.01,whole_face_builder.Face(), boundingBox, 30, true, true, false, true );

the number of returned triangles in

my_mesh->NbTriangles()

is 15. Obviously the hole was triangulated in respect.
But how can I have access to these 15 triangles??
Using
my_mesh->TrianglesOfDomain(1, map_integer_triangles);
the size of map_integer_triangles is only 2.

Does anyone have an idea??
sergey zaritchny2010/09/01 10:31
Hello NadjaS,

Check, please TrianglesOfDomain() for all Domains: ->NbDomains().
NB. I would recommend you to test 6.4.0 which is coming soon.
Regards
Sergey
NadjaS2010/09/01 10:44
Hi Sergey,
that's the thing I've already tried:
I have one domain, which is ok, I think.
But using TrianglesOfDomain() for that domain, the size of the received MeshDS_MapOfInteger is 2 and I get again only the triangulated face without the hole...
Regards
Nadja
sergey zaritchny2010/09/01 12:19
Hi Nadja,
Probably it is a bug, it depends...
Attach, please (if you want) a kept in 'brep' format file with the specified face.
I will try to check and will inform you if it is a bug.
regards
Sergey
NadjaS2010/09/01 12:53
Hi Sergey,

here it is.
Thanks a lot!
You have to be logged in to download the attached file
sergey zaritchny2010/09/01 16:49
Hi Nadja,
A simple check in Draw shows that your shape (face with hole) is invalid.
As result you got an expectable result in Mesher.
See below Draw report (where F1 is your face):
Draw[14]> checkshape F1
On Shape faulty_1 :
BRepCheck_SelfIntersectingWire
On Shape faulty_2 :
BRepCheck_UnorientableShape
Shape faulty_1 on shape faulty_2 :
BRepCheck_SelfIntersectingWire
Shape faulty_3 on shape faulty_2 :
BRepCheck_NoCurveOnSurface
Shape faulty_4 on shape faulty_2 :
BRepCheck_NoCurveOnSurface
Shape faulty_5 on shape faulty_2 :
BRepCheck_NoCurveOnSurface
Shape faulty_6 on shape faulty_2 :
BRepCheck_NoCurveOnSurface

Faulty shapes in variables faulty_1 to faulty_6

It means that Wire has bad orientation and some edges don't have pcurves:
Draw[21]> pcurve F1

rouge FORWARD
bleu REVERSED
rose EXTERNAL
orange INTERNAL
Error: Edge 5 does not have pcurve
Error: Edge 6 does not have pcurve
Error: Edge 7 does not have pcurve
Error: Edge 8 does not have pcurve
I.e. big bounding wire has bad orientation of edges (see the attached picture).
Small wire (hole) has not pcurves on surface at all.
I hope it helps you.
Good luck.
Sergey

You have to be logged in to download the attached file
NadjaS2010/09/01 19:30
Hi Sergey,
thanks a lot, now it works!

Best regards, Nadja
 
 
Latest news
  • FAQ section updated
  • OPEN CASCADE Uses Intel ® Parallel Studio XE to Introduce Parallelism into SALOME SMESH Module
  • Open CASCADE Technology 6.5.2 is available for download!

  • © OPEN CASCADE 2000 - 2012  |  Search  |  Contacts   |  Site map