##### Personal tools
You are here: Home Use Re: Cutting a cylinder

# Re: Cutting a cylinder

Up to Use

### Re: Cutting a cylinder

Posted by Carlos Lopez at October 09. 2012

Dear All,

I need to mesh a long (20m+) cylinder of very small diameter (20 mm). The best way to reduce the nÂș of elements is to use quad external face from 3d extrusion with top (or bottom) face with a sub mesh of mefisto triangles and the opposite face with a projection of the top.

This works fine if the cylinder is generated and meshed, but if I cut the cylinder with a plane, cylinder or sphere is impossible to carry out as the face of the cut is not recognised and the process fails.

If I do the same with a box, cutting the box with any thing it works fine.

Is this a bug or do I miss something?

I attach the box case, as example. As I said it works. Try replacing the box with a Cylinder, to me it fails.

Carlos.

CAElinux 2011 with Salome 6.3.0

Attachments

### Re: Cutting a cylinder

Posted by Saint Michael at October 10. 2012

Hi Carlos.

This is probably because cutting by a sphere produces a face with different number of vertices. To overcome this, try "Composite Side Discretization" instead of "Wire Discretization" 1D algorithm.

St.Michael

### Re: Cutting a cylinder

Posted by SMESH expert at October 10. 2012

Previously Saint Michael wrote:

Hi Carlos.

This is probably because cutting by a sphere produces a face with different number of vertices. To overcome this, try "Composite Side Discretization" instead of "Wire Discretization" 1D algorithm.

St.Michael

Hello Carlos

There is really a different number of vertices on top and bottom faces. A solution is to split wires of the top and bottom into equal number of edges (3 is minimum).

For that:

- create 3 vertices: 1 vertex on a long edge of spherical face and 2 ones on a sole edge of planar face. There is a mode of vertex construction - by parameter on edge, convenient for creation of these vertices.

- split edges of the cylinder by the 3 new vertices, use Partition with the cylinder and vertices as objects.

- the rest, as usual.

Don't use "Composite Side Discretization"! (in this case)

Edward

### Re: Cutting a cylinder

Posted by Carlos Lopez at October 10. 2012

Hi, thanks to you both,

I did not make myself clear, I apologise. To make things worst the example was wrong.

Attached is the script that makes two cylinders and cut them.

As the mesh in the script, apparently the projection works making the top face with the same number of vertices and edges, still the extrusion 3d fails. I get: OCC exception. OSD_SIGSEGV: SIGSEGV 'segmentation violation' detected. Address 14

If I mesh independently the top and bottom with the same number of segments, lets say 10, the top gives 10 but the bottom 20.

Also tried Composite side discretization but then it fails the projection.

Thanks again for your attention.

Carlos.

Attachments

### Re: Cutting a cylinder

Posted by Saint Michael at October 12. 2012

Hi Carlos.

Actually, an excess vertex appears on a CutFace when a tool object is a sphere. In case of cylinder there is no additional vertices preventing projection. So, in case of TwoCylMesh.py no additional actions in GEOM module are needed.

But there is a bug in "Extrusion 3D" algorithm. To cope with it I meshed only a half of cylinder and then mirrored it (see an updated script).

St.Michael

Attachments

### Re: Cutting a cylinder

Posted by Carlos Lopez at October 12. 2012

Hi Saint Michael,

Thanks for your time.

I tried your .py but it fails on the projection, looking to the Top and Bottom they have different number of vertices and edges, 2 and 2 in Top and 3 and 3 in Bottom.

But I will work on your solution, thanks.

Carlos.

### Re: Cutting a cylinder

Posted by SMESH expert at October 12. 2012

Dear Carlos

I tried to solve this task in SALOME 6.4 and failed with SIGSEGV. I managed to do it only in SALOME 6.5.

Edward

### Re: Cutting a cylinder

Posted by Carlos Lopez at October 12. 2012

Thanks Edward,

I will see if I can install Salome 6.5 at the same time as 6.3.

Carlos.

### Re: Cutting a cylinder

Posted by Carlos Lopez at October 12. 2012

Dear All,

After Edward comment, I installed Salome-Maca 6.5.0

The result is shocking. First, the positive is that St.Michael's script works (or at least to a point)

The discouraging is that depending on the version used, the results are completely different. Is good that things get fix,  rewriting all scripts and having new mistakes that were not in previous versions is different.

The Aster module is generating a script with so many syntax errors that is better to start from scratch. Eficas would not open it.

Is it my installation or you have the same problems??

I know, this forum is for Salome and not for Code-Aster.

Thank you all for your help,

Carlos.