mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d44b7b7442 | ||
|
6b9af22de9 | ||
|
d28545ca7b |
@@ -35,17 +35,13 @@ std::pair<Standard_Real, Standard_Real> BRepMesh_ConeRangeSplitter::GetSplitStep
|
|||||||
Standard_Real aRadius = Max(Abs(aRefR + aRangeV.first * Sin(aSAng)),
|
Standard_Real aRadius = Max(Abs(aRefR + aRangeV.first * Sin(aSAng)),
|
||||||
Abs(aRefR + aRangeV.second * Sin(aSAng)));
|
Abs(aRefR + aRangeV.second * Sin(aSAng)));
|
||||||
|
|
||||||
//Face deflection used to determine circle subdivisions needs to match the one used previously
|
|
||||||
Standard_Real Dv, Du = GCPnts_TangentialDeflection::ArcAngularStep(
|
Standard_Real Dv, Du = GCPnts_TangentialDeflection::ArcAngularStep(
|
||||||
aRadius, GetDFace()->GetDeflection()*0.5,
|
aRadius, GetDFace()->GetDeflection(),
|
||||||
theParameters.Angle, theParameters.MinSize);
|
theParameters.Angle, theParameters.MinSize);
|
||||||
|
|
||||||
const Standard_Real aDiffU = aRangeU.second - aRangeU.first;
|
const Standard_Real aDiffU = aRangeU.second - aRangeU.first;
|
||||||
const Standard_Real aDiffV = aRangeV.second - aRangeV.first;
|
const Standard_Real aDiffV = aRangeV.second - aRangeV.first;
|
||||||
//compute subdivision factor acounting for the difference between the bottom and top radius of the cone
|
const Standard_Real aScale = (Du * aRadius);
|
||||||
const Standard_Real aTopRadius = aRefR > Precision::Confusion() ? aRefR : 1.0;
|
|
||||||
const Standard_Real aSubDivFactor = Max(theParameters.MinSize, Min(1.0, aTopRadius > aRadius ? aRadius / aTopRadius : aTopRadius / aRadius));
|
|
||||||
const Standard_Real aScale = (Du * aRadius * aSubDivFactor);
|
|
||||||
const Standard_Real aRatio = Max(1., Log(aDiffV / aScale));
|
const Standard_Real aRatio = Max(1., Log(aDiffV / aScale));
|
||||||
const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du);
|
const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du);
|
||||||
const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio);
|
const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio);
|
||||||
|
@@ -409,6 +409,17 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
|
NCollection_Mat4<Standard_Real> aWorldView = theCamera->OrientationMatrix();
|
||||||
|
|
||||||
|
//Adjust the camera axial scale for trihedron behaviour
|
||||||
|
gp_XYZ anAxialScale = theCamera->AxialScale();
|
||||||
|
Standard_Real anAxialX = anAxialScale.X();
|
||||||
|
Standard_Real anAxialY = anAxialScale.Y();
|
||||||
|
Standard_Real anAxialZ = anAxialScale.Z();
|
||||||
|
if (anAxialX > 0.0 && anAxialY > 0.0 && anAxialZ > 0.0)
|
||||||
|
{
|
||||||
|
Graphic3d_TransformUtils::Scale (aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ);
|
||||||
|
}
|
||||||
|
|
||||||
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
|
Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z());
|
||||||
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
Graphic3d_TransformUtils::Scale (aWorldView, aScale, aScale, aScale);
|
||||||
theWorldView.ConvertFrom (aWorldView);
|
theWorldView.ConvertFrom (aWorldView);
|
||||||
|
@@ -210,9 +210,9 @@ namespace
|
|||||||
{
|
{
|
||||||
const gp_Pnt2d aNode2d = aT->UVNode (aNodeIter);
|
const gp_Pnt2d aNode2d = aT->UVNode (aNodeIter);
|
||||||
const gp_Pnt2d aTexel = (dUmax == 0.0 || dVmax == 0.0)
|
const gp_Pnt2d aTexel = (dUmax == 0.0 || dVmax == 0.0)
|
||||||
? aNode2d
|
? aNode2d
|
||||||
: gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aNode2d.X() - aUmin)) / dUmax) / theUVScale.X(),
|
: gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aNode2d.X() - aUmin)) / dUmax) / theUVScale.X(),
|
||||||
(-theUVOrigin.Y() + (theUVRepeat.Y() * (aNode2d.Y() - aVmin)) / dVmax) / theUVScale.Y());
|
(-theUVOrigin.Y() + (theUVRepeat.Y() * (aNode2d.Y() - aVmin)) / dVmax) / theUVScale.Y());
|
||||||
anArray->AddVertex (aPoint, aNorm, aTexel);
|
anArray->AddVertex (aPoint, aNorm, aTexel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
46
tests/v3d/trihedron/bug27832
Normal file
46
tests/v3d/trihedron/bug27832
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0027832: Visualization - Scaled zbuffer trihedron"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
vinit
|
||||||
|
box b 10 10 10
|
||||||
|
vdisplay b
|
||||||
|
vfit
|
||||||
|
vsetdispmode 1
|
||||||
|
vzbufftrihedron -on
|
||||||
|
#draw initial picture of box without visual scale
|
||||||
|
vdump $imagedir/${casename}_unscaled.png
|
||||||
|
|
||||||
|
#draw picture of box after visual scale
|
||||||
|
#and zoomed out
|
||||||
|
vscale 1 3 10
|
||||||
|
vzoom 0.99
|
||||||
|
|
||||||
|
set color_1 [vreadpixel 55 360 -rgb -name]
|
||||||
|
set color_2 [vreadpixel 50 350 -rgb -name]
|
||||||
|
set color_3 [vreadpixel 55 355 -rgb -name]
|
||||||
|
|
||||||
|
if {$color_1 != "RED3"} {
|
||||||
|
puts "ERROR: trihedron does not maintain position"
|
||||||
|
puts " additional investigation is needed"
|
||||||
|
puts " expected color is: RED3"
|
||||||
|
puts " current color is: $color_1"
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$color_2 != "BLUE3"} {
|
||||||
|
puts "ERROR: trihedron does not maintain position"
|
||||||
|
puts " additional investigation is needed"
|
||||||
|
puts " expected color is: BLUE3"
|
||||||
|
puts " current color is: $color_2"
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$color_3 != "GREEN3"} {
|
||||||
|
puts "ERROR: trihedron does not maintain position"
|
||||||
|
puts " additional investigation is needed"
|
||||||
|
puts " expected color is: GREEN3"
|
||||||
|
puts " current color is: $color_3"
|
||||||
|
}
|
||||||
|
|
||||||
|
vdump $imagedir/${casename}_scaled.png
|
Reference in New Issue
Block a user