mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0026261: Create a tool to remove tails from any wire
A tool to remove tails from the wires of a shape was created. The tool is based on mechanism 'ShapeFix', is located in types 'ShapeFix_Wire' and 'ShapeAnalysis_Wire', is enabled through method 'ShapeFix_Wire::FixTailMode' and is initialized by methods 'ShapeFix_Wire::SetMaxTailAngle' and 'ShapeFix_Wire::SetMaxTailWidth' and is called through method 'ShapeFix_Wire::FixTails'. The status of any performing of the last method is accessible through method 'ShapeFix_Wire::StatusFixTails'. The tail angle is checked only at the tail start. Mechanism 'ShapeFix' was modified: - the tool is disabled by default; - algorithm 'Fix notched edges' is disabled then the tool is enabled; - the tool and the last algorithm work in turns then the tool works on the request. 'Draw' command 'fixshape' was extended by options '-maxtaila' and '-maxtailw' to test the tool. 'Draw' tests to test the tool were created. Algorithm 'fixshape' was changed in type 'ShapeProcess_OperLibrary' to - use new parameters named 'FixTailMode', 'MaxTailAngle' (in degrees) and 'MaxTailWidth' from the algorithm context; - apply the tool after the shape will be fully fixed if the tool was enabled. Place holders for the new parameters were created in the resource file of mechsnism 'STEPControl_Reader'. Test cases for issue CR26261
This commit is contained in:
@@ -752,15 +752,38 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
|
||||
sfw->FixSeamMode() = ctx->IntegerVal ( "FixSeamMode", -1 );
|
||||
sfw->FixSameParameterMode() = ctx->IntegerVal ( "FixEdgeSameParameterMode", -1 );
|
||||
sfw->FixNotchedEdgesMode() = ctx->IntegerVal ( "FixNotchedEdgesMode", -1 );
|
||||
sfw->FixTailMode() = ctx->IntegerVal("FixTailMode", 0);
|
||||
sfw->SetMaxTailAngle(ctx->RealVal("MaxTailAngle", 0) * (M_PI / 180));
|
||||
sfw->SetMaxTailWidth(ctx->RealVal("MaxTailWidth", -1));
|
||||
sfw->FixSelfIntersectingEdgeMode() = ctx->IntegerVal ( "FixSelfIntersectingEdgeMode", -1 );
|
||||
sfw->FixIntersectingEdgesMode() = ctx->IntegerVal ( "FixIntersectingEdgesMode", -1 );
|
||||
sfw->FixNonAdjacentIntersectingEdgesMode() = ctx->IntegerVal ( "FixNonAdjacentIntersectingEdgesMode", -1 );
|
||||
|
||||
if (sfw->FixTailMode() == 1)
|
||||
{
|
||||
sfw->FixTailMode() = 0;
|
||||
sfs->Init(ctx->Result());
|
||||
sfs->Perform(ctx->Progress());
|
||||
sfw->FixTailMode() = 1;
|
||||
if (!ctx->Progress().IsNull() && ctx->Progress()->UserBreak())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TopoDS_Shape result = sfs->Shape();
|
||||
if (result != ctx->Result() ||
|
||||
(!msg.IsNull() && !msg->MapShape().IsEmpty()))
|
||||
{
|
||||
ctx->RecordModification(sfs->Context(), msg);
|
||||
ctx->SetResult(result);
|
||||
}
|
||||
}
|
||||
|
||||
sfs->Init(ctx->Result());
|
||||
sfs->Perform(ctx->Progress());
|
||||
|
||||
if ( !ctx->Progress().IsNull() && ctx->Progress()->UserBreak() )
|
||||
if (!ctx->Progress().IsNull() && ctx->Progress()->UserBreak())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TopoDS_Shape result = sfs->Shape();
|
||||
if (( result != ctx->Result() ) ||
|
||||
|
Reference in New Issue
Block a user