mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0026376: Imported STEP shape is partially wrong
Modification of the translation of the face based on the toroidal surface with negative major radius was made. Seems that such face is considered by "Solid Works" and "ProE wildfire 5.0" systems as face having reversed orientation. This step file was written by "Solid Works 2014".
This commit is contained in:
parent
e84806af3b
commit
1c9e5ae0f1
@ -74,6 +74,8 @@
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Transfer_TransientProcess.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <StepGeom_RectangularTrimmedSurface.hxx>
|
||||
#include <StepGeom_ToroidalSurface.hxx>
|
||||
|
||||
// Provisoire, pour VertexLoop
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
@ -116,6 +118,18 @@ StepToTopoDS_TranslateFace::StepToTopoDS_TranslateFace
|
||||
// Purpose : Init with a FaceSurface and a Tool
|
||||
// ============================================================================
|
||||
|
||||
static inline Standard_Boolean isReversed(const Handle(StepGeom_Surface)& theStepSurf)
|
||||
{
|
||||
Handle(StepGeom_ToroidalSurface) aStepTorSur;
|
||||
if(theStepSurf->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface)))
|
||||
return isReversed(Handle(StepGeom_RectangularTrimmedSurface)::DownCast(theStepSurf)->BasisSurface());
|
||||
|
||||
else
|
||||
aStepTorSur = Handle(StepGeom_ToroidalSurface)::DownCast(theStepSurf);
|
||||
|
||||
return (!aStepTorSur.IsNull() && aStepTorSur->MajorRadius() < 0 ? Standard_True : Standard_False);
|
||||
}
|
||||
|
||||
void StepToTopoDS_TranslateFace::Init
|
||||
(const Handle(StepShape_FaceSurface)& FS, StepToTopoDS_Tool& aTool, StepToTopoDS_NMTool& NMTool)
|
||||
{
|
||||
@ -187,8 +201,12 @@ void StepToTopoDS_TranslateFace::Init
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean sameSense = FS->SameSense();
|
||||
Standard_Boolean sameSenseFace = FS->SameSense();
|
||||
|
||||
//fix for bug 0026376 Solid Works wrote face based on toroidal surface having negative major radius
|
||||
//seems that such case is interpreted by "Solid Works" and "ProE" as face having reversed orientation.
|
||||
Standard_Boolean sameSense = (isReversed(StepSurf) ? !sameSenseFace : sameSenseFace);
|
||||
|
||||
// -- Statistics --
|
||||
aTool.AddContinuity (GeomSurf);
|
||||
|
||||
|
28
tests/bugs/step/bug26376
Normal file
28
tests/bugs/step/bug26376
Normal file
@ -0,0 +1,28 @@
|
||||
puts "========"
|
||||
puts "OCC26376"
|
||||
puts "========"
|
||||
puts ""
|
||||
##########################################################################
|
||||
# Imported STEP shape is partially wrong
|
||||
##########################################################################
|
||||
|
||||
stepread [locate_data_file bug26376_valve-test-meters.step] a *
|
||||
tpcompound result
|
||||
|
||||
set square 150249
|
||||
|
||||
set nbshapes_expected "
|
||||
Number of shapes in shape
|
||||
VERTEX : 23
|
||||
EDGE : 35
|
||||
WIRE : 24
|
||||
FACE : 19
|
||||
SHELL : 1
|
||||
SOLID : 1
|
||||
COMPSOLID : 0
|
||||
COMPOUND : 1
|
||||
SHAPE : 104
|
||||
"
|
||||
checknbshapes result -ref ${nbshapes_expected} -t -m "Shape"
|
||||
|
||||
set 3dviewer 1
|
Loading…
x
Reference in New Issue
Block a user