DiscussionsIssue archiveModeling Data and Algorithms

Archived discussion

ShapeUpgrade_UnifySameDomain do good after save as STEP and reload it back.Why?

Modeling Data and AlgorithmsWed, 07/30/2025 - 12:544 replies

Browse this forum
QuestionAuthor

The ShapeUpgrade_UnifySameDomain does not work properly, but after saving the shape as a STEP file and then re-reading it back in, ShapeUpgrade_UnifySameDomain produces good results.

The shape was obtained by using BOPAlgo_Splitter on several faces and a solid. Is there any issue with this shape? (What method should I use to identify these potential problems?) Could the process of saving it as a STEP file have reconstructed the shape, resolving these issues and enabling ShapeUpgrade_UnifySameDomain to work properly?What happens during the process of saving to STEP?

Discussion

4 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hello. The difference is: during STP export AND step Import you perform list of ShapeHealing operations.

For most of the OCCT Modeling operations, we expect that model are valid and fixed. So, please check the validity of the model and apply ShapeFix on your shape before using them into the Modeling algorithms.

Intefaces for shape healing: ShapeFix_Shape

interfaces for topology validation: BRepAlgoAPI_Check

Best regards, Commenter-1.

02Author
	if (1)
	{
		TopoDS_Shape model;
		{
			model = readBrepModel("./TEST_STEP/CF0730.brep");
			//QtShowShape(model);
			BRepAlgoAPI_Check aCh(model);
			Standard_Boolean isValid = aCh.IsValid();
			std::cout << "BRepAlgoAPI_Check : " << isValid << std::endl;//1
			const BOPAlgo_ListOfCheckResult& result = aCh.Result();//empty
			for (auto& item : result)
			{
				BOPAlgo_CheckStatus status = item.GetCheckStatus();
				std::cout << "Status : " << status << std::endl;
			}
		}

		TopoDS_Shape fixShape;
		{
			ShapeFix_Shape fix(model);
			fix.Perform();
			fixShape = fix.Shape();
			for (int i = 0; i < 19; i++)
				std::cout << "ShapeFix_Shape Status(" << i << ") :" << fix.Status((ShapeExtend_Status)i) << std::endl;
		}

		TopoDS_Shape unifiedShape;
		{
			ShapeUpgrade_UnifySameDomain unif(fixShape);
			unif.Build();
			unifiedShape = unif.Shape();
		}
		QtShowShape(model);
		QtShowShape(fixShape);
		QtShowShape(unifiedShape);
	}

Archived image: external image

Thanks.But it seem not work.ShapeFix_ShapeBRepAlgoAPI_CheckShapeUpgrade_UnifySameDomain,These classes don't seem to have many interfaces available to modify. Or am I using them incorrectly?

03Commenter-1

Please report a bug in Github with file sample and C++ code to reproduce.https://github.com/Open-Cascade-SAS/OCCT/issues/new/choose

Best regards, Commenter-1.

04Author

I filed a bug here:https://github.com/Open-Cascade-SAS/OCCT/issues/666
 Thanks for taking a look.