Meshing a trimmed surface

I´ve got some problems meshing a shape correctly. I´ve generated it with the BRepAlgoAPI_Common algorithm - maybe this alogrithm doesn´t produce correct results (but from the visualisation and from ShapeAnalysis_Shell it seems to be ok). I tried to mesh the shape with BRepMesh_FastDiscret and BRepMesh_IncrementalMesh using different parameters but the result is never satisfying. Especially with BRepMesh_IncrementalMesh I would have expected a different result.

Has someone an idea whats wrong - here the sample files.

Thanks in advance - Stefan

samscore's picture

I dont know if it make sense, but you could try to subdivide the original shape first with ShapeUpgrade_ShapeDivideArea?


StefanKunze's picture

Thanks for hint... but it has no effect on the shape. Maybe I´m using it in the wrong way!?!?

lResultingFace = TopoDS::Face(lShapeDivider.Result());

samscore's picture

I think you have to set "ShapeUpgrade.ShapeDivideArea.MaxArea()= yourMaxArea" first, then call perform()...

StefanKunze's picture

Ok the tip is not bad.... but the "strange|wrong" discretising still appears at one side of the surface - so the problem is still visible. Has someone an idea whats wrong - I quess something is wrong with boundary or the edges but I have no experience with that!!??! :(

If wished I can upload screenshot or one more sampleFile!
Best regards - Stefan

StefanKunze's picture

Hmm I can´t understand why the meshing algoritm produces so irregular results. Here a screenshoot:

The first and second part have the same size - part three is a little bit different. Checked out the parameters but no one really helped - any suggestions what to try out.

samscore's picture

Perhaps will produce better results? I dont know because I dont use neither the OCC mesher nor the netgen...

Good luck

StefanKunze's picture

Thanks for the tip Simon... but another Mesher is not an option for our team. :(

StefanKunze's picture

Ok after some investigations I understand whats the problem. The mesher seems to use the U|V - coordinates for its calculations. Because I´m using trimmed surface - these parametric values are mostly like u: 0.0-1.0 and v: 0.4-0.5. The small range of the v-values seem to make trouble.

Some ideas which could work - but I can´t implement them because of missing knowledge:
- trim a bsplinesurface for real
- create a new bplinesurface from a trimmed one (the new has parametric values between 0 and 1)
- approximate a trimmed face (GeomConvert_ApproxSurface doesn´t work for that)

Can one of these ideas be implemented???
Best regards - Stefan

Jeff's picture

maybe you could try to mesh the untrimmed surface first, and then trim the mesh within your trimmed surface boundary yourself. Again, the mesher seems to have a lot of bugs, as I heard.

StefanKunze's picture

Hmmm yeah... I quess this it will be - unfortunately. :(