Handle(VrmlData_Group) aTrans = new VrmlData_Group (myScene, 0L,
Standard_True);
gp_Trsf aTrsf (aLoc);
- if (fabs(myScale - 1.) > Precision::Confusion()) {
+ if (fabs(myScale - 1.) > Precision::Confusion())
+ {
const gp_XYZ aTransl = aTrsf.TranslationPart() * myScale;
aTrsf.SetTranslationPart (aTransl);
}
gp_Trsf aTrsf(aLoc);
if (fabs(myScale - 1.) > Precision::Confusion())
{
- aTrsf.SetScaleFactor(myScale);
+ const gp_XYZ aTransl = aTrsf.TranslationPart() * myScale;
+ aTrsf.SetTranslationPart(aTransl);
}
aTrans->SetTransform(aTrsf);
myScene.AddNode(aTrans, Standard_False);
// Create a Transform grouping node
aTrans = new VrmlData_Group(myScene, 0L, Standard_True);
gp_Trsf aTrsf(aLoc);
- if (fabs(myScale - 1.) > Precision::Confusion()) {
- aTrsf.SetScaleFactor(myScale);
+ if (fabs(myScale - 1.) > Precision::Confusion())
+ {
+ const gp_XYZ aTransl = aTrsf.TranslationPart() * myScale;
+ aTrsf.SetTranslationPart(aTransl);
}
aTrans->SetTransform(aTrsf);
myScene.AddNode(aTrans, theParent.IsNull());
if (!aLoc.IsIdentity())
{
gp_Trsf aTrsf(aLoc);
- if (fabs(myScale - 1.) > Precision::Confusion()) {
+ if (fabs(myScale - 1.) > Precision::Confusion())
+ {
const gp_XYZ aTransl = aTrsf.TranslationPart() * myScale;
aTrsf.SetTranslationPart(aTransl);
}
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
+#include <UnitsMethods.hxx>
#include <V3d_View.hxx>
#include <ViewerTest.hxx>
#include <VrmlAPI.hxx>
}
VrmlData_Scene aScene;
+ Standard_Real anOCCUnit = UnitsMethods::GetCasCadeLengthUnit();
+ aScene.SetLinearScale(1000. / anOCCUnit);
aScene.SetVrmlDir (aVrmlDir);
aScene << aStream;
vfit
set anArea [triarea v]
-checkreal "Triangulation area" [lindex $anArea 0] 5341500. 1. 1e-6
+checkreal "Triangulation area" [lindex $anArea 0] 5341500. 1. 1e+6
checktrinfo v -tri 12 -nod 24
#vdump $::imagedir/${::casename}.png
--- /dev/null
+puts "========="
+puts "OCC30402"
+puts "========="
+puts ""
+############################################################################
+# Data Exchange - exported VRML file has broken location information
+############################################################################
+
+set filename bug26657
+param xstep.cascade.unit MM
+ReadStep D [locate_data_file bug26657.stp]
+XGetOneShape a D
+incmesh a 0.001
+vinit Driver1/Viewer1/View1
+vdisplay a
+vfit
+vdump ${imagedir}/${test_image}_1.png
+
+file delete -force ${imagedir}/${filename}.wrl
+WriteVrml D ${imagedir}/${filename}.wrl
+loadvrml b ${imagedir}/${filename}.wrl
+vinit Driver1/Viewer2/View1
+vdisplay b
+vfit
+vdump ${imagedir}/${test_image}_2.png
+
+set sprops_a [sprops a]
+regexp {Mass\s*:\s*([0-9.e+-]+)} $sprops_a prop_s res_a_Area
+regexp {X += +([-0-9.+eE]+)} $sprops_a full res_a_X
+regexp {Y += +([-0-9.+eE]+)} $sprops_a full res_a_Y
+regexp {Z += +([-0-9.+eE]+)} $sprops_a full res_a_Z
+
+set sprops_b [sprops b]
+regexp {Mass\s*:\s*([0-9.e+-]+)} $sprops_b prop_s res_b_Area
+regexp {X += +([-0-9.+eE]+)} $sprops_b full res_b_X
+regexp {Y += +([-0-9.+eE]+)} $sprops_b full res_b_Y
+regexp {Z += +([-0-9.+eE]+)} $sprops_b full res_b_Z
+
+if { ([expr abs($res_a_Area - $res_b_Area)] > 1.e-4) } {
+ puts "Error: Bad area of face"
+}
+
+if { ([expr abs($res_a_X - $res_b_X)] > 1.e-4) ||
+ ([expr abs($res_a_Y - $res_b_Y)] > 1.e-4) ||
+ ([expr abs($res_a_Z - $res_b_Z)] > 1.e-4) } {
+ puts "Error: Location problem"
+}