MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #31047 All Revisions ] Back to Issue ]
Summary 0031047: Modeling Algorithms - BRepExtrema_DistShapeShape gives wrong result
Revision 2019-10-14 16:28 by msv
Steps To Reproduce #script 1 - test DistShapeShape

restore Face.brep f
vertex v1 -79 -282.7 0
copy v1 v2
ttranslate v2 0 0.1 0
distmini d1 f v1
distmini d2 f v2
set dist1 [dval d1_val]
set dist2 [dval d2_val]
puts "dist1=$dist1"
puts "dist2=$dist2"
if {$dist1 != $dist2} {
  puts "Error: both distances must be equal to 0"
}

#script 2 - test BRepClass_FaceClassifier

restore Face.brep f
point p1 -79 -282.7
point p2 -79 -282.6
if ![regexp "IN" [b2dclassify f p1]] {
  puts "Error: inner point p1 is classified as OUT"
}
if ![regexp "IN" [b2dclassify f p2]] {
  puts "Error: inner point p2 is classified as OUT"
}
Revision 2019-10-14 16:06 by msv
Steps To Reproduce restore Face.brep f
vertex v1 -79 -282.7 0
copy v1 v2
ttranslate v2 0 0.1 0
distmini d1 f v1
distmini d2 f v2
set dist1 [dval d1_val]
set dist2 [dval d2_val]
puts "dist1=$dist1"
puts "dist2=$dist2"
if {$dist1 != $dist2} {
  puts "Error: both distances must be equal to 0"
}
Revision 2019-10-08 17:39 by BenjaminBihler
Steps To Reproduce #include <TopoDS_Face.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <TopoDS.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>

#include <string>
#include <vector>
#include <iostream>

int main(int, char*[])
{
    BRep_Builder builder;
    TopoDS_Shape face;

    BRepTools::Read(face, "Face.brep", builder);

    gp_Pnt testPoint(-79.14602309143586467143904883414507,
            -282.66130124109884036442963406443596,
            0.00000000000000000000000000000000);

    BRepExtrema_DistShapeShape distanceComputer(face,
            BRepBuilderAPI_MakeVertex(testPoint));

    if (distanceComputer.IsDone())
    {
        std::cout << "Calculated Distance = " << distanceComputer.Value()
                << std::endl;
        if (distanceComputer.Value() > Precision::Confusion())
        {
            std::cout << "This is wrong! The distance should be (close to) zero."
                    << std::endl;
        }
    }
    else
    {
        std::cout << "Calculation failed." << std::endl;
    }

    return 0;
}


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker