<commit_before>#include "OccTest.hpp"

#include <MechanicsFwd.hpp>
#include "OccContactShape.hpp"
#include <TopoDS_Shape.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepTools.hxx>

void OccTest::setUp()
{
}

void OccTest::tearDown()
{
}

void OccTest::t1()
{

  BRepPrimAPI_MakeSphere mksphere(1.0);

  OccContactShape sphere(mksphere.Shape());

  std::string s1 = sphere.exportBRepAsString();

  std::stringstream out;

  BRepTools::Write(mksphere.Shape(), out);

  CPPUNIT_ASSERT(out.str() == s1);

}

void OccTest::t2()
{
}<commit_msg>[Mechanics] OccTest fix tests discovery + add computeUVBound test<commit_after>#include "OccTest.hpp"

#include <MechanicsFwd.hpp>
#include "OccContactShape.hpp"
#include <TopoDS_Shape.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepTools.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>

#include <cmath>

CPPUNIT_TEST_SUITE_REGISTRATION(OccTest);

void OccTest::setUp()
{
}

void OccTest::tearDown()
{
}

void OccTest::t1()
{

  BRepPrimAPI_MakeSphere mksphere(1.0);

  OccContactShape sphere(mksphere.Shape());

  std::string s1 = sphere.exportBRepAsString();

  std::stringstream out;

  BRepTools::Write(mksphere.Shape(), out);

  CPPUNIT_ASSERT(out.str() == s1);

}

void OccTest::t2()
{

  BRepPrimAPI_MakeSphere mksphere(1.0);

  TopExp_Explorer exp;

  exp.Init(mksphere.Shape(), TopAbs_SHELL);

  TopoDS_Shell shell = TopoDS::Shell(exp.Current().Composed(mksphere.Shape().Orientation()));

  exp.Init(shell, TopAbs_FACE);

  TopoDS_Face face = TopoDS::Face(exp.Current().Composed(shell.Orientation()));

  OccContactShape sphere(face);

  sphere.computeUVBounds();

  CPPUNIT_ASSERT(std::abs(sphere.bsup1[0] - 6.28319) < 1e-4);
  CPPUNIT_ASSERT(std::abs(sphere.bsup1[1] - 1.5708) < 1e-4);

  CPPUNIT_ASSERT(std::abs(sphere.binf1[0] - 0.) < 1e-4);
  CPPUNIT_ASSERT(std::abs(sphere.binf1[1] + 1.5708) < 1e-4);

  std::cout << sphere.bsup1[0] << "," << sphere.bsup1[1] << std::endl;
  std::cout << sphere.binf1[0] << "," << sphere.binf1[1] << std::endl;

}
{'fraction_non_alphanumeric': 0.17307692307692307, 'fraction_numerical': 0.027120315581854043, 'mean_word_length': 5.718543046357616, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5811509', 'n_tokens_mistral': 870, 'n_tokens_neox': 824, 'n_words': 117}