Remove specific edge of a solid?

Hello,

is there any way in python to remove a specific edge? or fuse two co-linear faces but indicating which ones to fuse?
i would like to use this to remove this specific edge:

but if i use repair union faces it will merge all the faces of the cylinder to a single one., i would like to keep the cylindrical face divided (or other colinear faces in another part of the solid that want to stay divided).

i know about the geompy.checkAndImprove() which in a case like this ‘should’ remove the undesired edge & vertex, but this is quite specific to a block and actually for this simple geometry it is failing (giving GEOMAlgo_GlueDetector failed).

the only way i found to do this is:

  1. detect the specific faces sharing the specific edge, create a shell out of the two, then use union faces on it (this will remove the internal edge).
  2. create a new shell from the output of union faces and the faces that were not sharing the specific edge
  3. create a solid out of the new shell created
  4. use union faces (as this solid will still have the extra vertex from the other two circular faces)
  5. make a partition of the result by the other edges that are not the one i want to remove and not the circle ones

if there is any more clean way to do this, i would appreciate any recommendations.

Hello,

You can try to use the “Defeaturing” feature and select one of the face that is delimited by the unwanted edge.

I understand that the edge you want to remove is the construction edge of the cylinder. A good practice, when possible, is to try to match this edge with edges that need to be created.

For example in your case, if the other edges were created by cutting the cylinder with a plan, then you can first rotate the cylinder so that the cut will go through the construction edge.

Hello fred,

>I understand that the edge you want to remove is the construction edge of the cylinder. A good practice, when possible, is to try to match this edge with edges that need to be created.

I understand this, and i am with you, nevertheless this is not always possible, and actually quite problematic to do for the following reasons (this includes geometries with seams):

  1. sometimes the other ‘edges’ are not straights, so in this case it is impossible to align them
  2. i have quite bad experience from this in salome, even fixing presition and using the information of geompy.KindOfShape() to get axis and other things, a lot of time one finish with really almost coincident points but with extra ones. this has been one of my biggest headache in salome. for a lot of applications one does not care about this, but for meshing, specially structured meshing it can be quite annoying to deal with.

>You can try to use the “Defeaturing” feature and select one of the face that is delimited by the unwanted edge.

I am using geom, where at least from my knowledge and a look at doc, and the tools shown it does not look like there is a ‘defeaturing’ tool round?

in any case, I exported in brep and re imported in shaper juuuuust to check if this would solve the issue, i tested and when i selected the two faces sharing the seam edge, and applied defeaturing it actually gave a worst same result than union faces. ie, it not only removed ALL the edges to leave only the seam one, but furthemore and thats is way more problematic (a clear regression from geom behavior, at least for someone that works with SMESH), it moved the seam edge to another location a random one, where in union faces at least, it removes all of them while keeping one at same location as before, here it puts one and it puts it in random location (first i thought it was putting it as the default location of it (aligned with the XZ or YZ plane) but no, it is just random). remove extra edges with unite faces in shaper gives same result as in geom.

this is in geom (union faces):

before:

after (union faces), the edge kept is one of the previous one, the one of the XZ plane, ie, original construction edge:

this is in shaper (defeaturing)

before:

after (defeaturing) all edges are removed and a new one appeared that looks like its aligned with the YZ plane but it is not.:

here is the Brep in case you want to check yourself:

Solid_3.brep (40,6 KB)

Indeed the defeaturing is not working.

Then yes in your case the only way will be to recreate the shape:

  • extract the faces
  • fuse the 2 faces
  • recreate the shell

Another possibility, using the symetry of your case, will be to copy the opposite face using symetry instead of fusing the 2 parts.

This would leave extra vertexes on the arc of the circles the edge will be removed but the vertexes will not disapear.

the most straightforward (nevertheless i still find it skeatchy/hacky) I found is:

  1. extract faces that touches the edge or the vertexes of the edge, so the two circular faces and the two cylindrical walls sharing the seam.
  2. create a shell of these faces
  3. use remove extra edges with union faces on (different output to union faces!)
  4. create a shell of the remaining faces + shell in 3
  5. create a solid of the shell

I was ‘able’ to do it, but simply knowing the geometry reparation tools of geom, i was hopping i was missing something out and there was a tool for this, as check compound of blocks tool is able to do this kind of procedure in other geometries.

thanks in any case.