]> OCCT Git - occt.git/commitdiff
0033100: Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale trian... IR-2022-08-12
authormsv <msv@opencascade.com>
Thu, 11 Aug 2022 20:46:23 +0000 (23:46 +0300)
committersmoskvin <smoskvin@opencascade.com>
Sat, 13 Aug 2022 10:53:14 +0000 (13:53 +0300)
Make XCAFDoc_Editor::RescaleGeometry to pass the flag theCopyMesh==true
in call to BRepBuilderAPI_Transform::Perform.

Correct the help of the command XRescaleGeometry.

src/XCAFDoc/XCAFDoc_Editor.cxx
src/XDEDRAW/XDEDRAW.cxx
tests/bugs/xde/bug33100 [new file with mode: 0644]

index 944351b7ae717df5c9ae9525415dfc74645dd314..e76fcedf4d728ed501a4ca0f3344932495cef2f2 100644 (file)
@@ -515,7 +515,7 @@ static void rescaleDimensionRefLabels(const TDF_LabelSequence& theRefLabels,
       if (aL.FindAttribute(TNaming_NamedShape::GetID(), aNS))
       {
         TopoDS_Shape aShape = aNS->Get();
-        theBRepTrsf.Perform(aShape, Standard_True);
+        theBRepTrsf.Perform(aShape, Standard_True, Standard_True);
         if (!theBRepTrsf.IsDone())
         {
           Standard_SStream aSS;
@@ -664,7 +664,7 @@ Standard_Boolean XCAFDoc_Editor::RescaleGeometry(const TDF_Label& theLabel,
       if (aNodeType == XCAFDoc_AssemblyGraph::NodeType_Part)
       {
         const TopoDS_Shape aShape = aShapeTool->GetShape(aLabel);
-        aBRepTrsf.Perform(aShape, Standard_True);
+        aBRepTrsf.Perform(aShape, Standard_True, Standard_True);
         if (!aBRepTrsf.IsDone())
         {
           Standard_SStream aSS;
index 1e9ff6e180523224e22d60bd99b7b35220169f63..71561d359e326e01f81c09a88ea14eeec566cbf2 100644 (file)
@@ -1836,7 +1836,7 @@ void XDEDRAW::Init(Draw_Interpretor& di)
          "Doc [-names]: Prints number of assembly instances",
          __FILE__, XDumpNomenclature, g);
   di.Add("XRescaleGeometry",
-         "Doc -scale factor [-root label]: Applies geometrical scale to assembly",
+         "Doc factor [-root label] [-force]: Applies geometrical scale to assembly",
          __FILE__, XRescaleGeometry, g);
 
   // Specialized commands
diff --git a/tests/bugs/xde/bug33100 b/tests/bugs/xde/bug33100
new file mode 100644 (file)
index 0000000..ea11cf3
--- /dev/null
@@ -0,0 +1,15 @@
+puts "0033100: Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale triangulations"
+
+pload DCAF
+Close d -silent
+ReadStep d [locate_data_file "bug33100_window.step"]
+
+XGetOneShape a d
+set ref_diag [eval distpp [bounding a]]
+
+XRescaleGeometry d 1000
+
+XGetOneShape a d
+set diag [eval distpp [bounding a]]
+
+checkreal "bounding box diagonal" $diag [expr $ref_diag * 1000] 0 0.001