]> OCCT Git - occt.git/commitdiff
0033100: Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale trian...
authormsv <msv@opencascade.com>
Thu, 11 Aug 2022 20:46:23 +0000 (23:46 +0300)
committermsv <msv@opencascade.com>
Thu, 11 Aug 2022 21:18:22 +0000 (00:18 +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 7d721622139b5d2d422d70c5e8ddd5d4d67377ce..e08bb66f19c68fd99f678268ea8f596d844b1e42 100644 (file)
@@ -523,7 +523,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;
@@ -672,7 +672,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 d506f3648e3d2da5d13adb81b6c5c6bff7a5f04a..7a462448da70c307ba937fbb8bd91a5a99799fd8 100644 (file)
@@ -1826,7 +1826,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..a61680c
--- /dev/null
@@ -0,0 +1,14 @@
+puts "0033100: Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale triangulations"
+
+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