gmsh does not mesh a half cylinder as I would expect it

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Posts: 9292
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

gmsh does not mesh a half cylinder as I would expect it

Post by bernd » Sun Feb 02, 2020 2:06 pm

anyone an idea why gmsh has huge problems to mesh this ... ?

cheers bernd

halfcylinder.FCStd
(90.65 KiB) Downloaded 7 times

Screenshot_20200202_150449.png
Screenshot_20200202_150449.png (131.37 KiB) Viewed 261 times
fandaL
Posts: 355
Joined: Thu Jul 24, 2014 8:29 am

Re: gmsh does not mesh a half cylinder as I would expect it

Post by fandaL » Mon Feb 03, 2020 7:01 am

I have no problems with the file. Recreated mesh is uniform.

OS: Linux Mint 19.3 (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19443 (Git) AppImage
Build type: Release
Branch: master
Hash: 74680b8a15ad37e53eee0d341e95cd32631d88a3
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
UR_
Posts: 1175
Joined: Tue Jan 03, 2017 8:42 pm

Re: gmsh does not mesh a half cylinder as I would expect it

Post by UR_ » Mon Feb 03, 2020 8:39 am

gmsh 4.5.2 on win 10 has no problems too.

For general remark:
To improve model's stability, you should avoid touching seams.


In your example file, please have a look at cylinder's seam in relation to box's top face

Screenshot 003.png
Screenshot 003.png (11.04 KiB) Viewed 218 times
Jee-Bee
Posts: 1992
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: gmsh does not mesh a half cylinder as I would expect it

Post by Jee-Bee » Mon Feb 03, 2020 10:04 am

same as bernd on pre compiled version

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18719 (Git)
Build type: Release
Branch: master
Hash: c021ff70debb106b27d03ed1707f4b05fcf385a6
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
2020-02-03 11_02_44-FreeCAD 0.19.png
2020-02-03 11_02_44-FreeCAD 0.19.png (44.81 KiB) Viewed 208 times
User avatar
bernd
Posts: 9292
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: gmsh does not mesh a half cylinder as I would expect it

Post by bernd » Mon Feb 03, 2020 1:38 pm

same problem on win dev builds They have gmsh 4.2.1.
UR_ wrote:
Mon Feb 03, 2020 8:39 am
For general remark:
To improve model's stability, you should avoid touching seams.
In your example file, please have a look at cylinder's seam in relation to box's top face
if the cylinder is rotated the problem is gone.



But:
Eventually I would like to remesh this with gmsh: https://github.com/FreeCAD/FreeCAD/blob ... d_solid.py

If in there this line https://github.com/FreeCAD/FreeCAD/blob ... lid.py#L74 is changed to:

Code: Select all

        Rotation(90, 0, 90),
the line in the cylinder is rotated as _UR requests, but eventually the fusion has again problems with meshing ... I may should give the newer versions of gmsh a try too.
User avatar
bernd
Posts: 9292
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: gmsh does not mesh a half cylinder as I would expect it

Post by bernd » Mon Feb 03, 2020 1:40 pm

BTW: If compound filter and again compound is used on the initial file, nothing on the shape seams changed, but gmsh meshs the halfcylinder without any problems.
UR_
Posts: 1175
Joined: Tue Jan 03, 2017 8:42 pm

Re: gmsh does not mesh a half cylinder as I would expect it

Post by UR_ » Mon Feb 03, 2020 10:23 pm

bernd wrote:
Mon Feb 03, 2020 1:38 pm
But:

I had a short look at your script.
To make a bar with half of circle crossection, attached code snippet looks a little bit simpler:

Code: Select all

top_cylinder_obj = App.ActiveDocument.addObject("Part::Cylinder", "BottomCylinder")
top_cylinder_obj.Radius = 30
top_cylinder_obj.Height = 500
top_cylinder_obj.Angle = 180
shape = Part.getShape (top_cylinder_obj, '', needSubElement = False, refine = True)
top_cylinder_obj.Shape = shape

No box and no boolean are needed.
User avatar
bernd
Posts: 9292
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: gmsh does not mesh a half cylinder as I would expect it

Post by bernd » Tue Feb 04, 2020 7:46 am

https://github.com/berndhahnebach/FreeC ... 5c3f7996f2 It does make geometry creation much simpler, but the gmsh mesh problem keeps alive.
User avatar
bernd
Posts: 9292
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: gmsh does not mesh a half cylinder as I would expect it

Post by bernd » Tue Feb 04, 2020 9:49 am

bernd wrote:
Tue Feb 04, 2020 7:46 am
https://github.com/berndhahnebach/FreeC ... 5c3f7996f2 It does make geometry creation much simpler, but the gmsh mesh problem keeps alive.
since it simplifies geometry creation I merged it into master anyway git commit f5835dc
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest