View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022605 | Community | OCCT:Modeling Algorithms | public | 2011-06-15 11:34 | 2023-08-01 15:08 |
Reporter | Assigned To | ||||
Priority | normal | Severity | trivial | ||
Status | assigned | Resolution | reopened | ||
OS | All | ||||
Target Version | Unscheduled | ||||
Summary | 0022605: Vertex tolerance is not recognized during edge creation | ||||
Description | Post from the Forum - http://www.opencascade.org/org/forum/thread_20771/. It contains patch (to be analyzed). ------------------------------------------------------------------------- Vertex tolerance is not recognized during edge creation (in certain cases) ------------------------------------------------------------------------- Hi, I have just stumbled across the following code in BRepLib_MakeEdge.cxx. It's a routine to check, whether the vertices used for creation of an edge from a 2d curve on a surface are actually lying on the curve. The code appears inconsistent with the vertex tolerance definition to me: In the code below, the vertex tolerance is considered for vertices lying at FirstParameter and LastParameter on the curve and it is NOT considered for vertices lying somewhere in between. They get projected on the curve, next it is tested whether their projection and the original point are equal up to Precision::Confusion. This is an unnecessary harsh requirement. I should be able to create an edge limited by vertices lying in the vicinity of the curve only up to their vertex tolerance. Why? In order to be a valid edge, the distance between the respective parameters on the curve and the vertices has to be below the vertex tolerance. They don't have to be equal up to Precision::Confusion()! static Standard_Boolean Project(const Handle(Geom2d_Curve)& C, const Handle(Geom_Surface)& S, const TopoDS_Vertex& V, Standard_Real& p) { gp_Pnt P = BRep_Tool::Pnt(V); Standard_Real Eps2 = BRep_Tool::Tolerance(V); Eps2 *= Eps2; static Handle(Geom2dAdaptor_HCurve) HG2AHC; if ( HG2AHC.IsNull() ) HG2AHC = new Geom2dAdaptor_HCurve(); HG2AHC->Set(C); static Handle(GeomAdaptor_HSurface) HGAHS; if ( HGAHS.IsNull() ) HGAHS = new GeomAdaptor_HSurface(); HGAHS->Set(S); Adaptor3d_CurveOnSurface ACOS(HG2AHC,HGAHS); Standard_Real D1,D2; gp_Pnt P1,P2; P1 = ACOS.Value(ACOS.FirstParameter()); P2 = ACOS.Value(ACOS.LastParameter()); D1 = P1.SquareDistance(P); D2 = P2.SquareDistance(P); if ( (D1 < D2) && (D1 <= Eps2) ) { p = ACOS.FirstParameter(); return Standard_True; } else if ( (D2 < D1) && (D2 <= Eps2) ) { p = ACOS.LastParameter(); return Standard_True; } Extrema_ExtPC extrema(P,ACOS); if (extrema.IsDone()) { Standard_Integer i, index = 0, n = extrema.NbExt(); Standard_Real Dist2 = RealLast(), dist2min; for (i = 1; i <= n; i++) { dist2min = extrema.SquareDistance(i); if (dist2min < Dist2) { index = i; Dist2 = dist2min; } } if (index != 0) { Extrema_POnCurv POC = extrema.Point(index); if (P.SquareDistance(POC.Value()) <= Precision::Confusion() * Precision::Confusion()) { p = POC.Parameter(); return Standard_True; } } } return Standard_False; } | ||||
Tags | No tags attached. | ||||
Test case number | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2011-08-02 11:31 | bugmaster | Category | OCCT:MOA => OCCT:Modeling Algorithms |
2011-11-24 16:39 |
|
Assigned To | bugmaster => jgv |
2011-11-24 16:39 |
|
Status | acknowledged => assigned |
2011-11-24 16:39 |
|
Resolution | suspended => reopened |
2011-11-24 16:39 |
|
Fixed in Version | EMPTY => |
2011-11-24 16:39 |
|
Description Updated | |
2014-07-14 09:41 |
|
Assigned To | jgv => ifv |
2014-07-14 09:41 |
|
Target Version | => 6.8.0 |
2014-07-25 17:17 |
|
Assigned To | ifv => jgv |
2014-09-26 14:23 |
|
Target Version | 6.8.0 => 7.1.0 |
2016-10-28 15:33 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-21 11:34 |
|
Target Version | 7.2.0 => 7.3.0 |
2017-12-05 17:09 |
|
Target Version | 7.3.0 => 7.4.0 |
2019-08-12 16:44 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-14 22:55 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-08-29 18:52 |
|
Target Version | 7.6.0 => 7.7.0 |
2022-10-24 10:42 |
|
Target Version | 7.7.0 => 7.8.0 |
2023-08-01 15:08 | dpasukhi | Target Version | 7.8.0 => Unscheduled |