mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0033101: Data Exchange - STEP reader makes unexpected enormous scaling of some parts
Modification to apply units scale factor for faces based on the triangulation
This commit is contained in:
parent
1a1739b200
commit
53152e6dd9
@ -46,6 +46,7 @@
|
|||||||
#include <ShapeAlgo.hxx>
|
#include <ShapeAlgo.hxx>
|
||||||
#include <ShapeAlgo_AlgoContainer.hxx>
|
#include <ShapeAlgo_AlgoContainer.hxx>
|
||||||
#include <StdFail_NotDone.hxx>
|
#include <StdFail_NotDone.hxx>
|
||||||
|
#include <StepData_GlobalFactors.hxx>
|
||||||
#include <StepGeom_BSplineSurface.hxx>
|
#include <StepGeom_BSplineSurface.hxx>
|
||||||
#include <StepGeom_BSplineSurfaceForm.hxx>
|
#include <StepGeom_BSplineSurfaceForm.hxx>
|
||||||
#include <StepGeom_OffsetSurface.hxx>
|
#include <StepGeom_OffsetSurface.hxx>
|
||||||
@ -488,9 +489,11 @@ StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TriangulatedFace)
|
|||||||
const Standard_Boolean aHasNormals = (theTF->NbNormals() > 0);
|
const Standard_Boolean aHasNormals = (theTF->NbNormals() > 0);
|
||||||
Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(), theTF->NbTriangles(), aHasUVNodes, aHasNormals);
|
Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(), theTF->NbTriangles(), aHasUVNodes, aHasNormals);
|
||||||
|
|
||||||
|
const Standard_Real aLF = StepData_GlobalFactors::Intance().LengthFactor();
|
||||||
for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
|
for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
|
||||||
{
|
{
|
||||||
aMesh->SetNode(j, aNodes->Value(theTF->PnindexValue(j)));
|
const gp_XYZ& aPoint = aNodes->Value(theTF->PnindexValue(j));
|
||||||
|
aMesh->SetNode(j, aPoint * aLF);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Standard_Integer k = 1; k <= theTF->NbTriangles(); ++k)
|
for (Standard_Integer k = 1; k <= theTF->NbTriangles(); ++k)
|
||||||
@ -573,9 +576,11 @@ StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_ComplexTriangulat
|
|||||||
Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(),
|
Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(),
|
||||||
aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
|
aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
|
||||||
|
|
||||||
|
const Standard_Real aLF = StepData_GlobalFactors::Intance().LengthFactor();
|
||||||
for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
|
for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
|
||||||
{
|
{
|
||||||
aMesh->SetNode(j, aNodes->Value(theTF->PnindexValue(j)));
|
const gp_XYZ& aPoint = aNodes->Value(theTF->PnindexValue(j));
|
||||||
|
aMesh->SetNode(j, aLF * aPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer k = 1;
|
Standard_Integer k = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user