}
myVertices.Bind(pBegin, ipf);
}
- theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst, ipf, theGFace, mindist, myLocation2d);
+
+ Handle(BRepMesh_FaceAttribute) aFaceAttribute;
+ GetFaceAttribute ( theFace, aFaceAttribute );
+ theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst,
+ ipf, theGFace, mindist, aFaceAttribute, myLocation2d);
+
BRepMesh_Vertex vf(theUV, ipf, BRepMesh_Frontier);
Standard_Integer ivf = myStructure->AddNode(vf);
myVertices.Bind(pEnd,ipl);
}
}
- theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl, theGFace, mindist, myLocation2d);
+
+ theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl,
+ theGFace, mindist, aFaceAttribute, myLocation2d);
+
BRepMesh_Vertex vl(theUV, ipl, BRepMesh_Frontier);
Standard_Integer ivl= myStructure->AddNode(vl);
myVertices.Bind(pBegin,ipf);
}
NewNodInStruct(1) = ipf;
- theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst, ipf, gFace, mindist, myLocation2d);
+
+ Handle(BRepMesh_FaceAttribute) aFaceAttribute;
+ GetFaceAttribute ( theFace, aFaceAttribute );
+ theUV = BRepMesh_FastDiscretFace::FindUV(pBegin, uvFirst, ipf,
+ gFace, mindist, aFaceAttribute, myLocation2d);
+
BRepMesh_Vertex vf(theUV,ipf,BRepMesh_Frontier);
iv1 = myStructure->AddNode(vf);
isv1 = myVemap.FindIndex(iv1);
}
}
NewNodInStruct(nbnodes) = ipl;
- theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl, gFace, mindist, myLocation2d);
+ theUV = BRepMesh_FastDiscretFace::FindUV(pEnd, uvLast, ipl,
+ gFace, mindist, aFaceAttribute, myLocation2d);
+
BRepMesh_Vertex vl(theUV,ipl,BRepMesh_Frontier);
ivl = myStructure->AddNode(vl);
theXY : Pnt2d from gp;
theIp : Integer from Standard;
theSFace : HSurface from BRepAdaptor;
- theMinDist : Real from Standard;
+ theMinDist : Real from Standard;
+ theFaceAttribute: FaceAttribute from BRepMesh;
theLocation2dMap: in out DataMapOfIntegerListOfXY from BRepMesh)
returns XY from gp;
if (mindist < BRep_Tool::Tolerance(pBegin) ||
mindist < BRep_Tool::Tolerance(pEnd) ) mindist = theDefEdge;
- anUV = FindUV(pBegin, uvFirst, ipf, theSurf, mindist, myLocation2d);
+ anUV = FindUV(pBegin, uvFirst, ipf, theSurf, mindist, myAttrib, myLocation2d);
Standard_Integer iv1, isv1;
BRepMesh_Vertex vf(anUV, ipf, BRepMesh_Frontier);
iv1 = myStructure->AddNode(vf);
}
}
- anUV = FindUV(pEnd, uvLast, ipl, theSurf, mindist, myLocation2d);
+ anUV = FindUV(pEnd, uvLast, ipl, theSurf, mindist, myAttrib, myLocation2d);
BRepMesh_Vertex vl(anUV, ipl, BRepMesh_Frontier);
Standard_Integer isvl;
//purpose :
//=======================================================================
-gp_XY BRepMesh_FastDiscretFace::FindUV(const TopoDS_Vertex& theV,
- const gp_Pnt2d& theXY,
- const Standard_Integer theIp,
- const Handle(BRepAdaptor_HSurface)& theSFace,
- const Standard_Real theMinDist,
- BRepMesh_DataMapOfIntegerListOfXY& theLocation2dMap)
+gp_XY BRepMesh_FastDiscretFace::FindUV(const TopoDS_Vertex& theV,
+ const gp_Pnt2d& theXY,
+ const Standard_Integer theIp,
+ const Handle(BRepAdaptor_HSurface)& theSFace,
+ const Standard_Real theMinDist,
+ const Handle(BRepMesh_FaceAttribute)& theFaceAttribute,
+ BRepMesh_DataMapOfIntegerListOfXY& theLocation2dMap)
{
gp_XY anUV;
if (theLocation2dMap.IsBound(theIp))
const Standard_Real tol = Min(2. * BRep_Tool::Tolerance(theV), theMinDist);
- const Standard_Real Utol2d = .5 * (theSFace->LastUParameter() - theSFace->FirstUParameter());
- const Standard_Real Vtol2d = .5 * (theSFace->LastVParameter() - theSFace->FirstVParameter());
+ Standard_Real aDiffU, aDiffV;
+
+ if ( theFaceAttribute.IsNull() )
+ {
+ aDiffU = theSFace->LastUParameter() - theSFace->FirstUParameter();
+ aDiffV = theSFace->LastVParameter() - theSFace->FirstVParameter();
+ }
+ else
+ {
+ aDiffU = theFaceAttribute->GetUMax() - theFaceAttribute->GetUMin();
+ aDiffV = theFaceAttribute->GetVMax() - theFaceAttribute->GetVMin();
+ }
+
+ const Standard_Real Utol2d = .5 * aDiffU;
+ const Standard_Real Vtol2d = .5 * aDiffV;
const gp_Pnt p1 = theSFace->Value(anUV.X(), anUV.Y());
const gp_Pnt p2 = theSFace->Value(theXY.X(), theXY.Y());
}
Standard_Real mindist = BRep_Tool::Tolerance(theVert);
// gp_Pnt2d uvXY = BRep_Tool::Parameters(theVert,theFace);
- gp_XY anUV = FindUV(theVert, uvXY, indVert, thegFace, mindist, myLocation2d);
+ gp_XY anUV = FindUV(theVert, uvXY, indVert, thegFace, mindist, myAttrib, myLocation2d);
BRepMesh_Vertex vf(anUV, indVert, BRepMesh_Fixed);
Standard_Integer ivff = myStructure->AddNode(vf);
Standard_Integer isvf = myVemap.FindIndex(ivff);
+puts "TODO OCC23832 ALL: Error : area by triangles differs from the actual area by"
+
puts "================"
puts "OCC22818"
puts "================"
set nb_compound_good 0
set nb_shape_good 21
-set 3dviewer 1
+vinit
+vdisplay result
+vsetdispmode 1
+vfit
+vzfit
+
+# relative tolerance (%)
+set rel_tol 1
+set area_eps 0
+#
+puts "\nChecking triangulation area (triarea command)..."
+set rel_err [expr abs([CheckTriArea result $area_eps])]
+if { $rel_err > $rel_tol } {
+ puts "Error : area by triangles differs from the actual area by $rel_err %"
+} else {
+ if { $rel_tol > 1 && $rel_tol < 100 } {
+ puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
+ }
+}
+
+set only_screen 1
+puts "TODO OCC23832 ALL: Error : area by triangles differs from the actual area by"
+
puts "================"
puts "OCC22818"
puts "================"
set nb_compound_good 0
set nb_shape_good 21
-set 3dviewer 1
+vinit
+vdisplay result
+vsetdispmode 1
+vfit
+vzfit
+
+# relative tolerance (%)
+set rel_tol 1
+set area_eps 0
+#
+puts "\nChecking triangulation area (triarea command)..."
+set rel_err [expr abs([CheckTriArea result $area_eps])]
+if { $rel_err > $rel_tol } {
+ puts "Error : area by triangles differs from the actual area by $rel_err %"
+} else {
+ if { $rel_tol > 1 && $rel_tol < 100 } {
+ puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
+ }
+}
+
+set only_screen 1
--- /dev/null
+puts "================"
+puts "OCC22818"
+puts "================"
+puts ""
+#######################################################################################
+# Wrong triangulation of Revolution surface with slice angle <= 180 degree
+######################################################################################
+
+set BugNumber OCC22818
+
+pcone result 10 0 10 180
+
+checkshape result
+
+set square 479.224
+
+set nb_v_good 4
+set nb_e_good 7
+set nb_w_good 4
+set nb_f_good 4
+set nb_sh_good 1
+set nb_sol_good 1
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 21
+
+vinit
+vdisplay result
+vsetdispmode 1
+vfit
+vzfit
+
+# relative tolerance (%)
+set rel_tol 1
+set area_eps 0
+#
+puts "\nChecking triangulation area (triarea command)..."
+set rel_err [expr abs([CheckTriArea result $area_eps])]
+if { $rel_err > $rel_tol } {
+ puts "Error : area by triangles differs from the actual area by $rel_err %"
+} else {
+ if { $rel_tol > 1 && $rel_tol < 100 } {
+ puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
+ }
+}
+
+set only_screen 1
--- /dev/null
+puts "================"
+puts "OCC22818"
+puts "================"
+puts ""
+#######################################################################################
+# Wrong triangulation of Revolution surface with slice angle <= 180 degree
+######################################################################################
+
+set BugNumber OCC22818
+
+pcone result 10 0 20 180
+incmesh result 0.1
+triangles result
+isos result 0
+
+checkshape result
+
+set square 708.32
+
+set nb_v_good 4
+set nb_e_good 7
+set nb_w_good 4
+set nb_f_good 4
+set nb_sh_good 1
+set nb_sol_good 1
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 21
+
+vinit
+vdisplay result
+vsetdispmode 1
+vfit
+vzfit
+
+# relative tolerance (%)
+set rel_tol 1
+set area_eps 0
+#
+puts "\nChecking triangulation area (triarea command)..."
+set rel_err [expr abs([CheckTriArea result $area_eps])]
+if { $rel_err > $rel_tol } {
+ puts "Error : area by triangles differs from the actual area by $rel_err %"
+} else {
+ if { $rel_tol > 1 && $rel_tol < 100 } {
+ puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
+ }
+}
+
+set only_screen 1