Thu, 09/22/2022 - 11:32
As is shown in the attached jpg.
When I import a shape, one edge is divided into several parts by some reason. Can I detect and connect them into one by some occ functions automatically? (the example attached is simple but it may be a complex model)
For example, a rectangle is usually constructed by 4 edges. But sometimes one of them is divided to 3 edges. Then the edge number is 6 instead of 4. What I want to do is auto detect those 3 edges and connect them into 1.
Thu, 09/22/2022 - 22:49
Try the algorithm ShapeUpgrade_UnifySameDomain.
Fri, 09/23/2022 - 09:09
Hi. I tried this with AllowInternalEdges(false). But it still dose not work.
Tue, 09/27/2022 - 06:30
Can Opencascade remove vertexes or edges (lile BRepAlgoAPI_Defeaturing, only can remove faces)?
I can now detect useless vertexes and edges. I tried to remove edges by BRepTools_ReShape. But Remove() function only takes away the edges instead of reshaping the whole shape after taking away them. The result is a face with a broken wire.
Tue, 09/27/2022 - 15:15
What do you mean by "useless vertexes and edges"? If their removal makes shape invalid, then they aren't useless. If you expect to merge two Faces defined on different geometric surfaces into a single TopoDS_Face, then this operation could be done only by generating a new (approximated) surface with new boundaries. OCCT doesn't provide such operation, though tools like GeomPlate may be used to generate an approximated surface.
Wed, 09/28/2022 - 04:36
Hi, I think you misunderstand the issue. There is only one face (for simple). Take the rectangle as an example. Generally, a rectangle is composed by 1 wire. And this wire has 4 edges. But sometimes 1 edge is broken to several edges. Then this rectangle can have edges more than 4.
And what I want to do is merge those "useless" edges and make this rectangle only have 4 edges again.
"If their removal makes shape invalid, then they aren't useless." this could be right. Because I rebuild the wire. And use BRepTools_ReShape to replace the old wire(more than 4 edges) with new one(4 edges). The new wire is replaced successfully into the face. But the face is not work. It dosent show the right topology in the visualize tool "TInspector".
Wed, 09/28/2022 - 10:19
If you want to replace an edge in a face you should provide the new edge with p-curve on that face, otherwise the shape will be invalid.
The tool ShapeUpgrade_UnifySameDomain can automatically merge smoothly connected edges. You may need to turn on ConcatBSplines parameter that is false by default.
Wed, 09/28/2022 - 12:01
Awesome reply! I change the ConcatBSplines to be true but still remain the same result. If the reason is the P-curve of this edge is needed for this face? (Test model attached)
Wed, 09/28/2022 - 14:14
I have tried unifying this face with different parameters. Nothing works, the edges are not merged. It is needed to go deep into debugging the algorithm.
You may need to add a bug in mantis for this problem. May be some day the team will take and solve it.
Thu, 09/29/2022 - 03:46
Thank you for the help. I will report if I find a solution or someone else can solve it.
Fri, 09/30/2022 - 05:23
When I replace the wire of the face, it becomes invalid. How I can do it right?
Mon, 03/20/2023 - 08:02
The problem was not solved now