View Issue Details

IDProjectCategoryView StatusLast Update
0033133CommunityOCCT:Modeling Algorithmspublic2022-09-06 11:30
ReporterOliver R Assigned Tomsv  
PrioritynormalSeverityminor 
Status newResolutionopen 
Product Version7.6.3 
Target Version7.7.0 
Summary0033133: BRepPrimAPI_MakeTorus does not return a torus
Description
when a1 is not 0 and a2 is not 2 Pi and angle is not 2 Pi things go south:

BRepPrimAPI_MakeTorus(axis, r1, r2, a1, a2, angle)

Other combination of values may also be problematic. See discussion in forum.
Steps To Reproduce
#include <iostream>
#include <gp_Ax2.hxx>
#include <TopoDS_Shape.hxx>
#include <BRepPrimAPI_MakeTorus.hxx>
#include <StlAPI_Writer.hxx>
#include <BRepMesh_IncrementalMesh.hxx>

void Generate_Shape(TopoDS_Shape * store)
{
  gp_Ax2 axis = gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1));
  Standard_Real r1 = 1.0;
  Standard_Real r2 = 0.1;
  Standard_Real a1 = -1.5708;
  Standard_Real a2 = 1.5708;
  Standard_Real angle = 2.094;
  TopoDS_Shape shape = BRepPrimAPI_MakeTorus(axis, r1, r2, a1, a2, angle).Shape();

  *store = shape;
}

void Write_STL(TopoDS_Shape * store)
{
  StlAPI_Writer stl_writer;
  BRepMesh_IncrementalMesh Mesh( *store, 0.01 );
  Mesh.Perform();

  if (stl_writer.Write(*store, "demo1.stl")) {
    std::cout << std::endl << "True ";
  } else {
    std::cout << std::endl << "False ";
  }
}

int main()
{
  TopoDS_Shape *store = new TopoDS_Shape();
  Generate_Shape(store);
  Write_STL(store);

  return 0;
} 



g++ -I ~/builds/build/include/opencascade -L ~/builds/build/lin64/gcc/lib demo_simple_13.cpp -lTKBin -lTKBinL -lTKBinTObj -lTKBinXCAF -lTKBO -lTKBool -lTKBRep -lTKCAF -lTKCDF -lTKDCAF -lTKDraw -lTKernel -lTKFeat -lTKFillet -lTKG2d -lTKG3d -lTKGeomAlgo -lTKGeomBase -lTKHLR -lTKIGES -lTKLCAF -lTKMath -lTKMesh -lTKMeshVS -lTKOffset -lTKOpenGl -lTKPrim -lTKQADraw -lTKRWMesh -lTKService -lTKShHealing -lTKStd -lTKStdL -lTKSTEP209 -lTKSTEP -lTKSTEPAttr -lTKSTEPBase -lTKSTL -lTKTObj -lTKTObjDRAW -lTKTopAlgo -lTKTopTest -lTKV3d -lTKVCAF -lTKViewerTest -lTKVRML -lTKXCAF -lTKXDEDRAW -lTKXDEIGES -lTKXDESTEP -lTKXMesh -lTKXml -lTKXmlL -lTKXmlTObj -lTKXmlXCAF -lTKXSBase -lTKXSDRA
Additional information
and documentation updates
Discussed here:

https://dev.opencascade.org/content/brepprimapimaketorus-does-not-return-torus
TagsNo tags attached.
Test case number

Attached Files

  • WrongTorus.jpeg (8,990 bytes)

Relationships

has duplicate 0033134 feedbackbugmaster BRepPrimAPI_MakeTorus does not return a torus 

Activities

Oliver R

2022-09-06 08:56

reporter  

WrongTorus.jpeg (8,990 bytes)

Oliver R

2022-09-06 09:05

reporter   ~0110698

The problem persists if you change

Standard_Real a1 = -1.5708;

to

Standard_Real a1 = 1.5708/2;

Issue History

Date Modified Username Field Change
2022-09-06 08:56 Oliver R New Issue
2022-09-06 08:56 Oliver R Assigned To => msv
2022-09-06 08:56 Oliver R File Added: WrongTorus.jpeg
2022-09-06 09:05 Oliver R Note Added: 0110698
2022-09-06 10:00 kgv Target Version => 7.7.0
2022-09-06 10:00 kgv Steps to Reproduce Updated
2022-09-06 10:00 kgv Steps to Reproduce Updated
2022-09-06 10:01 kgv Steps to Reproduce Updated
2022-09-06 11:30 msv Relationship added has duplicate 0033134