mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0022968: RebuildShape exchanges 2d-curves
This commit is contained in:
parent
44d9ae897c
commit
982a90fcba
@ -65,6 +65,9 @@
|
|||||||
#include <ShapeCustom.hxx>
|
#include <ShapeCustom.hxx>
|
||||||
#include <ShapeUpgrade_ShapeDivideClosed.hxx>
|
#include <ShapeUpgrade_ShapeDivideClosed.hxx>
|
||||||
#include <ShapeUpgrade_RemoveInternalWires.hxx>
|
#include <ShapeUpgrade_RemoveInternalWires.hxx>
|
||||||
|
#include <ShapeUpgrade_RemoveLocations.hxx>
|
||||||
|
#include <BRepBuilderAPI_Transform.hxx>
|
||||||
|
|
||||||
// the plane (equation z=0) shared by PlaneDividedFaceContinuity and PlaneGridShell
|
// the plane (equation z=0) shared by PlaneDividedFaceContinuity and PlaneGridShell
|
||||||
//static Handle(Geom_Plane) ThePlane= new Geom_Plane(0,0,1,0);
|
//static Handle(Geom_Plane) ThePlane= new Geom_Plane(0,0,1,0);
|
||||||
|
|
||||||
@ -1403,6 +1406,49 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Standard_Integer removeloc (Draw_Interpretor& di,
|
||||||
|
Standard_Integer argc,
|
||||||
|
const char** argv)
|
||||||
|
{
|
||||||
|
if (argc<3) {
|
||||||
|
di << "bad number of arguments. Should be: removeloc res shape" <<"\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape aShape = DBRep::Get(argv[2]);
|
||||||
|
if(aShape.IsNull())
|
||||||
|
return 1;
|
||||||
|
ShapeUpgrade_RemoveLocations aRemLoc;
|
||||||
|
aRemLoc.Remove(aShape);
|
||||||
|
TopoDS_Shape aNewShape = aRemLoc.GetResult();
|
||||||
|
|
||||||
|
DBRep::Set(argv[1],aNewShape);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static Standard_Integer copytranslate(Draw_Interpretor& di,
|
||||||
|
Standard_Integer argc,
|
||||||
|
const char** argv)
|
||||||
|
{
|
||||||
|
if (argc<6) {
|
||||||
|
di << "bad number of arguments. Should be: removeloc res shape dx dyy dz" <<"\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
TopoDS_Shape aShape = DBRep::Get(argv[2]);
|
||||||
|
if(aShape.IsNull())
|
||||||
|
return 1;
|
||||||
|
Standard_Real aDx = atof(argv[3]);
|
||||||
|
Standard_Real aDy = atof(argv[4]);
|
||||||
|
Standard_Real aDz = atof(argv[5]);
|
||||||
|
gp_Trsf aTrsf;
|
||||||
|
aTrsf.SetTranslation(gp_Vec(aDx, aDy, aDz));
|
||||||
|
BRepBuilderAPI_Transform builderTransform(aTrsf);
|
||||||
|
builderTransform.Perform (aShape, true);
|
||||||
|
TopoDS_Shape aNewShape = builderTransform.Shape();
|
||||||
|
DBRep::Set(argv[1],aNewShape);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : InitCommands
|
//function : InitCommands
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1497,4 +1543,7 @@ static Standard_Integer removeinternalwires (Draw_Interpretor& di,
|
|||||||
|
|
||||||
theCommands.Add ("RemoveIntWires","result minarea wholeshape [faces or wires] [moderemoveface ]",
|
theCommands.Add ("RemoveIntWires","result minarea wholeshape [faces or wires] [moderemoveface ]",
|
||||||
__FILE__,removeinternalwires,g);
|
__FILE__,removeinternalwires,g);
|
||||||
|
|
||||||
|
theCommands.Add ("removeloc","result shape",__FILE__,removeloc,g);
|
||||||
|
theCommands.Add ("copytranslate","result shape dx dy dz",__FILE__,copytranslate,g);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ static Standard_Boolean RebuildShape(const TopoDS_Edge& theEdge, TopoDS_Edge& th
|
|||||||
c2d1= BRep_Tool::CurveOnSurface(tmpE,theFace,First2d,Last2d);
|
c2d1= BRep_Tool::CurveOnSurface(tmpE,theFace,First2d,Last2d);
|
||||||
TopAbs_Orientation OrEdge = theNewEdge.Orientation();
|
TopAbs_Orientation OrEdge = theNewEdge.Orientation();
|
||||||
|
|
||||||
if(theNewFace.Orientation() == TopAbs_REVERSED)
|
if(theFace.Orientation() == TopAbs_REVERSED)
|
||||||
OrEdge = ( OrEdge == TopAbs_FORWARD ? TopAbs_REVERSED : TopAbs_FORWARD);
|
OrEdge = ( OrEdge == TopAbs_FORWARD ? TopAbs_REVERSED : TopAbs_FORWARD);
|
||||||
|
|
||||||
if(OrEdge == TopAbs_FORWARD)
|
if(OrEdge == TopAbs_FORWARD)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user