View Issue Details

IDProjectCategoryView StatusLast Update
0033398CommunityOCCT:Modeling Algorithmspublic2023-05-25 20:15
ReporterLyndon Alcock Assigned Toakaftasev  
Status newResolutionopen 
PlatformWindowsOSVC++ 2022 
Product Version7.7.1 
Summary0033398: Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception on specific STEP model
DescriptionI have code that appears to throw error ```Unhandled exception at 0x00007FFAA0BFE468 (TKG2d.dll) in quad-remeshing-algorithm.exe: 0xC0000005: Access violation reading location 0x0000000000000000.``` along with this there should be a method on ShapeUpgrade_UnifySameDomain to check whether an operation is completed successfully.
Steps To ReproduceStep file in upload files, this is my code:
#include <iostream>
#include <fstream>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <STEPControl_Reader.hxx>
#include <STEPControl_Writer.hxx>
#include <TopoDS.hxx>

int main()
    const char* inputPath = "ball-valve.step";
    const char* outputPath = "output.step";

    // Initialize the STEP reader
    STEPControl_Reader reader;
    if (reader.ReadFile(inputPath) != IFSelect_RetDone)
        std::cout << "Error: cannot read file." << std::endl;
        return 1;

    // Check the load status
    reader.PrintCheckLoad(true, IFSelect_ItemsByEntity);
    if (reader.TransferRoots() != reader.NbRootsForTransfer())
        std::cout << "Error: roots transferred unsuccessfully." << std::endl;
        return 1;

    // Get the shape from the reader
    TopoDS_Shape shape = reader.Shape();

    // Perform "unify domains" algorithm
    ShapeUpgrade_UnifySameDomain unifyDomains(shape);
    TopoDS_Shape unifiedShape = unifyDomains.Shape();

    // Write the unified shape to STEP file
    STEPControl_Writer writer;
    writer.Transfer(unifiedShape, STEPControl_AsIs);
    if (!writer.Write(outputPath))
        std::cout << "Error: failed to write output file." << std::endl;
        return 1;

    return 0;
TagsNo tags attached.
Test case number

Attached Files

  • ball-valve.step (1,421,303 bytes)


Lyndon Alcock

2023-05-25 11:48

reporter   ~0113586

ball-valve.step (1,421,303 bytes)

Issue History

Date Modified Username Field Change
2023-05-25 11:48 Lyndon Alcock New Issue
2023-05-25 11:48 Lyndon Alcock Assigned To => akaftasev
2023-05-25 11:48 Lyndon Alcock Note Added: 0113586
2023-05-25 11:48 Lyndon Alcock File Added: ball-valve.step
2023-05-25 19:14 dpasukhi Category PRODUCTS:Mesh Tools => OCCT:Modeling Algorithms
2023-05-25 19:14 dpasukhi Summary ShapeUpgrade_UnifySameDomain throws exception on specific STEP model => Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception on specific STEP model
2023-05-25 20:15 dpasukhi Steps to Reproduce Updated