View Issue Details

IDProjectCategoryView StatusLast Update
0029670CommunityOCCT:DRAWpublic2019-01-28 10:54
Reportereryar Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version7.2.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0029670: Draw Harness - vtrihedron xaxis zaxis is wrong
DescriptionWhen I use the command "vtrihedron" to show a frenet frame, it is wrong in the occ7.2.0, but is correct in occ6.9.1.
Steps To Reproduce#include <TColgp_Array1OfPnt.hxx>

#include <math_BullardGenerator.hxx>

#include <GCPnts_UniformAbscissa.hxx>
#include <GCPnts_UniformDeflection.hxx>
#include <GCPnts_TangentialDeflection.hxx>
#include <GCPnts_QuasiUniformDeflection.hxx>

#include <Geom_BSplineCurve.hxx>

#include <GeomAdaptor_HCurve.hxx>

#include <GeomAPI_PointsToBSpline.hxx>

#include <GeomFill_Fixed.hxx>
#include <GeomFill_Frenet.hxx>
#include <GeomFill_ConstantBiNormal.hxx>
#include <GeomFill_CorrectedFrenet.hxx>
#include <GeomFill_Darboux.hxx>
#include <GeomFill_DiscreteTrihedron.hxx>
#include <GeomFill_GuideTrihedronAC.hxx>
#include <GeomFill_GuideTrihedronPlan.hxx>

#include <BRepBuilderAPI_MakeEdge.hxx>

#include <BRepTools.hxx>


#pragma comment(lib, "TKernel.lib")
#pragma comment(lib, "TKMath.lib")

#pragma comment(lib, "TKG2d.lib")
#pragma comment(lib, "TKG3d.lib")
#pragma comment(lib, "TKGeomBase.lib")
#pragma comment(lib, "TKGeomAlgo.lib")

#pragma comment(lib, "TKBRep.lib")
#pragma comment(lib, "TKTopAlgo.lib")


void test()
{
    TColgp_Array1OfPnt aPoints(1, 6);
    math_BullardGenerator aBullardGenerator;
    for (Standard_Integer i = aPoints.Lower(); i <= aPoints.Upper(); ++i)
    {
        Standard_Real aX = aBullardGenerator.NextReal() * 50.0;
        Standard_Real aY = aBullardGenerator.NextReal() * 50.0;
        Standard_Real aZ = aBullardGenerator.NextReal() * 50.0;

        aPoints.SetValue(i, gp_Pnt(aX, aY, aZ));
    }

    GeomAPI_PointsToBSpline aBSplineFitter(aPoints);
    if (!aBSplineFitter.IsDone())
    {
        return;
    }

    std::ofstream aTclFile("d:/tcl/trihedron.tcl");

    aTclFile << std::fixed;
    aTclFile << "vclear" << std::endl;

    Handle(Geom_BSplineCurve) aBSplineCurve = aBSplineFitter.Curve();
    Handle(GeomAdaptor_HCurve) aCurveAdaptor = new GeomAdaptor_HCurve(aBSplineCurve);

    BRepBuilderAPI_MakeEdge anEdgeMaker(aBSplineCurve);
    BRepTools::Write(anEdgeMaker, "d:/edge.brep");

    aTclFile << "restore " << " d:/edge.brep e" << std::endl;
    aTclFile << "incmesh e " << " 0.01" << std::endl;
    aTclFile << "vdisplay e " << std::endl;

    Handle(GeomFill_Frenet) aFrenet = new GeomFill_Frenet();
    aFrenet->SetCurve(aCurveAdaptor);

    GCPnts_UniformAbscissa aPointSampler(aCurveAdaptor->Curve(), 5.0);
    for (Standard_Integer i = 1; i <= aPointSampler.NbPoints(); ++i)
    {
        Standard_Real aParam = aPointSampler.Parameter(i);
        gp_Pnt aP = aCurveAdaptor->Value(aParam);

        gp_Vec aT;
        gp_Vec aN;
        gp_Vec aB;

        aFrenet->D0(aParam, aT, aN, aB);

        // vtrihedron in opencascade draw 6.9.1
        aTclFile << "vtrihedron vt" << i << " " << aP.X() << " " << aP.Y() << " " << aP.Z() << " "
                 << " " << aB.X() << " " << aB.Y() << " " << aB.Z() << " "
                 << " " << aT.X() << " " << aT.Y() << " " << aT.Z() << std::endl;

        // vtrihedron in opencascade draw 7.1.0 has bug.
        /*aTclFile << "vtrihedron vt" << i << " -origin " << aP.X() << " " << aP.Y() << " " << aP.Z() << " "
            << " -zaxis " << aB.X() << " " << aB.Y() << " " << aB.Z() << " "
            << " -xaxis " << aT.X() << " " << aT.Y() << " " << aT.Z() << std::endl;*/

        // vtrihedron in opencascade draw 7.2.0
        /*aTclFile << "vtrihedron vt" << i << " -origin " << aP.X() << " " << aP.Y() << " " << aP.Z() << " "
            << " -zaxis " << aB.X() << " " << aB.Y() << " " << aB.Z() << " "
            << " -xaxis " << aT.X() << " " << aT.Y() << " " << aT.Z() << std::endl;
        aTclFile << "vtrihedron vt" << i << " -labels xaxis T 1" << std::endl;
        aTclFile << "vtrihedron vt" << i << " -labels yaxis N 1" << std::endl;
        aTclFile << "vtrihedron vt" << i << " -labels zaxis B 1" << std::endl;*/

        aTclFile << "vsize vt" << i << " 2" << std::endl;
    }
}

int main(int argc, char* argv[])
{
    test();

    return 0;
}

TagsNo tags attached.
Test case numberbugs/vis/bug27958

Attached Files

  • frenet-occ6.9.1.png (67,661 bytes)
  • frenet-occ7.2.0.png (63,791 bytes)
  • trih_691.png (6,511 bytes)
  • trih_master.png (8,042 bytes)
  • edge.brep (789 bytes)
  • trihedron.tcl (6,106 bytes)

Relationships

related to 0029671 newabv Community Foundation Classes - Remove the direction recomputed mechanism for gp_Ax2 
child of 0027958 closedbugmaster Open CASCADE Visualization, AIS_Trihedron - add shaded presentation option 

Activities

eryar

2018-04-03 14:31

developer  

frenet-occ6.9.1.png (67,661 bytes)

eryar

2018-04-03 14:32

developer  

frenet-occ7.2.0.png (63,791 bytes)

eryar

2018-04-03 14:36

developer   ~0075149

The different is the following:
// 6.9.1 ViewerTest_ObjectCommands.cxx
Handle(Geom_Axis2Placement) aPlacement = new Geom_Axis2Placement (anOrigin, aDirZ, aDirX);
  Handle(AIS_Trihedron) aShape = new AIS_Trihedron (aPlacement);

// 7.2.0 ViewerTest_ObjectCommands.cxx
Handle(TColStd_HSequenceOfAsciiString) aValues;
    Handle(Geom_Axis2Placement) aComponent = theTrihedron->Component();
    if (aMapOfArgs.Find ("origin", aValues))
    {
      aComponent->SetLocation (gp_Pnt (aValues->Value (1).RealValue(),
                                       aValues->Value (2).RealValue(),
                                       aValues->Value (3).RealValue()));
    }
    Handle(TColStd_HSequenceOfAsciiString) aXValues, aZValues;
    if (aMapOfArgs.Find ("xaxis", aXValues) && aMapOfArgs.Find ("zaxis", aZValues))
    {
      gp_Dir aXDir (aXValues->Value (1).RealValue(),
                    aXValues->Value (2).RealValue(),
                    aXValues->Value (3).RealValue());

      gp_Dir aZDir (aZValues->Value (1).RealValue(),
                    aZValues->Value (2).RealValue(),
                    aZValues->Value (3).RealValue());

      if (!aZDir.IsNormal (aXDir, M_PI / 180.0))
      {
        std::cout << "Syntax error - parameters 'xaxis' and 'zaxis' are not applied as VectorX is not normal to VectorZ\n";
        return Standard_False;
      }

      aComponent->SetXDirection(aXDir);
      aComponent->SetDirection (aZDir);
    }

kgv

2019-01-10 15:31

developer  

trih_691.png (6,511 bytes)

kgv

2019-01-10 15:31

developer  

trih_master.png (8,042 bytes)

kgv

2019-01-10 15:32

developer  

edge.brep (789 bytes)

kgv

2019-01-10 15:32

developer  

trihedron.tcl (6,106 bytes)

git

2019-01-10 15:40

administrator   ~0081717

Branch CR29670 has been created by kgv.

SHA-1: fee617a347ff463b33af161be4d7a1061ec53447


Detailed log of new commits:

Author: kgv
Date: Thu Jan 10 15:36:23 2019 +0300

    0029670: Draw Harness - vtrihedron xaxis zaxis is wrong
    
    Fixed gp_Ax2 initialization by two vectors.

kgv

2019-01-10 16:53

developer   ~0081724

Patch is ready for review.

Existing test case bugs/vis/bug2795 reflects changes in the patch.
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR29670-master-KGV/

git

2019-01-10 21:37

administrator   ~0081737

Branch CR29670 has been updated forcibly by kgv.

SHA-1: 0bc7fed82cee06f84e8c35c007502a4bae0e53c1

san

2019-01-11 19:39

developer   ~0081755

Branch CR29670 reviewed without remarks.

Actually, the affected test case is bugs/vis/bug27958.

eryar

2019-01-12 08:29

developer   ~0081759

fantastic!

bugmaster

2019-01-15 14:54

administrator   ~0081782

Combination -
OCCT branch : CR29670 SHA - 0bc7fed82cee06f84e8c35c007502a4bae0e53c1
Products branch : master SHA - 0b9df64a156abd5cbfbfccb15967b46cdabfe1f8
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16353.230000000067 / 16388.860000000008 [-0.22%]
Products
Total CPU difference: 7181.130000000038 / 7172.62000000003 [+0.12%]
Windows-64-VC14:
OCCT
Total CPU difference: 17743.46875 / 17753.9375 [-0.06%]
Products
Total CPU difference: 8596.71875 / 8592.53125 [+0.05%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2019-01-28 10:54

administrator   ~0081889

Branch CR29670 has been deleted by inv.

SHA-1: 0bc7fed82cee06f84e8c35c007502a4bae0e53c1

Related Changesets

occt: master 169c944c

2019-01-10 12:36:23

kgv


Committer: bugmaster Details Diff
0029670: Draw Harness - vtrihedron xaxis zaxis is wrong

Fixed gp_Ax2 initialization by two vectors.
Fixed -labels arguments number check.
Affected Issues
0029670
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File

Issue History

Date Modified Username Field Change
2018-04-03 14:31 eryar New Issue
2018-04-03 14:31 eryar Assigned To => apn
2018-04-03 14:31 eryar File Added: frenet-occ6.9.1.png
2018-04-03 14:32 eryar File Added: frenet-occ7.2.0.png
2018-04-03 14:36 eryar Note Added: 0075149
2018-04-03 14:44 eryar Relationship added related to 0029671
2019-01-10 14:30 kgv Relationship added child of 0027958
2019-01-10 15:31 kgv File Added: trih_691.png
2019-01-10 15:31 kgv File Added: trih_master.png
2019-01-10 15:32 kgv File Added: edge.brep
2019-01-10 15:32 kgv File Added: trihedron.tcl
2019-01-10 15:39 kgv Summary vtrihedron xaxis zaxis is wrong => Draw Harness - vtrihedron xaxis zaxis is wrong
2019-01-10 15:39 kgv Steps to Reproduce Updated
2019-01-10 15:40 git Note Added: 0081717
2019-01-10 16:53 kgv Note Added: 0081724
2019-01-10 16:53 kgv Assigned To apn => san
2019-01-10 16:53 kgv Status new => resolved
2019-01-10 21:37 git Note Added: 0081737
2019-01-11 19:39 san Note Added: 0081755
2019-01-11 19:39 san Assigned To san => bugmaster
2019-01-11 19:39 san Status resolved => reviewed
2019-01-12 08:29 eryar Note Added: 0081759
2019-01-15 14:54 bugmaster Note Added: 0081782
2019-01-15 14:54 bugmaster Status reviewed => tested
2019-01-15 14:57 bugmaster Test case number => bugs/vis/bug27958
2019-01-27 11:24 bugmaster Changeset attached => occt master 169c944c
2019-01-27 11:24 bugmaster Status tested => verified
2019-01-27 11:24 bugmaster Resolution open => fixed
2019-01-28 10:54 git Note Added: 0081889