1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

Compare commits

..

20 Commits

Author SHA1 Message Date
oan
924b30b508 0031395: Mesh - BRepMesh produces poor mesh on shape with hidden self-intersections
Add parameter UseVertexTolerance to curve tessellator;
Use UseVertexTolerance in case if model healer has failed 5 times at row;
Do not treat 2d loops that fit in 3d tolerance as OK cases.
2022-12-27 15:25:50 +03:00
oan
8ffccd9067 0031395: Mesh - BRepMesh produces poor mesh on shape with hidden self-intersections
Take vertex tolerance into account to avoid excessive points leading to self-intersections in discrete model
2022-12-27 14:25:59 +03:00
akaftasev
686926c0a9 0033247: Modeling Algorithm - BOP report small edges problem and produce empty result
Build shifted pcurve for ellipse and circle cases.
2022-12-22 16:20:54 +00:00
akaftasev
a638dd6224 0033265: Modeling Algorithms - Boolean operation hangs on the attached shapes
Added test case.
2022-12-16 14:28:08 +00:00
ifv
961a306dc4 0033244: Modeling Algorithms - Surface-surface intersection produces the double curves
IntAna_QuadQuadGeo.cxx - estimation of angular tolerance is added for case cone-cone

tests/lowalgos/intss/bug33244 - new test case added
2022-12-12 10:27:10 +03:00
ifv
195a068c4f 0030781: Sweep algorithm creates non-planar edges (orig. BOPAlgo_MakerVolume fails to build a solid)
BRepFill/BRepFill_AdvancedEvolved.cxx - estimation of angular tolerance is added in method GetLids()

tests/evolved/voluved/bug30781 - new test added
2022-12-10 14:04:53 +00:00
dpasukhi
669e0dfc17 0033246: Data Exchange, DE Wrapper - Checking license leads to performance problem
ReWork UpdateLoad functionality:
UpdateLoad calls only if provider is found.
UpdateLoad calls only for chosen type of translation (read/write)
Add new method to UpdateLoad all registered nodes.
2022-12-10 14:02:56 +00:00
nunomsil
74cb5673a5 0031919: Modeling Algorithms - General Fuse raises exception on attempt to imprint a contour to a shell
Exception no longer occurs in current version. However, fuzzyvalue should be set to 1 for the result of the operation to make sense (result of common is 1 wire). Test case added
2022-12-07 14:45:36 +00:00
dpasukhi
768f3a4a19 0033235: Configuration - Solving the problem with static building of ExpToCasExe
Added new dependency to ExpToCasExe - CSF_wsock32 (on Win only)
2022-12-04 13:49:06 +03:00
dpasukhi
2a8c5ad46c 0033250: Configuration - Missing Limits header file
Added new include limits to fix build problem
2022-12-04 13:48:24 +03:00
stv
7ea3eff4f8 0033218: Data Exchange - XCAFPrs_Texture not allow to use classes inherited from Image_Texture
Type of field XCAFPrs_Texture::myImageSource was changed from Image_Texture to Handle(Image_Texture)
2022-12-04 13:47:36 +03:00
dpasukhi
c07f4ee70d 0033232: Data Exchange, DE_Wrapper - Implement ability to change global session
Add ability to set/get global session
2022-12-04 13:46:38 +03:00
dpasukhi
6cc679d81c 0033230: Data Exchange, DE Wrapper - Update API to find CAD provider
Moved FindProvider method to public section
Made FindProvider as virtual to make it possible to overwrite.
2022-12-04 13:46:38 +03:00
dpasukhi
62f554bc3f 0033228: Data Exchange, DE Wrapper - Make the document argument of the method Read const handle
Rewrite document argument for DE_Wrapper Read method
2022-12-04 13:46:37 +03:00
sshutina
7eeb5d5fbf 0032965: PMIVis - PMIVis_TOT_Vectorized text regressions
Added the ability to draw a shaded shape in the required group.
2022-12-04 13:44:52 +03:00
oan
9b7f1aea28 0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()
Define minimum number of points for specific types of curves like it was done for circular edges.
2022-12-04 13:43:52 +03:00
knosulko
1e96cf65fa 0033156: Modeling Algorithms - Planar face creation problem
BRepLib_MakeFace::BRepLib_MakeFace: deleted degenerative edges from the input wire;
add test tests\mkface\mkplane\bug33156.
2022-12-04 13:42:28 +03:00
ddzama
03275c0be1 0022821: Crash with BRepFilletAPI_MakeFillet
test bugs modalg_7 bug22821 failed on fillet shape with 5-th edge.
Experimentally has been found that reducing of parameter
ChFi3d_Builder::tolesp for this task solves the issue.

So, as soluton it is proposed to link parameter toleps with parameter range of
spine curve. So, production coefficient has been set to pass all tests and
2 teset was extended: tests/blend/complex/A6, tests/bugs/modalg_7/bug22821

first has been extended to test different scaling factors,
second has been extended to make fillet on all edges from 12.

Additionally:
 - fixed misusage of tolesp in contexts where tolerance of point in 3d is excepted;
     In some context usage of tol_esp is irrelevant, because its essentiality - tolerance of the parameter on the 3d curve.
     So, in such context it has been replaced with new parameter tol3d (with fix value 1.0e-4).
     Get rid of tolapp3d duplication constant - tol_3d
 - tolesp = 5.0e-5 * (umax - umin)
 - tolesp replaced by tolpoint2d/tolpoint3d in several classes.
     Blend_Walking
     BRepBlend_SurfRstLineBuilder
     BRepBlend_RstRstLineBuilder
     Blend_CSWalking
     Instead `tolesp` - `tolgui` is employed in contexts where tolerance of guide curve parameter is excepted.
     Instead `tolesp` - `tolpoint2d` or `tolpoint3d` is employed in contexts where tolerance of point in 2d or 3d space is excepted.
 - Replace tolesp with tolpoint2d/tolpoint3d in BBPP function argument.
 - Use tolapp3d instead tolesp in BonVoisin function,
2022-12-04 13:41:29 +03:00
ddzama
2f33e34038 0032934: Modelling Algorithms - BRepExtrema_DistShapeShape returns two solutions instead of one
distmini of two edges returns two solution points instead one.
Second unneeded solution point is the same as first.

The problem was in fact that second edge has continuity C0.
In this case additional extremas analysis performed in special procedure

PERFORM_C0

And second point found in this procedure.
Folowing code of

BRepExtrema_DistanceSS::Perform (variant for Edge/Edge)

we should this additional solution extremas set
to be object of test TRI_SOLUTION before pushing
into main list of solution.
This solves the problem.
Corresponding test and compound with edges has been created.

Additionally, in the function

PERFORM_C0

an obvious error has fixed.
2022-12-04 13:39:35 +03:00
akaftasev
3eb891ec49 0033180: We had a problem calling the OCC library at the customer site, and the program crashed
Added status for thrusection operations and changed throw constructions to set of the status and break the function.
2022-12-04 13:35:24 +03:00
120 changed files with 1554 additions and 776 deletions

View File

@@ -51,7 +51,7 @@ public:
Standard_EXPORT BRepBlend_CSWalking(const Handle(Adaptor3d_Curve)& Curv, const Handle(Adaptor3d_Surface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_CSFunction& F, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean Complete (Blend_CSFunction& F, const Standard_Real Pmin);
@@ -80,7 +80,7 @@ private:
Handle(Adaptor3d_Surface) surf;
Handle(Adaptor3d_Curve) curv;
Handle(Adaptor3d_TopolTool) domain;
Standard_Real tolesp;
Standard_Real tolpoint3d;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -173,7 +173,7 @@ BRepBlend_RstRstLineBuilder::BRepBlend_RstRstLineBuilder
done(Standard_False), sol(1, 2), surf1(Surf1),
domain1(Domain1), surf2(Surf2),
domain2(Domain2), rst1(Rst1), rst2(Rst2),
tolesp(0.0), tolgui(0.0), pasmax(0.0),
tolpoint3d(0.0), tolgui(0.0), pasmax(0.0),
fleche(0.0), param(0.0), rebrou(Standard_False),
iscomplete(Standard_False), comptra(Standard_False), sens(0.0),
decrochdeb(Blend_NoDecroch), decrochfin(Blend_NoDecroch)
@@ -193,9 +193,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -203,7 +203,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -225,7 +225,7 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
TopAbs_State siturst1, siturst2;
Blend_DecrochStatus decroch;
math_Vector tolerance(1, 2), infbound(1, 2), supbound(1, 2);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -258,9 +258,9 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
U = previousP.ParameterOnC1();
V = previousP.ParameterOnC2();
BRepBlend_Extremity ptf1 (previousP.PointOnC1(),
U, previousP.Parameter(),tolesp);
U, previousP.Parameter(),tolpoint3d);
BRepBlend_Extremity ptf2 (previousP.PointOnC2(),
V, previousP.Parameter(),tolesp);
V, previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnC1());
ptf2.SetTangent(previousP.TangentOnC2());
@@ -291,7 +291,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const Standard_Boolean RecRst1,
const Standard_Boolean RecP1,
@@ -304,7 +304,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -327,7 +327,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
wp1 = wp2 = wrst1 = wrst2 = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -573,7 +573,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
//IntSurf_Transition Tline, Tarc;
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -595,14 +595,14 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param, Func, sol, tolesp, bp1)){
if(BBPP(param, Func, sol, tolpoint3d, bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param + dw);
rsnld.Perform(Func, parinit, infbound, supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param + dw, Func, sol, tolesp, bp2)){
if(BBPP(param + dw, Func, sol, tolpoint3d, bp2)){
tracederiv(Func, bp1, bp2);
}
}
@@ -854,7 +854,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Show that end is on Bound.
}
@@ -873,10 +873,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
if (Abs(stepw) < tolgui) {
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
Arrive = Standard_True;
#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
@@ -913,7 +913,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
Arrive = Standard_True;
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
// Indicate that end is on Bound.
}
@@ -993,10 +993,10 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
Extrst2.SetValue(previousP.PointOnC2(),
previousP.ParameterOnC2(),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
Arrive = Standard_True;
}
break;
@@ -1029,7 +1029,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolesp);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1049,7 +1049,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
// It is necessary to check if the function value meets the
// second restriction
if (Finv.IsSolution(Solinv, tolesp)) {
if (Finv.IsSolution(Solinv, tolpoint3d)) {
Standard_Real w = Solinv(2);
if(w < rst2->FirstParameter() - toler(2)||
w > rst2->LastParameter() + toler(2)){
@@ -1079,7 +1079,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1, 2), tolerance(1, 2);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1112,7 +1112,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1, 3), infb(1, 3), supb(1, 3);
Finv.GetTolerance(toler, tolesp);
Finv.GetTolerance(toler, tolpoint3d);
Finv.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1130,7 +1130,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
rsnld.Root(Solinv);
// It is necessary to check the value of the function
if (Finv.IsSolution(Solinv, tolesp)) {
if (Finv.IsSolution(Solinv, tolpoint3d)) {
Standard_Real w = Solinv(2);
if(w < rst1->FirstParameter() - toler(2)||
w > rst1->LastParameter() + toler(2)){
@@ -1159,7 +1159,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1,2), tolerance(1,2);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld2(Func, tolerance, 30);
@@ -1199,7 +1199,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(2);
@@ -1214,7 +1214,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolesp)){
if(FinvP.IsSolution(Solinv, tolpoint3d)){
gp_Pnt2d p2drst2 = rst2->Value(Solinv(2));
TopAbs_State situ = domain2->Classify(p2drst2, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1267,7 +1267,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,2), infb(1, 2), supb(1, 2);
FinvP.GetTolerance(toler, tolesp);
FinvP.GetTolerance(toler, tolpoint3d);
FinvP.GetBounds(infb, supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1282,7 +1282,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv, tolesp)){
if(FinvP.IsSolution(Solinv, tolpoint3d)){
gp_Pnt2d p2drst1 = rst1->Value(Solinv(2));
TopAbs_State situ = domain1->Classify(p2drst1, toler(2), 0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
@@ -1378,7 +1378,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnC1(),
sol(1),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain1;
@@ -1386,7 +1386,7 @@ void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC2(),
sol(2),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC1());
Iter = domain2;
@@ -1453,12 +1453,13 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst1(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp) {
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d) {
// it can be necessary to force the same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if (prevNorme <= tolesp * tolesp) {
if (prevNorme <= toler3d * toler3d) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1530,12 +1531,13 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst2(const Blend_Poin
Norme = Corde.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp){
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
// it can be necessary to force the same point
return Blend_SamePoints;
}
if (!prevpointistangent) {
if (prevNorme <= tolesp * tolesp) {
if (prevNorme <= toler3d * toler3d) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
@@ -1597,7 +1599,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
IntSurf_TypeTrans trarst1 = IntSurf_Undecided, trarst2 = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol, tolesp)) {
if (Func.IsSolution(sol, tolpoint3d)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
ptrst1 = Func.PointOnRst1();
ptrst2 = Func.PointOnRst2();
@@ -1644,7 +1646,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
Standard_Real testra = tg2drst1.Dot(tg2drstref);
TopAbs_Orientation Or = domain1->Orientation(rst1);
if (Abs(testra) > tolesp) {
if (Abs(testra) > tolpoint3d) {
if (testra < 0.) {
trarst1 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1656,7 +1658,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func,
testra = tg2drst2.Dot(tg2drstref);
Or = domain2->Orientation(rst2);
if (Abs(testra) > tolesp) {
if (Abs(testra) > tolpoint3d) {
if (testra < 0.) {
trarst2 = ConvOrToTra(TopAbs::Reverse(Or));
}
@@ -1705,7 +1707,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::CheckInside(Blend_RstRstFunction&
{
// Standard_Boolean inside = Standard_True;
math_Vector tolerance(1, 2);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
//face pcurve 1.
Standard_Real v = sol(1);

View File

@@ -72,9 +72,9 @@ public:
Standard_EXPORT BRepBlend_RstRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor2d_Curve2d)& Rst1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst2, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecRst1, const Standard_Boolean RecP1, const Standard_Boolean RecRst2, const Standard_Boolean RecP2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_RstRstFunction& Func, Blend_SurfCurvFuncInv& Finv1, Blend_CurvPointFuncInv& FinvP1, Blend_SurfCurvFuncInv& Finv2, Blend_CurvPointFuncInv& FinvP2, const Standard_Real Pmin);
@@ -134,7 +134,7 @@ private:
Handle(Adaptor3d_TopolTool) domain2;
Handle(Adaptor2d_Curve2d) rst1;
Handle(Adaptor2d_Curve2d) rst2;
Standard_Real tolesp;
Standard_Real tolpoint3d;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -210,7 +210,7 @@ BRepBlend_SurfRstLineBuilder::BRepBlend_SurfRstLineBuilder
const Handle(Adaptor3d_TopolTool)& Domain2):
done(Standard_False), sol(1, 3), surf1(Surf1),
domain1(Domain1), surf2(Surf2), rst(Rst),
domain2(Domain2), tolesp(0.0), tolgui(0.0),
domain2(Domain2), tolpoint3d(0.0), tolpoint2d(0.0), tolgui(0.0),
pasmax(0.0), fleche(0.0), param(0.0),
rebrou(Standard_False), iscomplete(Standard_False),
comptra(Standard_False), sens(0.0),
@@ -230,9 +230,10 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -240,7 +241,8 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -262,7 +264,7 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
TopAbs_State siturst,situs;
Standard_Boolean decroch;
math_Vector tolerance(1,3),infbound(1,3),supbound(1,3);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -296,9 +298,9 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func,
// W = previousP.ParameterOnC();
BRepBlend_Extremity ptf1(previousP.PointOnS(),
U,V,previousP.Parameter(),tolesp);
U,V,previousP.Parameter(),tolpoint3d);
BRepBlend_Extremity ptf2(previousP.PointOnC(),
U,V,previousP.Parameter(),tolesp);
U,V,previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnS());
ptf2.SetTangent(previousP.TangentOnC());
@@ -327,7 +329,8 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Real TolGuide,
const Standard_Boolean RecRst,
const Standard_Boolean RecP,
@@ -339,7 +342,8 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
iscomplete = Standard_False;
comptra = Standard_False;
line = new BRepBlend_Line();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolpoint2d = Tol2d;
tolgui = Abs(TolGuide);
rebrou = Standard_False;
@@ -362,7 +366,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection
wp = wrst = ws = Pmax;
param = Pdep;
Func.Set(param);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -536,7 +540,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -558,14 +562,14 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp1;
if(BBPP(param,Func,sol,tolesp,bp1)){
if(BBPP(param,Func,sol,tolpoint3d,bp1)){
Standard_Real dw = 1.e-10;
Func.Set(param+dw);
rsnld.Perform(Func,parinit,infbound,supbound);
if (rsnld.IsDone()) {
rsnld.Root(sol);
Blend_Point bp2;
if(BBPP(param+dw,Func,sol,tolesp,bp2)){
if(BBPP(param+dw,Func,sol,tolpoint3d,bp2)){
tracederiv(Func,bp1,bp2);
}
}
@@ -746,7 +750,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -765,10 +769,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (Abs(stepw) < tolgui) {
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Arrive = Standard_True;
if (line->NbPoints()>=2) {
// Indicate that one stops during the processing
@@ -804,7 +808,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (param == Bound) {
Arrive = Standard_True;
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
// Indicate end on Bound.
}
@@ -850,7 +854,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
line->Prepend(previousP);
}
Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
MakeExtremity(Extrst,Standard_False,rst,sol(3),IsVtxrst,Vtxrst);
Arrive = Standard_True;
}
@@ -883,10 +887,10 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
#endif
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extrst.SetValue(previousP.PointOnC(),
previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Arrive = Standard_True;
}
break;
@@ -941,7 +945,10 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
FinvC.Set(Arc);
math_Vector toler(1,3),infb(1,3),supb(1,3);
FinvC.GetTolerance(toler,tolesp);
// use reduced Tol argument value to pass testcase
// blend complex A6 with scale factor of model 0.1 (base scale = 1000)
// So, here we using 1.0e-5 rather than 1.0e-4 of tolerance of point in 3d
FinvC.GetTolerance(toler,0.1 * tolpoint3d);
FinvC.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(3);
@@ -958,7 +965,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
rsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolesp);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
}
// In case of fail, it is checked if another arc
@@ -981,7 +988,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
Arc = domain1->Value();
FinvC.Set(Arc);
FinvC.GetTolerance(toler,tolesp);
FinvC.GetTolerance(toler,tolpoint3d);
FinvC.GetBounds(infb,supb);
Solinv(3) = pmin;
@@ -997,7 +1004,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
else {
// It is necessary to check the value of the function
aRsnld.Root(Solinv);
recadre = FinvC.IsSolution(Solinv,tolesp);
recadre = FinvC.IsSolution(Solinv,tolpoint3d);
}
}
@@ -1041,7 +1048,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
Handle(Adaptor3d_HVertex)& Vtx)
{
math_Vector toler(1,4),infb(1,4),supb(1,4);
Finv.GetTolerance(toler,tolesp);
Finv.GetTolerance(toler,tolpoint3d);
Finv.GetBounds(infb,supb);
Solinv(1) = sol(3);
Solinv(2) = param;
@@ -1058,9 +1065,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
}
rsnld.Root(Solinv);
if(Finv.IsSolution(Solinv,tolesp)){
if(Finv.IsSolution(Solinv,tolpoint3d)){
gp_Pnt2d p2d(Solinv(3),Solinv(4));
TopAbs_State situ = domain1->Classify(p2d,Min(toler(3),toler(4)),0);
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1086,7 +1093,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
math_Vector infbound(1,3),supbound(1,3);
math_Vector parinit(1,3),tolerance(1,3);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld2(Func,tolerance,30);
@@ -1126,7 +1133,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
FinvP.Set(thepoint);
math_Vector toler(1,3),infb(1,3),supb(1,3);
FinvP.GetTolerance(toler,tolesp);
FinvP.GetTolerance(toler,tolpoint3d);
FinvP.GetBounds(infb,supb);
Solinv(1) = param;
Solinv(2) = sol(1);
@@ -1142,9 +1149,9 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
}
rsnld.Root(Solinv);
if(FinvP.IsSolution(Solinv,tolesp)){
if(FinvP.IsSolution(Solinv,tolpoint3d)){
gp_Pnt2d p2d(Solinv(2),Solinv(3));
TopAbs_State situ = domain1->Classify(p2d,Min(toler(2),toler(3)),0);
TopAbs_State situ = domain1->Classify(p2d,tolpoint2d,0);
if ((situ != TopAbs_IN) && (situ != TopAbs_ON)) {
return Standard_False;
}
@@ -1237,7 +1244,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
if (OnFirst) {
Extrem.SetValue(previousP.PointOnS(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS());
Iter = domain1;
@@ -1245,7 +1252,7 @@ void BRepBlend_SurfRstLineBuilder::MakeExtremity(BRepBlend_Extremity&
else {
Extrem.SetValue(previousP.PointOnC(),
sol(3),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnC());
Iter = domain2;
@@ -1312,12 +1319,13 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp*tolesp){
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= tolesp*tolesp) {
if(prevNorme <= toler3d * toler3d) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1388,12 +1396,13 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnRst(const Blend_Poin
// if(!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp*tolesp){
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
// it can be necessary to force same point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= tolesp*tolesp) {
if(prevNorme <= toler3d * toler3d) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;
@@ -1455,7 +1464,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
IntSurf_TypeTrans tras = IntSurf_Undecided, trarst = IntSurf_Undecided;
Blend_Point curpoint;
if (Func.IsSolution(sol,tolesp)) {
if (Func.IsSolution(sol,tolpoint3d)) {
Standard_Boolean curpointistangent = Func.IsTangencyPoint();
pts = Func.PointOnS();
ptrst = Func.PointOnRst();
@@ -1499,7 +1508,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func
Func.Decroch(sol,nors,tgsecs);
nors.Normalize();
Standard_Real testra = tgsecs.Dot(nors.Crossed(tgs));
if (Abs(testra) > tolesp) {
if (Abs(testra) > tolpoint3d) {
if (testra < 0.) {
tras = IntSurf_In;
}
@@ -1558,7 +1567,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
Standard_Boolean& Decroch)
{
math_Vector tolerance(1,3);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
//face pcurve.
Standard_Real w = sol(3);
if(w < rst->FirstParameter() - tolerance(3)||
@@ -1573,7 +1582,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::CheckInside(Blend_SurfRstFunction
//face surface
gp_Pnt2d p2d(sol(1),sol(2));
SituOnS = domain1->Classify(p2d,Min(tolerance(1),tolerance(2)),0);
SituOnS = domain1->Classify(p2d,tolpoint2d,0);
//lost contact
gp_Vec tgs,nors;

View File

@@ -71,9 +71,9 @@ public:
Standard_EXPORT BRepBlend_SurfRstLineBuilder(const Handle(Adaptor3d_Surface)& Surf1, const Handle(Adaptor3d_TopolTool)& Domain1, const Handle(Adaptor3d_Surface)& Surf2, const Handle(Adaptor2d_Curve2d)& Rst, const Handle(Adaptor3d_TopolTool)& Domain2);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& Soldep, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Real TolGuide, const Standard_Boolean RecRst, const Standard_Boolean RecP, const Standard_Boolean RecS, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Complete (Blend_SurfRstFunction& Func, Blend_FuncInv& Finv, Blend_SurfPointFuncInv& FinvP, Blend_SurfCurvFuncInv& FinvC, const Standard_Real Pmin);
@@ -128,7 +128,8 @@ private:
Handle(Adaptor3d_Surface) surf2;
Handle(Adaptor2d_Curve2d) rst;
Handle(Adaptor3d_TopolTool) domain2;
Standard_Real tolesp;
Standard_Real tolpoint3d;
Standard_Real tolpoint2d;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -58,11 +58,11 @@ public:
//! To define singular points computed before walking.
Standard_EXPORT void AddSingularPoint (const Blend_Point& P);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Tolesp, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT void Perform (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const Standard_Real MaxStep, const Standard_Real Tol3d, const Standard_Real TolGuide, const math_Vector& Soldep, const Standard_Real Fleche, const Standard_Boolean Appro = Standard_False);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, const Standard_Real Pdep, math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, TopAbs_State& Pos1, TopAbs_State& Pos2);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tolesp, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean PerformFirstSection (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real Pdep, const Standard_Real Pmax, const math_Vector& ParDep, const Standard_Real Tol3d, const Standard_Real TolGuide, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, Standard_Real& Psol, math_Vector& ParSol);
Standard_EXPORT Standard_Boolean Continu (Blend_Function& F, Blend_FuncInv& FInv, const Standard_Real P);
@@ -131,7 +131,7 @@ private:
Standard_Boolean ToCorrectOnRst1;
Standard_Boolean ToCorrectOnRst2;
Standard_Real CorrectedParam;
Standard_Real tolesp;
Standard_Real tolpoint3d;
Standard_Real tolgui;
Standard_Real pasmax;
Standard_Real fleche;

View File

@@ -468,7 +468,14 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2,
if (fabs(Dstmin - sqrt(Ext.SquareDistance(ii))) < Eps)
{
Pt = Ext.Point(ii);
if (TRI_SOLUTION(SeqSol2, Pt))
// Pt - point on the curve pCurvOther/Eother, but
// if iE == 0 -> Eother correspond to edge S2
// and to edge S1 in the opposite case.
// Therefore we should search Pt through previous solution points on Other curve (edge):
// if iE == 0 - on edge S2, namely through SeqSol2,
// else - on edge S1, namely through SeqSol1.
const bool triSolutionResult = (iE == 0) ? TRI_SOLUTION(SeqSol2, Pt) : TRI_SOLUTION(SeqSol1, Pt);
if (triSolutionResult)
{
// Check if the parameter does not correspond to a vertex
const Standard_Real t = Ext.Parameter(ii);
@@ -869,9 +876,19 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1,
if (!seqSol1.IsEmpty() && !seqSol2.IsEmpty())
{
theSeqSolShape1.Append(seqSol1);
theSeqSolShape2.Append(seqSol2);
myModif = Standard_True;
BRepExtrema_SeqOfSolution::iterator anIt1 = seqSol1.begin();
BRepExtrema_SeqOfSolution::iterator anIt2 = seqSol2.begin();
for (; anIt1 != seqSol1.end() && anIt2 != seqSol2.end(); anIt1++, anIt2++)
{
gp_Pnt Pt1 = anIt1->Point();
gp_Pnt Pt2 = anIt2->Point();
if (TRI_SOLUTION(theSeqSolShape1, Pt1) || TRI_SOLUTION(theSeqSolShape2, Pt2))
{
theSeqSolShape1.Append(*anIt1);
theSeqSolShape2.Append(*anIt2);
myModif = Standard_True;
}
}
}
}

View File

@@ -44,6 +44,8 @@
#include <BRepGProp_Face.hxx>
#include <BRep_TEdge.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#ifdef BRepFill_AdvancedEvolved_DEBUG
#include <BinTools.hxx>
@@ -524,9 +526,14 @@ void BRepFill_AdvancedEvolved::GetLids()
return;
}
Standard_Real aTol = Max(aFS.Tolerance(), aFS.ToleranceReached());
aTol += myFuzzyValue;
Bnd_Box aProfBox;
BRepBndLib::Add(myProfile, aProfBox);
Standard_Real aSqDiag = aProfBox.SquareExtent();
//Square of the default angular tolerance in
//BOPAlgo_Tools::EdgesToWires(...) and BOPAlgo_Tools::WiresToFaces(...) methods
const Standard_Real aSqAnguarTol = 1.0e-16;
const Standard_Real aSqAnguarTol = aTol*aTol / aSqDiag;
const gp_Dir &aNormal = aSurf->Position().Direction();
// Obtain free-edges from myPipeShell. All edges must be planar
@@ -541,6 +548,7 @@ void BRepFill_AdvancedEvolved::GetLids()
gp_Pnt aPtmp;
gp_Vec aTan;
Standard_Real aDPMax = 0.;
for (Standard_Integer i = 1; i <= aMapEF.Size(); i++)
{
TopTools_ListOfShape& aListF = aMapEF(i);
@@ -564,6 +572,8 @@ void BRepFill_AdvancedEvolved::GetLids()
continue;
const Standard_Real aDP = aTan.XYZ().Dot(aNormal.XYZ());
if (Abs(aDP) > aDPMax)
aDPMax = Abs(aDP);
if (aDP*aDP>aSqModulus*aSqAnguarTol)
{
//Only planar edges are considered
@@ -594,8 +604,9 @@ void BRepFill_AdvancedEvolved::GetLids()
aBB.MakeCompound(aCompW);
aBB.MakeCompound(aCompF);
aBB.MakeCompound(myTopBottom);
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True);
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF);
Standard_Real anAngTol = Sqrt(aSqAnguarTol);
BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True, anAngTol);
BOPAlgo_Tools::WiresToFaces(aCompW, aCompF, anAngTol);
{
// Check orientation

View File

@@ -656,7 +656,7 @@ static void BuildConnectedEdges(const TopoDS_Wire& aWire,
//=======================================================================
BRepFill_CompatibleWires::BRepFill_CompatibleWires()
:myIsDone(Standard_False)
:myStatus(BRepFill_ThruSectionErrorStatus_NotDone)
{
}
@@ -682,7 +682,7 @@ void BRepFill_CompatibleWires::Init(const TopTools_SequenceOfShape& Sections)
myInit = Sections;
myWork = Sections;
myPercent = 0.01;
myIsDone = Standard_False;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
myMap.Clear();
}
@@ -707,7 +707,7 @@ void BRepFill_CompatibleWires::SetPercent(const Standard_Real Percent)
Standard_Boolean BRepFill_CompatibleWires::IsDone() const
{
return myIsDone;
return myStatus == BRepFill_ThruSectionErrorStatus_Done;
}
@@ -766,6 +766,7 @@ Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedLastSection() const
void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
// compute origin and orientation on wires to avoid twisted results
// and update wires to have same number of edges
@@ -838,7 +839,7 @@ void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
allClosed = (allClosed && wClosed);
allOpen = (allOpen && !wClosed);
}
if (allClosed) {
// All sections are closed
if (report) {
@@ -849,24 +850,26 @@ void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
// origin
ComputeOrigin(Standard_False);
}
myIsDone = Standard_True;
}
else if (allOpen) {
// All sections are open
// origin
SearchOrigin();
if (myStatus != BRepFill_ThruSectionErrorStatus_Done)
{
return;
}
// same number of elements
if (report) {
SameNumberByACR(report);
}
myIsDone = Standard_True;
}
else {
// There are open and closed sections :
// not processed
throw Standard_DomainError("Sections must be all closed or all open");
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
}
@@ -906,7 +909,10 @@ void BRepFill_CompatibleWires::
//allClosed = (allClosed && myWork(i).Closed());
}
if (!allClosed)
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
// sections ponctuelles, sections bouclantes ?
if (myDegen1) ideb++;
@@ -986,8 +992,11 @@ void BRepFill_CompatibleWires::
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if (SeqV.Length()>NbMaxV)
throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
if (SeqV.Length() > NbMaxV)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
// loop on vertices of wire1
for (ii=1;ii<=SeqV.Length();ii++) {
@@ -1062,7 +1071,10 @@ void BRepFill_CompatibleWires::
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if ( SeqV.Length()>NbMaxV || SeqV.Length()>SizeMap )
throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
// next wire
@@ -1184,14 +1196,17 @@ void BRepFill_CompatibleWires::
}
} //end of for(; itW.More(); itW.Next())
if (Esol.IsNull())
throw Standard_ConstructionError("BRepFill :: profiles are inconsistent");
{
myStatus = BRepFill_ThruSectionErrorStatus_ProfilesInconsistent;
return;
}
MW.Add(Esol);
TopTools_ListOfShape ConnectedEdges;
BuildConnectedEdges( TopoDS::Wire(myWork(i)), Esol, V2, ConnectedEdges );
TopTools_ListIteratorOfListOfShape itCE(ConnectedEdges);
for(; anExp.More(), itCE.More(); anExp.Next(), itCE.Next())
for(; anExp.More() && itCE.More(); anExp.Next(), itCE.Next())
{
ECur = anExp.Current();
TopExp::Vertices(ECur,VF,VL,Standard_True);
@@ -1264,8 +1279,10 @@ void BRepFill_CompatibleWires::
if (nbmax<nbEdges) nbmax = nbEdges;
if (nbmin>nbEdges) nbmin = nbEdges;
}
if (nbmin!=nbmax) {
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
if (nbmin!=nbmax)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
//Fill <myMap>
@@ -1487,7 +1504,10 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report)
if (nbmin>nbEdges(i)) nbmin = nbEdges(i);
}
if (nbmax!=nbmin)
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByACR failed");
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
}
//=======================================================================
@@ -1532,7 +1552,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
}
*/
if (!allClosed)
throw Standard_NoSuchObject("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
/*
// Max number of possible cuts
@@ -1869,7 +1892,10 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ )
gp_Pnt Pmini,P1,P2;
SeqOfVertices(wire,SeqV);
if (SeqV.Length()>NbMaxV)
throw Standard_NoSuchObject("BRepFill::ComputeOrigin failed");
{
myStatus = BRepFill::ThruSectionsError_Failed;
return;
}
if (!polar) {
// choix du vertex le plus proche comme origine
distmini = Precision::Infinite();
@@ -2094,7 +2120,10 @@ void BRepFill_CompatibleWires::SearchOrigin()
allOpen = (allOpen && !myWork(i).Closed());
}
if (!allOpen)
throw Standard_NoSuchObject("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
{
myStatus = BRepFill_ThruSectionErrorStatus_NotSameTopology;
return;
}
// init

View File

@@ -20,6 +20,7 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
@@ -49,6 +50,11 @@ public:
Standard_EXPORT void Perform (const Standard_Boolean WithRotation = Standard_True);
Standard_EXPORT Standard_Boolean IsDone() const;
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
//! returns the generated sequence.
Standard_EXPORT const TopTools_SequenceOfShape& Shape() const;
@@ -101,7 +107,7 @@ private:
Standard_Real myPercent;
Standard_Boolean myDegen1;
Standard_Boolean myDegen2;
Standard_Boolean myIsDone;
BRepFill_ThruSectionErrorStatus myStatus;
TopTools_DataMapOfShapeListOfShape myMap;

View File

@@ -65,6 +65,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2)
{
// initializations
// !Note if IType set as -1 it means that occurs error with null 3d curve for the edge
Standard_Integer IType = 0;
// characteristics of the first edge
@@ -89,7 +90,9 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
else {
curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
if (curv1.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
return -1;
}
curv1 =
Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
ff = first1;
@@ -156,7 +159,9 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
else {
curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
if (curv.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
return -1;
}
curv =
Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
ff = first2;
@@ -312,12 +317,12 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
//=======================================================================
//function : CreateKPart
//purpose :
//purpose : Returns true if there is no errors occur
//=======================================================================
void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
const Standard_Integer IType,
Handle(Geom_Surface)& Surf)
Standard_Boolean CreateKPart (const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
const Standard_Integer IType,
Handle(Geom_Surface)& Surf)
{
// find the dimension
TopoDS_Vertex V1, V2;
@@ -326,6 +331,8 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
Standard_Real a1, b1, aa =0., bb =0.;
TopoDS_Vertex v1f,v1l,v2f,v2l;
Standard_Boolean isDone = Standard_True;
// find characteristics of the first edge
Handle(Geom_Curve) C1;
Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
@@ -336,7 +343,9 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
else {
C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
if (C1.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
return Standard_False;
}
C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
aa = a1;
bb = b1;
@@ -361,7 +370,9 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
else {
C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
if (C2.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
return Standard_False;
}
C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
if (Edge2.Orientation() == TopAbs_REVERSED) {
C2->Reverse();
@@ -496,6 +507,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
// IType incorrect
}
Surf = surface;
return isDone;
}
//=======================================================================
@@ -528,7 +540,8 @@ static TopoDS_Edge CreateNewEdge(const TopoDS_Edge& theEdge, TopTools_DataMapOfS
//=======================================================================
BRepFill_Generator::BRepFill_Generator():
myMutableInput (Standard_True)
myMutableInput (Standard_True),
myStatus (BRepFill_ThruSectionErrorStatus_NotDone)
{
}
@@ -551,6 +564,8 @@ void BRepFill_Generator::AddWire(const TopoDS_Wire& Wire)
void BRepFill_Generator::Perform()
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
TopoDS_Shell Shell;
TopoDS_Face Face;
TopoDS_Shape S1, S2;
@@ -679,6 +694,12 @@ void BRepFill_Generator::Perform()
// processing of KPart
Standard_Integer IType = DetectKPart(Edge1,Edge2);
if (IType == -1)
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
if (IType==0) {
// no part cases
TopLoc_Location L,L1,L2;
@@ -694,7 +715,10 @@ void BRepFill_Generator::Perform()
else {
C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
if (C1.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
}
if (degen2) {
Extremities(1) = BRep_Tool::Pnt(V2l);
@@ -704,7 +728,10 @@ void BRepFill_Generator::Perform()
else {
C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
if (C2.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
}
// compute the location
@@ -746,7 +773,11 @@ void BRepFill_Generator::Perform()
}
else {
// particular case
CreateKPart(Edge1,Edge2,IType,Surf);
if (!CreateKPart(Edge1, Edge2, IType, Surf))
{
myStatus = BRepFill_ThruSectionErrorStatus_Null3DCurve;
return;
}
B.MakeFace(Face,Surf,Precision::Confusion());
}

View File

@@ -20,6 +20,7 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
@@ -68,6 +69,12 @@ public:
//! Returns the current mutable input state
Standard_EXPORT Standard_Boolean IsMutableInput() const;
//! Returns status of the operation
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
protected:
private:
@@ -78,6 +85,7 @@ private:
TopTools_DataMapOfShapeShape myOldNewShapes;
BRepTools_ReShape myReshaper;
Standard_Boolean myMutableInput;
BRepFill_ThruSectionErrorStatus myStatus;
};

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2022 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepFill_ThruSectionErrorStatus_HeaderFile
#define _BRepFill_ThruSectionErrorStatus_HeaderFile
//! Errors that can occur at thrusection algorithm.
enum BRepFill_ThruSectionErrorStatus
{
BRepFill_ThruSectionErrorStatus_Done, //!< Thrusection algorithm is done
BRepFill_ThruSectionErrorStatus_NotDone, //!< Thrusection algorithm is not done
BRepFill_ThruSectionErrorStatus_NotSameTopology, //!< All profiles have not same topology (they should be all closed or all opened)
BRepFill_ThruSectionErrorStatus_ProfilesInconsistent, //!< Profiles are inconsistent
BRepFill_ThruSectionErrorStatus_WrongUsage, //!< Wrong usage of punctual sections
BRepFill_ThruSectionErrorStatus_Null3DCurve, //!< Null 3D curve in edge
BRepFill_ThruSectionErrorStatus_Failed //!< Thrusection algorithm has failed
};
#endif // _BRepFill_ThruSectionErrorStatus_HeaderFile

View File

@@ -77,6 +77,7 @@ BRepFill_ShapeLaw.hxx
BRepFill_ShapeLaw.lxx
BRepFill_Sweep.cxx
BRepFill_Sweep.hxx
BRepFill_ThruSectionErrorStatus.hxx
BRepFill_TransitionStyle.hxx
BRepFill_TrimEdgeTool.cxx
BRepFill_TrimEdgeTool.hxx

View File

@@ -44,13 +44,13 @@ BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(const TopoDS_Shape& S,
//=======================================================================
void BRepFilletAPI_MakeFillet::SetParams(const Standard_Real Tang,
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)
{
myBuilder.SetParams(Tang,Tesp, T2d, TApp3d, TolApp2d, Fleche);
myBuilder.SetParams(Tang, Tesp, T2d, TApp3d, TolApp2d, Fleche);
}
//=======================================================================

View File

@@ -961,6 +961,9 @@ static void InternalSameParameter(const TopoDS_Shape& theSh, BRepTools_ReShape&
TopExp_Explorer ex2;
for(ex2.Init(curface,TopAbs_EDGE); ex2.More(); ex2.Next()){
const TopoDS_Edge& E = TopoDS::Edge(ex2.Current());
if (BRep_Tool::Degenerated(E))
continue;
TopoDS_Shape aNe = theReshaper.Value(E);
Standard_Real aNewEtol = -1;
GetEdgeTol(TopoDS::Edge(aNe), curface, aNewEtol);

View File

@@ -256,7 +256,7 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
myError = BRepLib_NotPlanar;
return;
}
// build the face and add the wire
BRep_Builder B;
myError = BRepLib_FaceDone;
@@ -264,13 +264,40 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
Standard_Real tol = Max(1.2*FS.ToleranceReached(), FS.Tolerance());
B.MakeFace(TopoDS::Face(myShape),FS.Surface(),FS.Location(),tol);
Add(W);
TopoDS_Wire aW;
if (OnlyPlane)
{
// get rid of degenerative edges in the input wire
BRep_Builder aB;
aB.MakeWire (aW);
TopoDS_Wire aWForw = W;
aWForw.Orientation (TopAbs_FORWARD);
TopoDS_Iterator anIter (aWForw);
for (; anIter.More(); anIter.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge (anIter.Value());
if (!BRep_Tool::Degenerated (aE))
aB.Add (aW, aE);
}
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
}
else
{
aW = W;
}
Add (aW);
//
BRepLib::UpdateTolerances(myShape);
//
BRepLib::SameParameter(myShape, tol, Standard_True);
//
if (BRep_Tool::IsClosed(W))
if (BRep_Tool::IsClosed(aW))
CheckInside();
}

View File

@@ -36,9 +36,11 @@ IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_CurveTessellator, IMeshTools_CurveTessellato
BRepMesh_CurveTessellator::BRepMesh_CurveTessellator(
const IMeshData::IEdgeHandle& theEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const Standard_Integer theMinPointsNb,
const Standard_Boolean isUseVertexTolerance)
: myDEdge(theEdge),
myParameters(theParameters),
myUseVertexTolerance(isUseVertexTolerance),
myEdge(theEdge->GetEdge()),
myCurve(myEdge),
myMinPointsNb (theMinPointsNb)
@@ -55,9 +57,11 @@ BRepMesh_CurveTessellator::BRepMesh_CurveTessellator (
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const Standard_Integer theMinPointsNb,
const Standard_Boolean isUseVertexTolerance)
: myDEdge(theEdge),
myParameters(theParameters),
myUseVertexTolerance(isUseVertexTolerance),
myEdge(TopoDS::Edge(theEdge->GetEdge().Oriented(theOrientation))),
myCurve(myEdge, theFace->GetFace()),
myMinPointsNb (theMinPointsNb)
@@ -101,9 +105,21 @@ void BRepMesh_CurveTessellator::init()
myEdgeSqTol = BRep_Tool::Tolerance (myEdge);
myEdgeSqTol *= myEdgeSqTol;
const Standard_Integer aMinPntNb = Max(myMinPointsNb,
(myCurve.GetType() == GeomAbs_Circle) ? 4 : 2); //OCC287
Standard_Integer aMinPntThreshold = 2;
switch (myCurve.GetType())
{
case GeomAbs_Circle:
case GeomAbs_Ellipse:
case GeomAbs_Parabola:
case GeomAbs_Hyperbola:
aMinPntThreshold = 4;
break;
default:
break;
}
const Standard_Integer aMinPntNb = Max (myMinPointsNb, aMinPntThreshold); //OCC287
myDiscretTool.Initialize (myCurve,
myCurve.FirstParameter(), myCurve.LastParameter(),
aPreciseAngDef, aPreciseLinDef, aMinPntNb,
@@ -213,10 +229,15 @@ Standard_Boolean BRepMesh_CurveTessellator::isInToleranceOfVertex (
const gp_Pnt& thePoint,
const TopoDS_Vertex& theVertex) const
{
const gp_Pnt aPoint = BRep_Tool::Pnt(theVertex);
const Standard_Real aTolerance = BRep_Tool::Tolerance(theVertex);
if (myUseVertexTolerance)
{
const gp_Pnt aPoint = BRep_Tool::Pnt(theVertex);
const Standard_Real aTolerance = BRep_Tool::Tolerance(theVertex) * 1.1;
return (thePoint.SquareDistance (aPoint) < aTolerance * aTolerance);
return (thePoint.SquareDistance (aPoint) < aTolerance * aTolerance);
}
return Standard_False;
}
//=======================================================================
@@ -231,9 +252,9 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
thePoint = myDiscretTool.Value (theIndex);
theParameter = myDiscretTool.Parameter (theIndex);
/*if (!isInToleranceOfVertex(thePoint, myFirstVertex) &&
if (!isInToleranceOfVertex(thePoint, myFirstVertex) &&
!isInToleranceOfVertex(thePoint, myLastVertex))
{*/
{
if (!myCurve.IsCurveOnSurface())
{
return Standard_True;
@@ -269,9 +290,9 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
aSurface->D0(aUV.X(), aUV.Y(), aPntOnSurf);
return (thePoint.SquareDistance(aPntOnSurf) < myEdgeSqTol);
/*}
}
return Standard_False;*/
return Standard_False;
}
//=======================================================================

View File

@@ -35,7 +35,8 @@ public:
Standard_EXPORT BRepMesh_CurveTessellator(
const IMeshData::IEdgeHandle& theEdge,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const Standard_Integer theMinPointsNb = 2,
const Standard_Boolean isUseVertexTolerance = Standard_False);
//! Constructor.
Standard_EXPORT BRepMesh_CurveTessellator (
@@ -43,7 +44,8 @@ public:
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const Standard_Integer theMinPointsNb = 2,
const Standard_Boolean isUseVertexTolerance = Standard_False);
//! Destructor.
Standard_EXPORT virtual ~BRepMesh_CurveTessellator ();
@@ -96,6 +98,7 @@ private:
const IMeshData::IEdgeHandle& myDEdge;
const IMeshTools_Parameters& myParameters;
Standard_Boolean myUseVertexTolerance;
TopoDS_Edge myEdge;
BRepAdaptor_Curve myCurve;
Standard_Integer myMinPointsNb;

View File

@@ -64,11 +64,12 @@ Handle(IMeshTools_CurveTessellator) BRepMesh_EdgeDiscret::CreateEdgeTessellator(
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theDFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb)
const Standard_Integer theMinPointsNb,
const Standard_Boolean isUseVertexTolerance)
{
return theDEdge->GetSameParam() ?
new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb) :
new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters, theMinPointsNb);
new BRepMesh_CurveTessellator(theDEdge, theParameters, theMinPointsNb, isUseVertexTolerance) :
new BRepMesh_CurveTessellator(theDEdge, theOrientation, theDFace, theParameters, theMinPointsNb, isUseVertexTolerance);
}
//=======================================================================

View File

@@ -47,7 +47,8 @@ public:
const TopAbs_Orientation theOrientation,
const IMeshData::IFaceHandle& theDFace,
const IMeshTools_Parameters& theParameters,
const Standard_Integer theMinPointsNb = 2);
const Standard_Integer theMinPointsNb = 2,
const Standard_Boolean isUseVertexTolerance = Standard_False);
//! Creates instance of tessellation extractor.
Standard_EXPORT static Handle(IMeshTools_CurveTessellator) CreateEdgeTessellationExtractor(

View File

@@ -267,7 +267,7 @@ void BRepMesh_FaceChecker::perform(const Standard_Integer theWireIndex) const
Handle(IMeshData::MapOfIEdgePtr)& aIntersections = myWiresIntersectingEdges->ChangeValue(theWireIndex);
// TODO: Tolerance is set to twice value of face deflection in order to fit regressions.
BndBox2dTreeSelector aSelector(2 * myDFace->GetDeflection());
BndBox2dTreeSelector aSelector(2 * Precision::PConfusion()/*myDFace->GetDeflection()*/);
for (Standard_Integer aWireIt = theWireIndex; aWireIt < myDFace->WiresNb(); ++aWireIt)
{
const Handle(IMeshData::BndBox2dTree)& aBndBoxTree2 = myWiresBndBoxTree->Value(aWireIt);

View File

@@ -41,11 +41,19 @@ namespace
{
public:
//! Constructor.
EdgeAmplifier(const IMeshTools_Parameters& theParameters)
: myParameters(theParameters)
EdgeAmplifier(const IMeshTools_Parameters& theParameters,
const Standard_Boolean isUseVertexTolerance = Standard_False)
: myParameters (theParameters),
myUseVertexTolerance(isUseVertexTolerance)
{
}
//! Take vertex tolerance into account.
void SetUseVertexTolerance(const Standard_Boolean isUseVertexTolerance)
{
myUseVertexTolerance = isUseVertexTolerance;
}
//! Main operator.
void operator()(const IMeshData::IEdgePtr& theDEdge) const
{
@@ -75,7 +83,7 @@ namespace
Handle(IMeshTools_CurveTessellator) aTessellator =
BRepMesh_EdgeDiscret::CreateEdgeTessellator(
aDEdge, aPCurve->GetOrientation(), aDFace,
myParameters, aPointsNb);
myParameters, aPointsNb, myUseVertexTolerance);
BRepMesh_EdgeDiscret::Tessellate3d(aDEdge, aTessellator, Standard_False);
BRepMesh_EdgeDiscret::Tessellate2d(aDEdge, Standard_False);
@@ -89,6 +97,7 @@ namespace
private:
const IMeshTools_Parameters& myParameters;
Standard_Boolean myUseVertexTolerance;
};
//! Returns True if some of two vertcies is same with reference one.
@@ -190,12 +199,14 @@ void BRepMesh_ModelHealer::amplifyEdges()
new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE);
Standard_Integer aAmpIt = 0;
const Standard_Real aIterNb = 5;
const Standard_Integer aIterNb = 6;
IMeshData::MapOfIEdgePtr aEdgesToUpdate(1, aTmpAlloc);
EdgeAmplifier anEdgeAmplifier (myParameters);
while (aAmpIt++ < aIterNb && popEdgesToUpdate(aEdgesToUpdate))
{
anEdgeAmplifier.SetUseVertexTolerance (aAmpIt == aIterNb);
// Try to update discretization by decreasing deflection of problematic edges.
OSD_Parallel::ForEach(aEdgesToUpdate.cbegin(), aEdgesToUpdate.cend(),
anEdgeAmplifier,

View File

@@ -262,6 +262,7 @@ BRepOffsetAPI_ThruSections::BRepOffsetAPI_ThruSections(const Standard_Boolean is
myCritWeights[1] = .2;
myCritWeights[2] = .4;
myUseSmoothing = Standard_False;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
}
@@ -286,7 +287,7 @@ void BRepOffsetAPI_ThruSections::Init(const Standard_Boolean isSolid, const Stan
myCritWeights[1] = .2;
myCritWeights[2] = .4;
myUseSmoothing = Standard_False;
myStatus = BRepFill_ThruSectionErrorStatus_NotDone;
}
@@ -343,6 +344,7 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check
void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/)
{
myStatus = BRepFill_ThruSectionErrorStatus_Done;
myBFGenerator.Nullify();
//Check set of section for right configuration of punctual sections
Standard_Integer i;
@@ -356,7 +358,10 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
throw Standard_Failure("Wrong usage of punctual sections");
{
myStatus = BRepFill_ThruSectionErrorStatus_WrongUsage;
return;
}
}
if (myWires.Length() <= 2)
{
@@ -371,7 +376,8 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
}
if (wdeg)
{
throw Standard_Failure("Wrong usage of punctual sections");
myStatus = BRepFill_ThruSectionErrorStatus_WrongUsage;
return;
}
}
@@ -447,6 +453,13 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
}
}
}
else
{
myStatus = Georges.GetStatus();
NotDone();
return;
}
myWires = WorkingSections;
} //if (myWCheck)
else //no check
@@ -498,6 +511,12 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/
NotDone();
return;
}
if (myStatus != BRepFill_ThruSectionErrorStatus_Done)
{
NotDone();
return;
}
// Encode the Regularities
BRepLib::EncodeRegularity(myShape);
}
@@ -520,6 +539,12 @@ void BRepOffsetAPI_ThruSections::CreateRuled()
myBFGenerator->AddWire(TopoDS::Wire(myWires(i)));
}
myBFGenerator->Perform();
BRepFill_ThruSectionErrorStatus aStatus = myBFGenerator->GetStatus();
if (aStatus != BRepFill_ThruSectionErrorStatus_Done)
{
myStatus = aStatus;
return;
}
TopoDS_Shell shell = myBFGenerator->Shell();
if (myIsSolid) {
@@ -739,6 +764,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
TS = TotalSurf(shapes,nbSects,nbEdges,w1Point,w2Point,vClosed);
if(TS.IsNull()) {
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
@@ -934,14 +960,12 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
else {
myShape = MakeSolid(shell, newW1, newW2, myPres3d, myFirst, myLast);
}
Done();
}
else {
myShape = shell;
Done();
}
Done();
TopTools_DataMapOfShapeReal aVertexToleranceMap;
TopExp_Explorer aTopExplorer(myShape,TopAbs_EDGE);
@@ -1040,7 +1064,9 @@ static Handle(Geom_BSplineCurve) EdgeToBSpline (const TopoDS_Edge& theEdge)
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
if (aCurve.IsNull())
throw Standard_NullObject("Null 3D curve in edge");
{
return nullptr;
}
// convert its part used by edge to bspline; note that if edge curve is bspline,
// conversion made via trimmed curve is still needed -- it will copy it, segment
@@ -1132,6 +1158,10 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
// read the first edge to initialise CompBS;
TopoDS_Edge aPrevEdge = TopoDS::Edge (shapes((j-1)*NbEdges+1));
Handle(Geom_BSplineCurve) curvBS = EdgeToBSpline (aPrevEdge);
if (curvBS.IsNull())
{
return nullptr;
}
// initialization
GeomConvert_CompCurveToBSplineCurve CompBS(curvBS);
@@ -1145,6 +1175,10 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
aTolV = Max(aTolV, BRep_Tool::Tolerance(vl));
aTolV = Min(aTolV, 1.e-3);
curvBS = EdgeToBSpline (aNextEdge);
if (curvBS.IsNull())
{
return nullptr;
}
// concatenation
CompBS.Add(curvBS, aTolV, Standard_True, Standard_False, 1);
@@ -1503,7 +1537,11 @@ void BRepOffsetAPI_ThruSections::CriteriumWeight(Standard_Real& W1, Standard_Rea
void BRepOffsetAPI_ThruSections::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
if (W1 < 0 || W2 < 0 || W3 < 0 ) throw Standard_DomainError();
if (W1 < 0 || W2 < 0 || W3 < 0)
{
myStatus = BRepFill_ThruSectionErrorStatus_Failed;
return;
}
myCritWeights[0] = W1;
myCritWeights[1] = W2;
myCritWeights[2] = W3;

View File

@@ -21,6 +21,7 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepFill_ThruSectionErrorStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS_Face.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
@@ -163,6 +164,11 @@ public:
//! Returns the current mutable input state
Standard_EXPORT Standard_Boolean IsMutableInput() const;
//! Returns the status of thrusection operation
BRepFill_ThruSectionErrorStatus GetStatus() const
{
return myStatus;
}
protected:
@@ -206,6 +212,7 @@ private:
Standard_Boolean myUseSmoothing;
Standard_Boolean myMutableInput;
NCollection_Handle<BRepFill_Generator> myBFGenerator;
BRepFill_ThruSectionErrorStatus myStatus;
};

View File

@@ -112,6 +112,7 @@ static Standard_Boolean pidef = Standard_False;
static Standard_Boolean lfdef = Standard_False;
static Standard_Boolean rfdef = Standard_False;
static Standard_Real tesp = 1.0e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -2361,7 +2362,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
if (Rakk)
delete Rakk;
Rakk = new BRepFilletAPI_MakeFillet(V, FSh);
Rakk->SetParams(ta, t3d, t2d, t3d, t2d, fl);
Rakk->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rakk->SetContinuity(blend_cont, tapp_angle);
Standard_Real Rad;
TopoDS_Shape S;

View File

@@ -47,7 +47,7 @@
#include <stdio.h>
static Standard_Real tesp = 1.0e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -152,7 +152,7 @@ static Standard_Integer BLEND(Draw_Interpretor& di, Standard_Integer narg, const
}
}
Rakk = new BRepFilletAPI_MakeFillet(V,FSh);
Rakk->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rakk->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rakk->SetContinuity(blend_cont, tapp_angle);
Standard_Real Rad;
TopoDS_Edge E;
@@ -254,7 +254,7 @@ static Standard_Integer MKEVOL(Draw_Interpretor& di,
if (narg < 3) return 1;
TopoDS_Shape V = DBRep::Get(a[2]);
Rake = new BRepFilletAPI_MakeFillet(V);
Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rake->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rake->SetContinuity(blend_cont, tapp_angle);
if (narg == 4) {
ChFi3d_FilletShape FSh = ChFi3d_Rational;
@@ -410,7 +410,7 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const
const TopoDS_Shape& aSolid = Explo.Current();
BRepFilletAPI_MakeFillet Blender(aSolid);
Blender.SetParams(ta,t3d,t2d,t3d,t2d,fl);
Blender.SetParams(ta, tesp, t2d, t3d, t2d, fl);
Blender.SetContinuity( blend_cont, tapp_angle );
TopExp_Explorer expsec( theSection, TopAbs_EDGE );

View File

@@ -443,7 +443,7 @@ Standard_Integer gener(Draw_Interpretor&, Standard_Integer n, const char** a)
//purpose :
//=======================================================================
Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char** a)
Standard_Integer thrusections(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 6) return 1;
@@ -525,7 +525,30 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char*
BRepTest_Objects::SetHistory(Generator->Wires(), *Generator);
}
else {
std::cout << "Algorithm is not done" << std::endl;
BRepFill_ThruSectionErrorStatus aStatus = Generator->GetStatus();
switch (aStatus)
{
case BRepFill_ThruSectionErrorStatus_NotDone:
di << "Algorithm is not done\n";
break;
case BRepFill_ThruSectionErrorStatus_NotSameTopology:
di << "The input profiles should be all closed or all opened\n";
break;
case BRepFill_ThruSectionErrorStatus_ProfilesInconsistent:
di << "Profiles inconsistent\n";
break;
case BRepFill_ThruSectionErrorStatus_WrongUsage:
di << "Wrong usage of punctual sections\n";
break;
case BRepFill_ThruSectionErrorStatus_Null3DCurve:
di << "Some edges have null 3d curve";
break;
case BRepFill_ThruSectionErrorStatus_Failed:
di << "Algorithm has failed\n";
break;
default:
break;
}
}
return 0;

View File

@@ -28,9 +28,9 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -40,7 +40,7 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
comptra = Standard_False;
line = new TheLine ();
Standard_Integer Nbvar = Func.NbVariables();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -68,7 +68,7 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
TopAbs_State situ;
// math_Vector tolerance(1,3),infbound(1,3),supbound(1,3);
math_Vector tolerance(1,Nbvar),infbound(1,Nbvar),supbound(1,Nbvar);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -115,8 +115,8 @@ void Blend_CSWalking::Perform(Blend_CSFunction& Func,
Standard_Real U,V,W;
previousP.ParametersOnS(U,V);
W = previousP.ParameterOnC();
TheExtremity P1(previousP.PointOnS(),U,V,previousP.Parameter(),tolesp);
TheExtremity P2(previousP.PointOnC(),W,previousP.Parameter(),tolesp);
TheExtremity P1(previousP.PointOnS(),U,V,previousP.Parameter(),tolpoint3d);
TheExtremity P2(previousP.PointOnC(),W,previousP.Parameter(),tolpoint3d);
if (sens>0.) {
line->SetStartPoints(P1,P2);
}

View File

@@ -39,7 +39,7 @@ Blend_Status Blend_CSWalking::TestArret(Blend_CSFunction& Function,
Blend_Status State1,State2;
IntSurf_TypeTrans tras = IntSurf_Undecided;
if (Function.IsSolution(Sol,tolesp)) {
if (Function.IsSolution(Sol,tolpoint3d)) {
pt1 = Function.PointOnS();
pt2 = Function.PointOnC();
@@ -176,15 +176,16 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnSurf
prevP = previousP.PointOnS();
prevTg = previousP.TangentOnS();
tolu = TheSurfaceTool::UResolution(surf,tolesp);
tolv = TheSurfaceTool::VResolution(surf,tolesp);
tolu = TheSurfaceTool::UResolution(surf,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf,tolpoint3d);
gp_Vec Corde(prevP,Psurf);
Norme = Corde.SquareMagnitude();
prevNorme = prevTg.SquareMagnitude(); // JAG MODIF 25.04.94
if (Norme <= tolesp*tolesp || prevNorme <= tolesp*tolesp) { // JAG MODIF 25.04.94
const Standard_Real toler3d = tolpoint3d;
if (Norme <= toler3d * toler3d || prevNorme <= toler3d * toler3d) { // JAG MODIF 25.04.94
// il faudra peut etre forcer meme point JAG MODIF 25.04.94
return Blend_SamePoints;
}
@@ -275,19 +276,20 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
prevP = previousP.PointOnC();
prevTg = previousP.TangentOnC();
tolu = TheCurveTool::Resolution(curv,tolesp);
tolu = TheCurveTool::Resolution(curv,tolpoint3d);
gp_Vec Corde(prevP,Pcurv);
Norme = Corde.SquareMagnitude();
prevNorme = prevTg.SquareMagnitude(); // JAG MODIF 25.04.94
const Standard_Real toler3d = tolpoint3d;
// if (Norme <= tolesp*tolesp || prevNorme <= tolesp*tolesp) { // JAG MODIF 25.04.94
if (Norme <= tolesp*tolesp) { // le 95.01.10
if (Norme <= toler3d * toler3d) { // le 95.01.10
// il faudra peut etre forcer meme point JAG MODIF 25.04.94
return Blend_SamePoints;
}
else if (prevNorme > tolesp*tolesp) {
else if (prevNorme > toler3d * toler3d) {
Cosi = sens*Corde*prevTg;
if (Cosi <0.) { // angle 3d>pi/2. --> retour arriere
return Blend_Backward;
@@ -308,7 +310,7 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
// Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
if (Tgcurv.Magnitude() <= tolesp) {
if (Tgcurv.Magnitude() <= tolpoint3d) {
return Blend_SamePoints; // GROS BOBARD EN ATTENDANT
}
@@ -318,7 +320,7 @@ Blend_Status Blend_CSWalking::CheckDeflectionOnCurv
return Blend_StepTooLarge;
}
if (prevNorme > tolesp*tolesp) {
if (prevNorme > toler3d * toler3d) {
// Estimation de la fleche courante
/*

View File

@@ -205,7 +205,7 @@ void Blend_CSWalking::MakeExtremity(TheExtremity& Extrem,
// Extrem.SetValue(previousP.PointOnS(),sol(1),sol(2),tolesp);
previousP.ParametersOnS(U,V);
Extrem.SetValue(previousP.PointOnS(),U,V,previousP.Parameter(),tolesp);
Extrem.SetValue(previousP.PointOnS(),U,V,previousP.Parameter(),tolpoint3d);
Iter = domain;

View File

@@ -40,7 +40,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -146,9 +146,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
// Indiquer que fin sur Bound.
}
else {
@@ -171,9 +171,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Arrive = Standard_True;
if (line->NbPoints()>=2) {
// Indiquer qu on s arrete en cours de cheminement
@@ -214,9 +214,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
// Indiquer que fin sur Bound.
}
else {
@@ -244,7 +244,7 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
MakeExtremity(Exts,Index,solrst(1),Isvtx,Vtx);
// Extc.SetValue(previousP.PointOnC(),sol(3),tolesp);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Arrive = Standard_True;
}
break;
@@ -259,9 +259,9 @@ void Blend_CSWalking::InternalPerform(Blend_CSFunction& Func,
*/
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Extc.SetValue(previousP.PointOnC(),previousP.ParameterOnC(),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Arrive = Standard_True;
}
break;

View File

@@ -62,9 +62,9 @@ void Blend_Walking::Perform(Blend_Function& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const Standard_Real MaxStep,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Fleche,
const Standard_Boolean Appro)
{
@@ -75,7 +75,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
Standard_Boolean doextremities = 1;
if(line.IsNull()) line = new TheLine ();
else {line->Clear();doextremities = 0;}
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
fleche = Abs(Fleche);
rebrou = Standard_False;
@@ -96,7 +96,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
TopAbs_State situ1,situ2;
math_Vector tolerance(1,4),infbound(1,4),supbound(1,4);
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -143,9 +143,9 @@ void Blend_Walking::Perform(Blend_Function& Func,
if(doextremities){
TheExtremity ptf1 (previousP.PointOnS1(),
sol(1),sol(2),tolesp);
sol(1),sol(2),tolpoint3d);
TheExtremity ptf2 (previousP.PointOnS2(),
sol(3),sol(4),tolesp);
sol(3),sol(4),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
ptf1.SetTangent(previousP.TangentOnS1());
ptf2.SetTangent(previousP.TangentOnS2());
@@ -168,7 +168,7 @@ void Blend_Walking::Perform(Blend_Function& Func,
Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
const Standard_Real Pdep,
math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
TopAbs_State& Pos1,
TopAbs_State& Pos2)
@@ -176,7 +176,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
iscomplete = Standard_False;
comptra = Standard_False;
line = new TheLine ();
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
Pos1 = Pos2 = TopAbs_UNKNOWN;
@@ -185,7 +185,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection(Blend_Function& Func,
Func.Set(param);
math_Vector tolerance(1, 4),infbound(1, 4),supbound(1, 4);
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -220,7 +220,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
const Standard_Real Pdep,
const Standard_Real Pmax,
const math_Vector& ParDep,
const Standard_Real Tolesp,
const Standard_Real Tol3d,
const Standard_Real TolGuide,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
@@ -235,7 +235,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
Standard_Real w1, w2, extrapol;
Standard_Boolean recad1, recad2;
tolesp = Abs(Tolesp);
tolpoint3d = Tol3d;
tolgui = Abs(TolGuide);
if (Pmax - Pdep >= 0.0)
{
@@ -262,7 +262,7 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
Standard_Real CorrectedU = 0., CorrectedV = 0.;
gp_Pnt CorrectedPnt;
Func.GetTolerance(tolerance, tolesp);
Func.GetTolerance(tolerance, tolpoint3d);
Func.GetBounds(infbound, supbound);
math_FunctionSetRoot rsnld(Func, tolerance, 30);
@@ -409,9 +409,9 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
#endif
MakeExtremity(Ext1, Standard_True, Index1, solrst1(1), Isvtx1, Vtx1);
if (ToCorrectOnRst1)
Ext2.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolesp);
Ext2.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolpoint3d);
else
Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), tolesp);
Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), tolpoint3d);
}
break;
@@ -424,9 +424,9 @@ Standard_Boolean Blend_Walking::PerformFirstSection (Blend_Function& Func,
}
#endif
if (ToCorrectOnRst2)
Ext1.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolesp);
Ext1.SetValue(CorrectedPnt, CorrectedU, CorrectedV, tolpoint3d);
else
Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), tolesp);
Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), tolpoint3d);
MakeExtremity(Ext2, Standard_False, Index2, solrst2(1), Isvtx2, Vtx2);
}
break;

View File

@@ -41,7 +41,7 @@ Blend_Status Blend_Walking::TestArret(Blend_Function& Function,
IntSurf_TypeTrans tras1,tras2;
Blend_Point curpoint;
Standard_Boolean loctwist1 = Standard_False, loctwist2 = Standard_False;
Standard_Real tolsolu = tolesp;
Standard_Real tolsolu = tolpoint3d;
if ( !TestSolu) tolsolu *= 1000; //Ca doit toujours etre bon
if (Function.IsSolution(sol,tolsolu)) {
@@ -211,8 +211,8 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent){
prevTg = previousP.TangentOnS1();
}
tolu = TheSurfaceTool::UResolution(surf1,tolesp);
tolv = TheSurfaceTool::VResolution(surf1,tolesp);
tolu = TheSurfaceTool::UResolution(surf1,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf1,tolpoint3d);
}
else {
Psurf = CurPoint.PointOnS2();
@@ -223,8 +223,8 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent){
prevTg = previousP.TangentOnS2();
}
tolu = TheSurfaceTool::UResolution(surf2,tolesp);
tolv = TheSurfaceTool::VResolution(surf2,tolesp);
tolu = TheSurfaceTool::UResolution(surf2,tolpoint3d);
tolv = TheSurfaceTool::VResolution(surf2,tolpoint3d);
}
gp_Vec Corde(prevP,Psurf);
@@ -233,12 +233,13 @@ Blend_Status Blend_Walking::CheckDeflection
if(!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp*tolesp){
const Standard_Real toler3d = 0.01 * tolpoint3d;
if (Norme <= toler3d * toler3d){
// il faudra peut etre forcer meme point
return Blend_SamePoints;
}
if(!prevpointistangent){
if(prevNorme <= tolesp*tolesp) {
if(prevNorme <= toler3d * toler3d) {
return Blend_SamePoints;
}
Cosi = sens*Corde*prevTg;

View File

@@ -125,7 +125,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
infb(2) -= Extrap;
supb(2) += Extrap;
FuncInv.GetTolerance(toler,tolesp/10);//Il vaut mieux garder un peu de marge
FuncInv.GetTolerance(toler,0.1 * tolpoint3d);//Il vaut mieux garder un peu de marge
math_FunctionSetRoot rsnld(FuncInv,toler,35);
toler *= 10; // Mais on fait les tests correctements
@@ -262,7 +262,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
else solrst(1) = pmin;
}
// On verifie le jalon
jalons_Trouve = (FuncInv.IsSolution(solrst,tolesp));
jalons_Trouve = (FuncInv.IsSolution(solrst,tolpoint3d));
}
if (!jalons_Trouve) {
@@ -276,7 +276,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
}
else {
rsnld.Root(solrst);
recadre = FuncInv.IsSolution(solrst,tolesp);
recadre = FuncInv.IsSolution(solrst,tolpoint3d);
}
}
@@ -310,7 +310,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
// Le probleme a resoudre
FuncInv.Set(OnFirst,thecur);
FuncInv.GetBounds(infb,supb);
FuncInv.GetTolerance(toler,tolesp/10);//Il vaut mieux garder un peu de marge
FuncInv.GetTolerance(toler,0.1 * tolpoint3d);//Il vaut mieux garder un peu de marge
math_FunctionSetRoot aRsnld(FuncInv,toler,35);
toler *= 10; // Mais on fait les tests correctements
// Resolution...
@@ -324,7 +324,7 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
}
else {
aRsnld.Root(solrst);
recadre = FuncInv.IsSolution(solrst,tolesp);
recadre = FuncInv.IsSolution(solrst,tolpoint3d);
}
}
@@ -453,7 +453,7 @@ void Blend_Walking::MakeExtremity(TheExtremity& Extrem,
if (OnFirst) {
Extrem.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS1());
Iter = recdomain1;
@@ -461,7 +461,7 @@ void Blend_Walking::MakeExtremity(TheExtremity& Extrem,
else {
Extrem.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
if (!previousP.IsTangencyPoint())
Extrem.SetTangent(previousP.TangentOnS2());
Iter = recdomain2;

View File

@@ -135,7 +135,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
//IntSurf_Transition Tline,Tarc;
Func.GetTolerance(tolerance,tolesp);
Func.GetTolerance(tolerance,tolpoint3d);
Func.GetBounds(infbound,supbound);
math_FunctionSetRoot rsnld(Func,tolerance,30);
@@ -173,10 +173,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (Abs(stepw) < tolgui) {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -227,7 +227,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (recad1) {
Standard_Real wtemp;
wtemp = solrst1(2);
if ((param - wtemp)/sens>= -10*tolesp){
if ((param - wtemp)/sens>= -10*tolgui){
w1 = solrst1(2);
control = Standard_True;
}
@@ -253,7 +253,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (recad2) {
Standard_Real wtemp;
wtemp = solrst2(2);
if ((param - wtemp)/sens>= -10*tolesp){
if ((param - wtemp)/sens>= -10*tolgui){
w2 = solrst2(2);
control = Standard_True;
}
@@ -505,10 +505,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
Arrive = Standard_True;
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(), tolesp);
previousP.Parameter(), tolpoint3d);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -533,10 +533,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
if (Abs(stepw) < tolgui) {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -584,10 +584,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
Arrive = Standard_True;
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());
@@ -627,15 +627,15 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
MakeExtremity(Ext1,Standard_True,Index1,
solrst1(1),Isvtx1,Vtx1);
// On blinde le cas singulier ou un des recadrage a planter
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) {
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) {
Ext2.SetValue(previousP.PointOnS1(),
sol(3),sol(4),tolesp);
sol(3),sol(4),tolpoint3d);
if (Isvtx1) MakeSingularExtremity(Ext2, Standard_False, Vtx1);
}
else {
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
}
Arrive = Standard_True;
}
@@ -661,15 +661,15 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
// On blinde le cas singulier ou un des recadrage a plante
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) {
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) {
Ext1.SetValue(previousP.PointOnS2(),
sol(1),sol(2),tolesp);
sol(1),sol(2),tolpoint3d);
if (Isvtx2) MakeSingularExtremity(Ext1, Standard_True, Vtx2);
}
else {
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
}
MakeExtremity(Ext2,Standard_False,Index2,
solrst2(1),Isvtx2,Vtx2);
@@ -698,7 +698,7 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
if ( (Isvtx1 != Isvtx2) &&
(previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) ) {
(previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2.0 * tolpoint3d)) ) {
// On blinde le cas singulier ou un seul recadrage
// est reconnu comme vertex.
if (Isvtx1) {
@@ -727,10 +727,10 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
#endif
Ext1.SetValue(previousP.PointOnS1(),
sol(1),sol(2),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
Ext2.SetValue(previousP.PointOnS2(),
sol(3),sol(4),
previousP.Parameter(),tolesp);
previousP.Parameter(),tolpoint3d);
if (!previousP.IsTangencyPoint()) {
Ext1.SetTangent(previousP.TangentOnS1());
Ext2.SetTangent(previousP.TangentOnS2());

View File

@@ -198,7 +198,8 @@ void ChFi3d_Builder::Compute()
ChFi3d_InitChron(cl_total);
ChFi3d_InitChron(cl_extent);
#endif
UpdateTolesp();
if (myListStripe.IsEmpty())
throw Standard_Failure("There are no suitable edges for chamfer or fillet");
@@ -335,7 +336,7 @@ void ChFi3d_Builder::Compute()
}
// 05/02/02 akm ^^^
Standard_Integer solidindex = st->SolidIndex();
ChFi3d_FilDS(solidindex,st,DStr,myRegul,tolesp,tol2d);
ChFi3d_FilDS(solidindex,st,DStr,myRegul,tolapp3d,tol2d);
if (!done) break;
}

View File

@@ -849,6 +849,10 @@ private:
Handle(BRepAdaptor_Surface)& HS1,
Handle(BRepAdaptor_Surface)& HS2) const;
//! Assign to tolesp parameter minimal value of spine's tolesp if it is less
//! than default initial value.
Standard_EXPORT void UpdateTolesp();
TopoDS_Shape myShape;
Standard_Real angular;

View File

@@ -325,7 +325,7 @@ ChFi3d_Builder::ChFi3d_Builder(const TopoDS_Shape& S,
myEShMap.Fill(S,TopAbs_EDGE,TopAbs_SHELL);
myVFMap.Fill(S,TopAbs_VERTEX,TopAbs_FACE);
myVEMap.Fill(S,TopAbs_VERTEX,TopAbs_EDGE);
SetParams(Ta,1.e-4,1.e-5,1.e-4,1.e-5,1.e-3);
SetParams(Ta, 1.0e-4, 1.e-5, 1.e-4, 1.e-5, 1.e-3);
SetContinuity(GeomAbs_C1, Ta);
}
@@ -336,7 +336,7 @@ ChFi3d_Builder::ChFi3d_Builder(const TopoDS_Shape& S,
void ChFi3d_Builder::SetParams(const Standard_Real Tang,
const Standard_Real Tesp,
const Standard_Real T2d,
const Standard_Real T2d,
const Standard_Real TApp3d,
const Standard_Real TolApp2d,
const Standard_Real Fleche)

View File

@@ -188,7 +188,7 @@ static Standard_Boolean BonVoisin(const gp_Pnt& Point,
Standard_Real& XDep,
Standard_Real& YDep,
const ChFiDS_Map& EFMap,
const Standard_Real tolesp)
const Standard_Real tol3d)
{
Standard_Boolean bonvoisin = 1;
Standard_Real winter, Uf, Ul;
@@ -203,7 +203,7 @@ static Standard_Boolean BonVoisin(const gp_Pnt& Point,
const TopoDS_Edge& ecur = TopoDS::Edge(Ex.Current());
if(!ecur.IsSame(cured)){
hc->Initialize(ecur);
Standard_Real tolc = hc->Resolution(tolesp);
Standard_Real tolc = hc->Resolution(tol3d);
if(ChFi3d_InterPlaneEdge(plane,hc,winter,1,tolc)){
gp_Pnt np = hc->Value(winter);
Standard_Real ndist = np.SquareDistance(papp);
@@ -848,7 +848,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
const BRepAdaptor_Curve& Ced = Spine->CurrentElementarySpine(iedge);
gp_Pnt pnt = Ced.Value(woned);
if (Projection(PExt, pnt, els, w, tolesp) &&
if (Projection(PExt, pnt, els, w, tolapp3d) &&
PerformFirstSection(Spine,HGuide,Choix,HS1,HS2,
I1,I2,w,SolDep,Pos1,Pos2)) {
P1.SetCoord(SolDep(1),SolDep(2));
@@ -894,7 +894,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
// Extrema_LocateExtPC ext(pnt,els,w,1.e-8);
// if(ext.IsDone()){
// w = ext.Point().Parameter();
if (Projection(PExt, pnt, els, w, tolesp)) {
if (Projection(PExt, pnt, els, w, tolapp3d)) {
PerformFirstSection(Spine,HGuide,Choix,HS1,HS2,
I1,I2,w,SolDep,Pos1,Pos2);
gp_Pnt P;
@@ -909,11 +909,11 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe,
NbChangement++) {
if(Pos1 != TopAbs_IN){
bonvoisin = BonVoisin(P, HS1, f1, plane, cured,
SolDep(1),SolDep(2), myEFMap, tolesp);
SolDep(1),SolDep(2), myEFMap, tolapp3d);
}
if(Pos2 != TopAbs_IN && bonvoisin){
bonvoisin = BonVoisin(P, HS2, f2, plane, cured,
SolDep(3),SolDep(4), myEFMap, tolesp);
SolDep(3),SolDep(4), myEFMap, tolapp3d);
}
if(bonvoisin){
f1 = HS1->Face();
@@ -2712,7 +2712,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pcprev1->D1(prevpar1,pdeb1,vdeb1);
pcnext1->D1(nextpar1,pfin1,vfin1);
Bon1 = ChFi3d_mkbound(S1,PC1,-1,pdeb1,vdeb1,1,
pfin1,vfin1,tolesp,2.e-4);
pfin1,vfin1,tolapp3d,2.e-4);
}
}
else{
@@ -2731,11 +2731,11 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pdeb1 = PC1->Value(pardeb1);
pfin1 = PC1->Value(parfin1);
Bon1 = ChFi3d_mkbound(S1,PC1,-1,pdeb1,Vdeb1,1,
pfin1,Vfin1,tolesp,2.e-4);
pfin1,Vfin1,tolapp3d,2.e-4);
}
}
else{
Bon1 = ChFi3d_mkbound(S1,PC1,tolesp,2.e-4);
Bon1 = ChFi3d_mkbound(S1,PC1,tolapp3d,2.e-4);
}
if(tw2){
if(!yaprevon2 || !yanexton2){
@@ -2770,7 +2770,7 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pcprev2->D1(prevpar2,pdeb2,vdeb2);
pcnext2->D1(nextpar2,pfin2,vfin2);
Bon2 = ChFi3d_mkbound(S2,PC2,-1,pdeb2,vdeb2,1,
pfin2,vfin2,tolesp,2.e-4);
pfin2,vfin2,tolapp3d,2.e-4);
}
}
else{
@@ -2789,11 +2789,11 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
pdeb2 = PC2->Value(pardeb2);
pfin2 = PC2->Value(parfin2);
Bon2 = ChFi3d_mkbound(S2,PC2,-1,pdeb2,Vdeb2,1,
pfin2,Vfin2,tolesp,2.e-4);
pfin2,Vfin2,tolapp3d,2.e-4);
}
}
else{
Bon2 = ChFi3d_mkbound(S2,PC2,tolesp,2.e-4);
Bon2 = ChFi3d_mkbound(S2,PC2,tolapp3d,2.e-4);
}
// The parameters of neighbor traces are updated, so
// straight lines uv are pulled.
@@ -2817,8 +2817,8 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe,
gp_Pnt2d pdebs2 = pcsprev2->Value(prevpar2);
gp_Pnt2d pfins1 = pcsnext1->Value(nextpar1);
gp_Pnt2d pfins2 = pcsnext2->Value(nextpar2);
Bdeb = ChFi3d_mkbound(sprev,pdebs1,pdebs2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(snext,pfins1,pfins2,tolesp,2.e-4);
Bdeb = ChFi3d_mkbound(sprev,pdebs1,pdebs2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(snext,pfins1,pfins2,tolapp3d,2.e-4);
GeomFill_ConstrainedFilling fil(11,20);
if(pointuon1) fil.Init(Bon2,Bfin,Bdeb,1);
@@ -3046,7 +3046,7 @@ void ChFi3d_Builder::PerformSetOfSurf(Handle(ChFiDS_Stripe)& Stripe,
ChFi3d_InitChron(ch); // init perf for ChFi3d_MakeExtremities
#endif
if(!Simul) ChFi3d_MakeExtremities(Stripe,DStr,myEFMap,tolesp,tol2d);
if(!Simul) ChFi3d_MakeExtremities(Stripe,DStr,myEFMap,tolapp3d,tol2d);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_makextremities); // result perf t_makextremities

View File

@@ -416,7 +416,7 @@ Standard_Boolean ChFi3d_Builder::CompleteData
const Standard_Boolean Gf2)
{
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
Data->ChangeSurf(DStr.AddSurface(TopOpeBRepDS_Surface(Surfcoin,tolesp)));
Data->ChangeSurf(DStr.AddSurface(TopOpeBRepDS_Surface(Surfcoin,tolapp3d)));
#ifdef DRAW
ChFi3d_SettraceDRAWFIL(Standard_True);
if (ChFi3d_GettraceDRAWFIL()) {
@@ -987,7 +987,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if(RecP || RecS || RecRst){
if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
tolesp,TolGuide,RecRst,RecP,RecS,
tolapp3d,tolapp2d,TolGuide,RecRst,RecP,RecS,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<std::endl;
@@ -1001,7 +1001,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
while (again < 2){
TheWalk.Perform (Func,FInv,FInvP,FInvC,NewFirst,Last,
MS,TolGuide,ParSol,tolesp,Fleche,Appro);
MS,tolapp3d,tolapp2d,TolGuide,ParSol,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
@@ -1119,7 +1119,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if (RecP1 || RecRst1 || RecP2 || RecRst2) {
if (!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
tolapp3d, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
NewFirst, ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : fail calculation first section"<<std::endl;
@@ -1133,7 +1133,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
while (again < 2){
TheWalk.Perform (Func, FInv1, FInvP1, FInv2, FInvP2, NewFirst, Last,
MS, TolGuide, ParSol, tolesp, Fleche, Appro);
MS, tolapp3d, TolGuide, ParSol, Fleche, Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
@@ -1249,7 +1249,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if(RecP || RecS || RecRst){
if(!TheWalk.PerformFirstSection(Func,FInv,FInvP,FInvC,PFirst,Target,Soldep,
tolesp,TolGuide,RecRst,RecP,RecS,
tolapp3d,tolapp2d,TolGuide,RecRst,RecP,RecS,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
@@ -1264,7 +1264,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
while (again < 2){
TheWalk.Perform (Func,FInv,FInvP,FInvC,NewFirst,Last,
MS,TolGuide,ParSol,tolesp,Fleche,Appro);
MS,tolapp3d,tolapp2d,TolGuide,ParSol,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path not done" << std::endl;
@@ -1375,7 +1375,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if (RecP1 || RecRst1 || RecP2 || RecRst2) {
if(!TheWalk.PerformFirstSection(Func, FInv1, FInvP1, FInv2, FInvP2, PFirst, Target, Soldep,
tolesp, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
tolapp3d, TolGuide, RecRst1, RecP1, RecRst2, RecP2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
@@ -1390,7 +1390,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
while (again < 2){
TheWalk.Perform (Func, FInv1, FInvP1, FInv2, FInvP2, NewFirst, Last,
MS, TolGuide, ParSol, tolesp, Fleche, Appro);
MS, tolapp3d, TolGuide, ParSol, Fleche, Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path not created" << std::endl;
@@ -1518,7 +1518,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
if(!HS.IsNull()) F2 = HS->Face();
// Path framing variables
Standard_Real TolGuide=tolguide, TolEsp = tolesp;
Standard_Real TolGuide=tolguide;
Standard_Integer nbptmin = 4;
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
@@ -1559,7 +1559,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
BP.ParametersOnS1(vec(1),vec(2));
BP.ParametersOnS2(vec(3),vec(4));
Func.Set(param);
if (Func.IsSolution(vec, tolesp)) {
if (Func.IsSolution(vec, tolapp3d)) {
TheWalk.AddSingularPoint(BP);
}
}
@@ -1574,7 +1574,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
BP.ParametersOnS1(vec(1),vec(2));
BP.ParametersOnS2(vec(3),vec(4));
Func.Set(param);
if (Func.IsSolution(vec, tolesp)) {
if (Func.IsSolution(vec, tolapp3d)) {
TheWalk.AddSingularPoint(BP);
}
}
@@ -1587,7 +1587,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
Standard_Real NewFirst = PFirst;
if(RecOnS1 || RecOnS2){
if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
tolesp,TolGuide,RecOnS1,RecOnS2,
tolapp3d,TolGuide,RecOnS1,RecOnS2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::ComputeData : calculation fail first section"<<std::endl;
@@ -1617,10 +1617,9 @@ Standard_Boolean ChFi3d_Builder::ComputeData
if(!again && (MS < 5*TolGuide)) MS = 5*TolGuide;
else {
if (5*TolGuide > MS) TolGuide = MS/5;
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,tolapp3d,TolGuide,
ParSol,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG
std::cout << "Path is not created" << std::endl;
@@ -1776,7 +1775,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
narc2 = Lin->StartPointOnSecond().NbPointOnRst();
if(narc1 != 0) {
ChFi3d_FilCommonPoint(Lin->StartPointOnFirst(),Lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(), tolapp3d);
debarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS1(),F1,bif)){
//It is checked if there is not an obstacle.
@@ -1794,7 +1793,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
}
if(narc2 != 0){
ChFi3d_FilCommonPoint(Lin->StartPointOnSecond(),Lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
debarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1831,7 +1830,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
backwContinueFailed = Lin->StartPointOnFirst().ParameterOnGuide() > Target;
else {
ChFi3d_FilCommonPoint(Lin->StartPointOnFirst(),Lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(), tolapp3d);
debarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1853,7 +1852,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
backwContinueFailed = Lin->StartPointOnSecond().ParameterOnGuide() > Target;
else {
ChFi3d_FilCommonPoint(Lin->StartPointOnSecond(),Lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(), tolapp3d);
debarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexFirstOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1889,7 +1888,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
narc2 = Lin->EndPointOnSecond().NbPointOnRst();
if(narc1 != 0){
ChFi3d_FilCommonPoint(Lin->EndPointOnFirst(),Lin->TransitionOnS1(),
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
Standard_False, Data->ChangeVertexLastOnS1(), tolapp3d);
finarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1902,7 +1901,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
}
if(narc2 != 0){
ChFi3d_FilCommonPoint(Lin->EndPointOnSecond(),Lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(), tolapp3d);
finarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS2(),F2,bif)){
//It is checked if it is not an obstacle.
@@ -1934,7 +1933,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
forwContinueFailed = Lin->EndPointOnFirst().ParameterOnGuide() < Target;
else {
ChFi3d_FilCommonPoint(Lin->EndPointOnFirst(),Lin->TransitionOnS1(),
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
Standard_False, Data->ChangeVertexLastOnS1(), tolapp3d);
finarc1 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS1(),F1,bif)){
//It is checked if it is not an obstacle.
@@ -1951,7 +1950,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
forwContinueFailed = Lin->EndPointOnSecond().ParameterOnGuide() < Target;
else {
ChFi3d_FilCommonPoint(Lin->EndPointOnSecond(),Lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(), tolapp3d);
finarc2 = Standard_True;
if(!SearchFace(Spine,Data->VertexLastOnS2(),F2,bif)){
//On regarde si ce n'est pas un obstacle.
@@ -2125,7 +2124,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
TheWalk.Check2d(Standard_False);
Standard_Real MS = MaxStep;
Standard_Real TolGuide=tolguide, TolEsp = tolesp;
Standard_Real TolGuide=tolguide;
Standard_Integer Nbpnt = 0;
Standard_Real SpFirst = HGuide->FirstParameter();
Standard_Real SpLast = HGuide->LastParameter();
@@ -2145,7 +2144,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
Standard_Real NewFirst = PFirst;
if(RecOnS1 || RecOnS2){
if(!TheWalk.PerformFirstSection(Func,FInv,PFirst,Target,Soldep,
tolesp,TolGuide,RecOnS1,RecOnS2,
tolapp3d,TolGuide,RecOnS1,RecOnS2,
NewFirst,ParSol)){
#ifdef OCCT_DEBUG
std::cout<<"ChFi3d_Builder::SimulData : calculation fail first section"<<std::endl;
@@ -2163,11 +2162,10 @@ Standard_Boolean ChFi3d_Builder::SimulData
if(!again && (MS < 5*TolGuide)) MS = 5*TolGuide;
else {
if (5*TolGuide > MS) TolGuide = MS/5;
if (5*TolEsp > MS) TolEsp = MS/5;
}
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,TolGuide,
ParSol,TolEsp,Fleche,Appro);
TheWalk.Perform(Func,FInv,NewFirst,Target,MS,tolapp3d,TolGuide,
ParSol,Fleche,Appro);
if (!TheWalk.IsDone()) {
#ifdef OCCT_DEBUG

View File

@@ -725,7 +725,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
ChFiDS_CommonPoint saveCPopArc = CPopArc;
c3df = DStr.Curve(FiopArc.LineIndex()).Curve();
inters = IntersUpdateOnSame (HGs,HBs,c3df,Fop,Fv,Arcprol,Vtx,isfirst,10*tolesp, // in
inters = IntersUpdateOnSame (HGs,HBs,c3df,Fop,Fv,Arcprol,Vtx,isfirst,10*tolapp3d, // in
FiopArc,CPopArc,p2dbout,wop); // out
Handle(BRepAdaptor_Curve2d) pced = new BRepAdaptor_Curve2d();
@@ -763,7 +763,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
TopoDS_Edge edgecouture;
Standard_Boolean couture,intcouture=Standard_False;
Standard_Real tolreached = tolesp;
Standard_Real tolreached = tolapp3d;
Standard_Real par1 =0.,par2 =0.;
Standard_Integer indpt = 0,Icurv1 = 0,Icurv2 = 0;
Handle(Geom_TrimmedCurve) curv1,curv2;
@@ -817,7 +817,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolesp,tol2d,tolreached))
Pc,tolapp3d,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = Cc->FirstParameter();
@@ -1238,7 +1238,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index,
Handle(Geom2d_Curve) zob2dop, zob2dv;
//Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolesp,tol2d,tolreached))
zob2dv,tolapp3d,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();
@@ -2143,7 +2143,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
const Handle(Geom_Curve)& c3df = DStr.Curve(Fi1.LineIndex()).Curve();
Standard_Real Ufi= Fi2.Parameter(isfirst);
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS1();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F1,Face[0],Edge[0],Vtx,isfirst,10*tolesp, // in
if (!IntersUpdateOnSame (HGs,HBs,c3df,F1,Face[0],Edge[0],Vtx,isfirst,10*tolapp3d, // in
Fi,CV1,pfac1,Ufi)) // out
throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi1 = Fi;
@@ -2155,14 +2155,14 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
paredge2 = proj.LowerDistanceParameter();
}
// update stripe point
TopOpeBRepDS_Point tpoint (CV1.Point(),tolesp);
TopOpeBRepDS_Point tpoint (CV1.Point(),tolapp3d);
indpoint1=DStr.AddPoint(tpoint);
stripe->SetIndexPoint(indpoint1,isfirst,1);
// reset arc of CV1
TopoDS_Vertex vert1,vert2;
TopExp::Vertices(Edge[0],vert1,vert2);
TopAbs_Orientation arcOri = Vtx.IsSame(vert1) ? TopAbs_FORWARD : TopAbs_REVERSED;
CV1.SetArc(tolesp,Edge[0],paredge2,arcOri);
CV1.SetArc(tolapp3d,Edge[0],paredge2,arcOri);
}
else {
if (Hc1.IsNull()) {
@@ -2389,7 +2389,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
const Handle(Geom_Curve)& c3df = DStr.Curve(Fi2.LineIndex()).Curve();
Standard_Real Ufi= Fi1.Parameter(isfirst);
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS2();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F2,F,Edge[nb],Vtx,isfirst,10*tolesp, // in
if (!IntersUpdateOnSame (HGs,HBs,c3df,F2,F,Edge[nb],Vtx,isfirst,10*tolapp3d, // in
Fi,CV2,pfac2,Ufi)) // out
throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi2 = Fi;
@@ -2403,14 +2403,14 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
paredge2 = proj.LowerDistanceParameter();
}
// update stripe point
TopOpeBRepDS_Point tpoint (CV2.Point(),tolesp);
TopOpeBRepDS_Point tpoint (CV2.Point(),tolapp3d);
indpoint2=DStr.AddPoint(tpoint);
stripe->SetIndexPoint(indpoint2,isfirst,2);
// reset arc of CV2
TopoDS_Vertex vert1,vert2;
TopExp::Vertices(Edge[nbface],vert1,vert2);
TopAbs_Orientation arcOri = Vtx.IsSame(vert1) ? TopAbs_FORWARD : TopAbs_REVERSED;
CV2.SetArc(tolesp,Edge[nbface],paredge2,arcOri);
CV2.SetArc(tolapp3d,Edge[nbface],paredge2,arcOri);
}
@@ -2483,7 +2483,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
//////////////////////////////////////////////////////////////////////
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,Pc,tolesp,tol2d,tolreached,nbface==1)) {
Ps,Pc,tolapp3d,tol2d,tolreached,nbface==1)) {
PerformMoreThreeCorner (Index,1);
return;
}
@@ -2799,7 +2799,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
Standard_Real aTolreached;
ChFi3d_ComputePCurv(Cc,UV1,UV2,Ps,
DStr.Surface(SDprev->Surf()).Surface(),
p1,p2,tolesp,aTolreached);
p1,p2,tolapp3d,aTolreached);
TopOpeBRepDS_Curve& TCurv = DStr.ChangeCurve(indcurve[nb-1]);
TCurv.Tolerance(Max(TCurv.Tolerance(),aTolreached));
@@ -2858,7 +2858,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
//box.Add(aSurf->Value(UV.X(), UV.Y()));
ChFi3d_ComputeArete(CV1,UV1,CV2,UV2,aSurf, // in
C3d,Ps,p1,p2,tolesp,tol2d,aTolreached,0); // out except tolers
C3d,Ps,p1,p2,tolapp3d,tol2d,aTolreached,0); // out except tolers
indpoint1 = indpoint2 = midIpoint;
gp_Pnt point;
@@ -2890,7 +2890,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
UV1.SetCoord(isUShrink ? 1 : 2, prevSDParam);
UV2.SetCoord(isUShrink ? 1 : 2, prevSDParam);
ChFi3d_ComputePCurv(C3d,UV1,UV2,Pc,aSurf,p1,p2,tolesp,aTolreached);
ChFi3d_ComputePCurv(C3d,UV1,UV2,Pc,aSurf,p1,p2,tolapp3d,aTolreached);
Crv.Tolerance(Max(Crv.Tolerance(),aTolreached));
Interfc= ChFi3d_FilCurveInDS (Icurv,IsurfPrev,Pc,TopAbs::Reverse(orcourbe));
@@ -3974,7 +3974,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
Handle(Geom2dAdaptor_Curve) pcprol = new Geom2dAdaptor_Curve(gpcprol);
Standard_Real partemp = BRep_Tool::Parameter(Vtx,Arcprol);
inters = Update(HBs,pcprol,HGs,FiopArc,CPopArc,p2dbout,
isfirst,partemp,wop,10*tolesp);
isfirst,partemp,wop,10*tolapp3d);
}
Handle(BRepAdaptor_Curve2d) pced = new BRepAdaptor_Curve2d();
pced->Initialize(CPadArc.Arc(),Fv);
@@ -3987,7 +3987,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
TopoDS_Edge edgecouture;
Standard_Boolean couture,intcouture=Standard_False;
Standard_Real tolreached = tolesp;
Standard_Real tolreached = tolapp3d;
Standard_Real par1 = 0.,par2 = 0.;
Standard_Integer indpt =0,Icurv1 =0,Icurv2 =0;
Handle(Geom_TrimmedCurve) curv1,curv2;
@@ -4039,7 +4039,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolesp,tol2d,tolreached))
Pc,tolapp3d,tol2d,tolreached))
throw Standard_Failure("OneCorner : failed calculation intersection");
Udeb = Cc->FirstParameter();
@@ -4311,7 +4311,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
Handle(Geom2d_Curve) zob2dop, zob2dv;
// Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolesp,tol2d,tolreached))
zob2dv,tolapp3d,tol2d,tolreached))
throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();

View File

@@ -230,7 +230,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
gp_Pnt psp1 = Hpivot->Value(parCP1);
gp_Pnt psp2 = Hpivot->Value(parCP2);
Standard_Real sameparam = (psp1.Distance(psp2) < 10 * tolesp);
Standard_Real sameparam = (psp1.Distance(psp2) < 10.0 * tolapp3d);
TopoDS_Face FF1 = TopoDS::Face(DStr.Shape(Fd1->Index(IFaArc1)));
TopoDS_Face FF2 = TopoDS::Face(DStr.Shape(Fd2->Index(IFaArc2)));
@@ -289,10 +289,10 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Reduce(UIntPC1,UIntPC2,HS1,HS2);
}
Standard_Real tolreached = tolesp;
Standard_Real tolreached = tolapp3d;
if (IFaCo1 == 1 &&
!ChFi3d_ComputeCurves(HS1,HS2,Pardeb,Parfin,Gc,
PGc1,PGc2,tolesp,tol2d,tolreached)) {
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel error interSS"<<std::endl;
#endif
@@ -301,7 +301,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
else if (IFaCo1 == 2 &&
!ChFi3d_ComputeCurves(HS1,HS2,Parfin,Pardeb,Gc,
PGc1,PGc2,tolesp,tol2d,tolreached)) {
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel error interSS"<<std::endl;
#endif
@@ -451,7 +451,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(SmaHS,BigHS,Pardeb,Parfin,Gc,
PGc1,PGc2,tolesp,tol2d,tolreached)) {
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"failed to calculate bevel failed interSS"<<std::endl;
#endif
@@ -573,7 +573,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
ChFi3d_BoundFac (*HF, uu1, uu2, vv1, vv2, Standard_True);
if (!ChFi3d_ComputeCurves(HF,BigHS,Pardeb,Parfin,Gc,
PGc1,PGc2,tolesp,tol2d,tolreached)) {
PGc1,PGc2,tolapp3d,tol2d,tolreached)) {
#ifdef OCCT_DEBUG
std::cout<<"fail calculation bevel fail interSS"<<std::endl;
#endif
@@ -638,7 +638,26 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer
}
//=======================================================================
//function : UpdateTolesp
//purpose : Update tolesp field to fit it to range of parameter of spine curve
//=======================================================================
void ChFi3d_Builder::UpdateTolesp()
{
ChFiDS_ListIteratorOfListOfStripe itel;
// tolesp = Precision::Infinite();
for (itel.Initialize(myListStripe); itel.More(); itel.Next())
{
Handle(ChFiDS_Stripe)& curStripe = itel.Value();
Handle(ChFiDS_Spine)& Spine = curStripe->ChangeSpine();
const Standard_Real current_stripe_tolesp = Spine->GetTolesp();
if (tolesp > current_stripe_tolesp)
{
tolesp = current_stripe_tolesp;
}
}
}

View File

@@ -2053,7 +2053,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
// Using constraint order > 0 very often causes unpredicable undulations of solution
Standard_Integer degree = 3, nbcurvpnt = 10, nbiter = 1;
Standard_Integer constr = 1; //G1
GeomPlate_BuildPlateSurface PSurf(degree, nbcurvpnt, nbiter, tol2d, tolesp, angular);
GeomPlate_BuildPlateSurface PSurf(degree, nbcurvpnt, nbiter, tol2d, tolapp3d, angular);
// calculation of curves on surface for each stripe
for (ic=0;ic<nedge;ic++) {
gp_Pnt2d p2d1, p2d2;
@@ -2081,7 +2081,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
//Order.SetValue(ic,1);
Order.SetValue(ic, constr);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(ic), nbcurvpnt,tolesp,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(ic),nbcurvpnt,tolapp3d,angular,0.1);
PSurf.Add(Cont);
// calculate indexes of points and of the curve for the DS
@@ -2378,7 +2378,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
if (isG1.Value(ic))
Order.SetValue(n3d,1);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
PSurf.Add(Cont);
//calculation of curve 3d if it is not a projection
@@ -2502,7 +2502,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Handle(Adaptor3d_CurveOnSurface) HCons =new Adaptor3d_CurveOnSurface(CurvOnS);
Order.SetValue(n3d,1);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
PSurf.Add(Cont);
TopOpeBRepDS_Curve tcurv3d( cproj,error);
indcurve3d.SetValue(n3d, DStr.AddCurve(tcurv3d));
@@ -2615,7 +2615,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Handle(Adaptor3d_CurveOnSurface) HCons =new Adaptor3d_CurveOnSurface(CurvOnS);
Order.SetValue(n3d,0);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolesp,angular,0.1);
new GeomPlate_CurveConstraint(HCons,Order.Value(n3d),10,tolapp3d,angular,0.1);
PSurf.Add(Cont);
TopOpeBRepDS_Curve tcurv3d( ctrim,1.e-4);
indcurve3d.SetValue(n3d, DStr.AddCurve(tcurv3d));

View File

@@ -654,7 +654,7 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
// Cutting of tangency lines (hatching).
Geom2dHatch_Intersector Inter(pitol,pitol);
Geom2dHatch_Hatcher H1(Inter,tol2d,tolesp), H2(Inter,tol2d,tolesp);
Geom2dHatch_Hatcher H1(Inter,tol2d,tolapp3d), H2(Inter,tol2d,tolapp3d);
Standard_Integer ie;
Handle(Geom2d_Curve) C1 = Data->InterferenceOnS1().PCurveOnFace();
Geom2dAdaptor_Curve ll1;

View File

@@ -822,13 +822,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -932,13 +932,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -1017,13 +1017,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
@@ -1175,7 +1175,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
if (chsp.IsNull())
throw Standard_ConstructionError("PerformSurf : this is not the spine of a chamfer");
Standard_Real TolGuide = HGuide->Resolution(tolesp) ;
Standard_Real TolGuide = HGuide->Resolution(tolapp3d);
if (chsp->IsChamfer() == ChFiDS_Sym) {
@@ -1244,7 +1244,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(*pFunc,Par,SolDep,
tolesp,TolGuide,Pos1,Pos2);
tolapp3d,TolGuide,Pos1,Pos2);
}
else if (chsp->IsChamfer() == ChFiDS_TwoDist) {
Standard_Real dis1, dis2;
@@ -1347,7 +1347,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(*pFunc,Par,SolDep,
tolesp,TolGuide,Pos1,Pos2);
tolapp3d,TolGuide,Pos1,Pos2);
}
else { //distance and angle
Standard_Real dis1, angle;
@@ -1415,7 +1415,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection
}
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolesp,TolGuide,Pos1,Pos2);
tolapp3d,TolGuide,Pos1,Pos2);
} //distance and angle
}

View File

@@ -478,7 +478,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fdpiv,coin,
p3d[fin],p2d[fin],p3d[deb],p2d[deb],
gcpiv,pivpc1,pivpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoinpiv))
tolapp3d,tol2d,tolrcoinpiv))
throw StdFail_NotDone("echec calcul intersection coin-pivot");
gp_Vec norpiv = deru.Crossed(derv);
@@ -495,7 +495,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fddeb,coin,
p3d[pivot],p2d1,p3d[fin],p2d2,
gcdeb,debpc1,debpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoindeb))
tolapp3d,tol2d,tolrcoindeb))
throw StdFail_NotDone("echec calcul intersection coin-deb");
Icf = DStr.AddCurve(TopOpeBRepDS_Curve(gcdeb,tolrcoindeb));
@@ -514,7 +514,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (!ComputeIntersection(DStr,fdfin,coin,
p3dface,p2d1,p3d[deb],p2d2,
gcfin,finpc1,finpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoinfin))
tolapp3d,tol2d,tolrcoinfin))
throw StdFail_NotDone("echec calcul intersection coin-face");
Icl = DStr.AddCurve(TopOpeBRepDS_Curve(gcfin,tolrcoinfin));
@@ -543,8 +543,8 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
gaf->Initialize(face[pivot]);
Standard_Real tolr;
ChFi3d_ProjectPCurv(gac,gaf,facepc1,tolesp,tolr);
ChFi3d_ProjectPCurv(gac,gas,facepc2,tolesp,tolr);
ChFi3d_ProjectPCurv(gac,gaf,facepc1,tolapp3d,tolr);
ChFi3d_ProjectPCurv(gac,gas,facepc2,tolapp3d,tolr);
}
}
}
@@ -616,18 +616,18 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
// les bords de coin sont des lignes courbes qui suivent les
// tangentes donnees
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],p2d[pivot],Tgpiv,
sens[fin],p2d[3],Tg3,tolesp,2.e-4);
sens[fin],p2d[3],Tg3,tolapp3d,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],p2d[fin],vpfin,
sens[fin],p2d[deb],vpdeb,tolesp,2.e-4);
sens[fin],p2d[deb],vpdeb,tolapp3d,2.e-4);
}
else {
// les bords de coin sont des segments
// Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
// p2d[3],tolesp,2.e-4);
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,p2d[pivot],
p2d[3],tolesp,2.e-4);
p2d[3],tolapp3d,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,p2d[fin],
p2d[deb],tolesp,2.e-4);
p2d[deb],tolapp3d,2.e-4);
}
gp_Pnt2d pdeb1 = fddeb->Interference(jf[deb][pivot]).PCurveOnSurf()->Value(p[deb][pivot]);
@@ -637,15 +637,15 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
if (issmooth) {
// il faut homogeneiser, mettre les bords "BoundWithSurf"
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,tolesp,2.e-4);
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,tolapp3d,2.e-4);
}
else {
// ou les 4 bords de type "FreeBoundary"
Bdeb = ChFi3d_mkbound(DStr.Surface(fddeb->Surf()).Surface(),pdeb1,pdeb2,
tolesp,2.e-4,Standard_True);
tolapp3d,2.e-4,Standard_True);
Bfin = ChFi3d_mkbound(DStr.Surface(fdfin->Surf()).Surface(),pfin1,pfin2,
tolesp,2.e-4,Standard_True);
tolapp3d,2.e-4,Standard_True);
}
GeomFill_ConstrainedFilling fil(8,20);
fil.Init(Bpiv,Bfin,Bfac,Bdeb);
@@ -704,7 +704,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv);
}
@@ -733,7 +733,7 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv);
}

View File

@@ -689,13 +689,13 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Data->SetSimul(sec);
Data->Set2dPoints(pf1,pl1,pf2,pl2);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = Standard_False;
@@ -857,13 +857,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
// gp_Pnt2d pbid;
Data->Set2dPoints(ppcf,ppcl,pf,pl);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS2(),tolesp);
Standard_False,Data->ChangeVertexLastOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS1(),tolesp);
Standard_False, Data->ChangeVertexLastOnS1(),tolapp3d);
}
//=======================================================================
@@ -989,13 +989,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
//gp_Pnt2d pbid;
Data->Set2dPoints(pf,pl,ppcf,ppcl);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
}
@@ -1153,13 +1153,13 @@ void ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
// Data->Set2dPoints(pf,pl,pbid,pbid);
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(),tolesp);
Standard_False,Data->ChangeVertexLastOnS1(),tolapp3d);
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(),tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(),tolapp3d);
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_False, Data->ChangeVertexLastOnS2(),tolapp3d);
}
@@ -1188,14 +1188,14 @@ Standard_Boolean ChFi3d_FilBuilder::PerformFirstSection
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Standard_Real TolGuide = HGuide->Resolution(tolesp);
Standard_Real TolGuide = HGuide->Resolution(tolapp3d);
if(fsp->IsConstant()){
BRepBlend_ConstRad Func(S1,S2,HGuide);
Func.Set(fsp->Radius(),Choix);
Func.Set(myShape);
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolesp,TolGuide,Pos1,Pos2);
tolapp3d,TolGuide,Pos1,Pos2);
}
else {
BRepBlend_EvolRad Func(S1,S2,HGuide,fsp->Law(HGuide));
@@ -1203,7 +1203,7 @@ Standard_Boolean ChFi3d_FilBuilder::PerformFirstSection
Func.Set(myShape);
BRepBlend_Walking TheWalk(S1,S2,I1,I2,HGuide);
return TheWalk.PerformFirstSection(Func,Par,SolDep,
tolesp,TolGuide,Pos1,Pos2);
tolapp3d,TolGuide,Pos1,Pos2);
}
}

View File

@@ -321,7 +321,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
parCP2 = CP2.ParameterOnArc();
gp_Pnt tst1 = Hpivot->Value(parCP1);
gp_Pnt tst2 = Hpivot->Value(parCP2);
sameparam = tst1.Distance(tst2) <= tolesp;
sameparam = tst1.Distance(tst2) <= tolapp3d;
}
Handle(BRepAdaptor_Surface) HFaCo = new BRepAdaptor_Surface();
Handle(BRepAdaptor_Surface) HFaPiv;
@@ -477,18 +477,18 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch ); // init perf filling
#endif
B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolesp,2.e-4);
B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolesp,2.e-4);
B1 = ChFi3d_mkbound(surf1,p2df1,p2da1,tolapp3d,2.e-4);
B2 = ChFi3d_mkbound(surf2,p2df2,p2da2,tolapp3d,2.e-4);
Handle(Geom2d_Curve) PCurveOnFace;
Bfac = ChFi3d_mkbound(HFaCo,PCurveOnFace,Sens1,p2dfac1,v2dfac1,
Sens2,p2dfac2,v2dfac2,tolesp,2.e-4);
Sens2,p2dfac2,v2dfac2,tolapp3d,2.e-4);
GeomFill_ConstrainedFilling fil(8,20);
if(sameparam) {
fil.Init(Bfac,B2,B1,1);
}
else {
Handle(Adaptor3d_Curve) HPivTrim = Hpivot->Trim(Min(parCP1,parCP2),Max(parCP1,parCP2),tolesp);
Bpiv = new GeomFill_SimpleBound(HPivTrim,tolesp,2.e-4);
Bpiv = new GeomFill_SimpleBound(HPivTrim,tolapp3d,2.e-4);
fil.Init(Bfac,B2,Bpiv,B1,1);
BRepAdaptor_Curve2d pcpivot;
gp_Vec dArc,dcf;
@@ -597,14 +597,14 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
Standard_Real par1 = sd1->Interference(IFaArc1).Parameter(isfirst1);
pp1 = sd1->Interference(IFaCo1).PCurveOnSurf()->Value(par1);
pp2 = sd1->Interference(IFaArc1).PCurveOnSurf()->Value(par1);
Standard_Real tolr1;
ChFi3d_ComputePCurv(C3d,pp1,pp2,st1->ChangePCurve(isfirst1),
DStr.Surface(sd1->Surf()).Surface(),
P1deb,P2deb,tolesp,tolr1);
P1deb,P2deb,tolapp3d,tolr1);
tolreached = Max(tolreached,tolr1);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
@@ -624,14 +624,14 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
Standard_Real par2 = sd2->Interference(IFaArc2).Parameter(isfirst2);
pp1 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(par2);
pp2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(par2);
Standard_Real tolr2;
ChFi3d_ComputePCurv(C3d,pp1,pp2,st2->ChangePCurve(isfirst2),
DStr.Surface(sd2->Surf()).Surface(),
P1deb,P2deb,tolesp,tolr2);
P1deb,P2deb,tolapp3d,tolr2);
tolreached = Max(tolreached,tolr2);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);
@@ -732,7 +732,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom_Surface) surfsam = DStr.Surface(sdsam->Surf()).Surface();
Handle(GeomAdaptor_Surface) Hsurfsam = new GeomAdaptor_Surface(surfsam);
Handle(Geom2d_Curve) pcsurfsam;
Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolesp,2.e-4);
Bsam = ChFi3d_mkbound(Hsurfsam,pcsurfsam,ppopsam,ppcosam,tolapp3d,2.e-4);
Standard_Real upcopdif = sddif->Interference(ifaopdif).Parameter(isfirstdif);
gp_Pnt2d ppopdif =
sddif->Interference(ifaopdif).PCurveOnSurf()->Value(upcopdif);
@@ -741,7 +741,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom_Surface) surfdif = DStr.Surface(sddif->Surf()).Surface();
Handle(GeomAdaptor_Surface) Hsurfdif = new GeomAdaptor_Surface(surfdif);
Handle(Geom2d_Curve) pcsurfdif;
Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolesp,2.e-4);
Bdif = ChFi3d_mkbound(Hsurfdif,pcsurfdif,ppcodif,ppopdif,tolapp3d,2.e-4);
gp_Pnt2d ppfacsam,ppfacdif;
gp_Pnt PPfacsam,PPfacdif;
gp_Vec VVfacsam,VVfacdif;
@@ -773,7 +773,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
Handle(Geom2d_Curve) pcFopsam = ChFi3d_BuildPCurve(HBRFopsam,
ppfacsam,VVfacsam,
ppfacdif,VVfacdif,1);
Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolesp,2.e-4);
Bfac = ChFi3d_mkbound(HBRFopsam,pcFopsam,tolapp3d,2.e-4);
GeomFill_ConstrainedFilling fil(8,20);
fil.Init(Bsam,Bdif,Bfac,1);
#if 0
@@ -827,10 +827,10 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
Standard_Real tolr1;
Handle(GeomAdaptor_Curve) HC3d = new GeomAdaptor_Curve(C3d);
ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolesp,tolr1);
ChFi3d_SameParameter(HC3d,pcFopsam,HBRFopsam,tolapp3d,tolr1);
tolreached = Max(tolreached,tolr1);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
@@ -858,10 +858,10 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
Standard_Real tolr2;
HC3d->Load(C3d);
ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolesp,tolr2);
ChFi3d_SameParameter(HC3d,pcsurfdif,Hsurfdif,tolapp3d,tolr2);
tolreached = Max(tolreached,tolr2);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);

View File

@@ -307,7 +307,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
pivot = ii; deb = jj; fin = kk;
}
}
if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolesp && Abs(qr[0]-qr[2])<tolesp);
if(!c1toric)c1spheric=(Abs(qr[0]-qr[1])<tolapp3d && Abs(qr[0]-qr[2])<tolapp3d);
}
// Previously to avoid loops the points were always located
@@ -543,14 +543,14 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(BRepBlend_Line) lin;
Standard_Real ffi = WFirst, lla = WLast + pasmax;
if (Abs(Rdeb-Rfin)<=tolesp){
if (Abs(Rdeb-Rfin)<=tolapp3d){
BRepBlend_ConstRad func(Fac,Surf,cornerspine);
BRepBlend_ConstRadInv finv(Fac,Surf,cornerspine);
func.Set(Rdeb,choix);
func.Set(myShape);
finv.Set(Rdeb,choix);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Real TolGuide = cornerspine->Resolution(tolapp3d);
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
@@ -573,7 +573,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
func.Set(choix);
func.Set(myShape);
finv.Set(choix);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Real TolGuide = cornerspine->Resolution(tolapp3d);
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
@@ -607,7 +607,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(Geom2d_Curve) PCurveOnFace;
if(!c1pointu)
Bfac = ChFi3d_mkbound(Fac,PCurveOnFace,sens[deb],pfac1,vfac1,
sens[fin],pfac2,vfac2,tolesp,2.e-4);
sens[fin],pfac2,vfac2,tolapp3d,2.e-4);
Standard_Integer kkk;
gp_Pnt ppbid;
gp_Vec vp1,vp2;
@@ -620,7 +620,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Handle(Geom2d_Curve) PCurveOnPiv;
// Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,sens[deb],psurf1,vp1,
// sens[fin],psurf2,vp2,tolesp,2.e-4);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolesp,2.e-4,0);
Bpiv = ChFi3d_mkbound(Surf,PCurveOnPiv,psurf1,psurf2,tolapp3d,2.e-4,0);
Standard_Real pardeb2 = p[deb][pivot];
Standard_Real parfin2 = p[fin][pivot];
if(c1pointu){
@@ -642,8 +642,8 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
DStr.Surface(CD[fin]->SetOfSurfData()->
Value(i[fin][pivot])->Surf()).Surface();
Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolesp,2.e-4);
Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolesp,2.e-4);
Bdeb = ChFi3d_mkbound(sdeb,pdeb1,pdeb2,tolapp3d,2.e-4);
Bfin = ChFi3d_mkbound(sfin,pfin1,pfin2,tolapp3d,2.e-4);
GeomFill_ConstrainedFilling fil(11,20);
if(c1pointu) fil.Init(Bpiv,Bfin,Bdeb,1);
@@ -712,7 +712,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pf1,pp1,Pf2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeFirstPCurve(),P1deb,P2deb,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv1(C3d,tolreached);
Icf = DStr.AddCurve(Tcurv1);
regdeb.SetCurve(Icf);
@@ -732,7 +732,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
ChFi3d_ComputeArete(Pl1,pp1,Pl2,pp2,
DStr.Surface(coin->Surf()).Surface(),C3d,
corner->ChangeLastPCurve(),P1fin,P2fin,
tolesp,tol2d,tolreached,0);
tolapp3d,tol2d,tolreached,0);
TopOpeBRepDS_Curve Tcurv2(C3d,tolreached);
Icl = DStr.AddCurve(Tcurv2);
regfin.SetCurve(Icl);
@@ -770,7 +770,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolrdeb;
ChFi3d_ComputePCurv(crefdeb,pp1,pp2,CD[deb]->ChangePCurve(isfirst),
DStr.Surface(fddeb->Surf()).Surface(),
P1deb,P2deb,tolesp,tolrdeb,rev);
P1deb,P2deb,tolapp3d,tolrdeb,rev);
tcdeb.Tolerance(Max(tolrdeb,tcdeb.Tolerance()));
if(rev) ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf2,*pbf1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[deb],fddeb,*pbf1,*pbf2,isfirst);
@@ -800,7 +800,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolrfin;
ChFi3d_ComputePCurv(creffin,pp1,pp2,CD[fin]->ChangePCurve(isfirst),
DStr.Surface(fdfin->Surf()).Surface(),
P1fin,P2fin,tolesp,tolrfin,rev);
P1fin,P2fin,tolapp3d,tolrfin,rev);
tcfin.Tolerance(Max(tolrfin,tcfin.Tolerance()));
if(rev) ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl2,*pbl1,isfirst);
else ChFi3d_EnlargeBox(DStr,CD[fin],fdfin,*pbl1,*pbl2,isfirst);
@@ -823,7 +823,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
Standard_Real tolr;
ChFi3d_SameParameter(Ccoinpiv,C2dOnPiv,Spiv,
fi.FirstParameter(),fi.LastParameter(),
tolesp,tolr);
tolapp3d,tolr);
TCcoinpiv.Tolerance(Max(TCcoinpiv.Tolerance(),tolr));
CD[pivot]->ChangePCurve(isfirst) = C2dOnPiv;
CD[pivot]->SetIndexPoint(If2,isfirst,isurf1);

View File

@@ -558,6 +558,17 @@ void ChFiDS_Spine::Load()
}
indexofcurve =1;
myCurve.Initialize(TopoDS::Edge(spine.Value(1)));
// Here, we should update tolesp according to curve parameter range
// if tolesp candidate less than default initial value.
const Standard_Real umin = FirstParameter();
const Standard_Real umax = LastParameter();
Standard_Real new_tolesp = 5.0e-5 * (umax - umin);
if (tolesp > new_tolesp)
{
tolesp = new_tolesp;
}
}

View File

@@ -244,6 +244,9 @@ public:
//! Return the mode of chamfers used
Standard_EXPORT ChFiDS_ChamfMode Mode() const;
//! Return tolesp parameter
Standard_EXPORT Standard_Real GetTolesp() const;
DEFINE_STANDARD_RTTIEXT(ChFiDS_Spine,Standard_Transient)

View File

@@ -214,3 +214,12 @@ inline ChFiDS_ChamfMode ChFiDS_Spine::Mode() const
return myMode;
}
//=======================================================================
//function : GetTolesp
//purpose :
//=======================================================================
inline Standard_Real ChFiDS_Spine::GetTolesp() const
{
return tolesp;
}

View File

@@ -88,8 +88,11 @@ bool DE_ConfigurationNode::Save(const TCollection_AsciiString& theResourcePath)
// function : UpdateLoad
// purpose :
//=======================================================================
bool DE_ConfigurationNode::UpdateLoad()
bool DE_ConfigurationNode::UpdateLoad(const Standard_Boolean theToImport,
const Standard_Boolean theToKeep)
{
(void)theToImport;
(void)theToKeep;
return true;
}

View File

@@ -85,9 +85,12 @@ public:
//! @return new object with the same field values
Standard_EXPORT virtual Handle(DE_ConfigurationNode) Copy() const = 0;
//! Update loading status. Checking for the license.
//! Update loading status. Checking for the ability to read and write.
//! @param[in] theToImport flag to updates for import. Standard_True-import, Standard_False-export
//! @param[in] theToKeep flag to save update result
//! @return Standard_True, if node can be used
Standard_EXPORT virtual bool UpdateLoad();
Standard_EXPORT virtual bool UpdateLoad(const Standard_Boolean theToImport,
const Standard_Boolean theToKeep);
public:

View File

@@ -34,6 +34,9 @@ namespace
static const TCollection_AsciiString aScope ("global");
return aScope;
}
//! Global configuration of current DE Session
static Handle(DE_Wrapper) THE_GLOBAL_CONFIGURATION;
}
//=======================================================================
@@ -41,6 +44,7 @@ namespace
// purpose :
//=======================================================================
DE_Wrapper::DE_Wrapper()
:myKeepUpdates(Standard_False)
{}
//=======================================================================
@@ -64,6 +68,7 @@ DE_Wrapper::DE_Wrapper(const Handle(DE_Wrapper)& theWrapper)
Bind(aVendorIter.Value());
}
}
theWrapper->myKeepUpdates = myKeepUpdates;
}
//=======================================================================
@@ -72,8 +77,23 @@ DE_Wrapper::DE_Wrapper(const Handle(DE_Wrapper)& theWrapper)
//=======================================================================
Handle(DE_Wrapper) DE_Wrapper::GlobalWrapper()
{
static const Handle(DE_Wrapper)& aConfiguration = new DE_Wrapper();
return aConfiguration;
if (THE_GLOBAL_CONFIGURATION.IsNull())
{
THE_GLOBAL_CONFIGURATION = new DE_Wrapper();
}
return THE_GLOBAL_CONFIGURATION;
}
//=======================================================================
// function : SetGlobalWrapper
// purpose :
//=======================================================================
void DE_Wrapper::SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper)
{
if (!theWrapper.IsNull())
{
THE_GLOBAL_CONFIGURATION = theWrapper;
}
}
//=======================================================================
@@ -81,7 +101,7 @@ Handle(DE_Wrapper) DE_Wrapper::GlobalWrapper()
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
Handle(TDocStd_Document)& theDocument,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress)
{
@@ -94,7 +114,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Read(thePath, theDocument, theProgress);
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_True, aProvider))
if (!FindProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -119,7 +139,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Write(thePath, theDocument, theProgress);
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_False, aProvider))
if (!FindProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -131,7 +151,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
Handle(TDocStd_Document)& theDocument,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress)
{
if (theDocument.IsNull())
@@ -139,7 +159,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Standard_False;
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_True, aProvider))
if (!FindProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -159,7 +179,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Standard_False;
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_False, aProvider))
if (!FindProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -180,7 +200,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
return Read(thePath, theShape, theProgress);
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_True, aProvider))
if (!FindProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -201,7 +221,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
return Write(thePath, theShape, theProgress);
}
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_False, aProvider))
if (!FindProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -218,7 +238,7 @@ Standard_Boolean DE_Wrapper::Read(const TCollection_AsciiString& thePath,
{
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_True, aProvider))
if (!FindProvider(thePath, Standard_True, aProvider))
{
return Standard_False;
}
@@ -234,7 +254,7 @@ Standard_Boolean DE_Wrapper::Write(const TCollection_AsciiString& thePath,
const Message_ProgressRange& theProgress)
{
Handle(DE_Provider) aProvider;
if (!findProvider(thePath, Standard_False, aProvider))
if (!FindProvider(thePath, Standard_False, aProvider))
{
return Standard_False;
}
@@ -427,7 +447,6 @@ void DE_Wrapper::ChangePriority(const TCollection_AsciiString& theFormat,
if (aVendorMap.FindFromKey(aVendorName, aNode))
{
aNode->SetEnabled(Standard_True);
aNode->UpdateLoad();
aNewVendorMap.Add(aVendorName, aNode);
}
}
@@ -482,10 +501,10 @@ Handle(DE_Wrapper) DE_Wrapper::Copy() const
}
//=======================================================================
// function : findProvider
// function : FindProvider
// purpose :
//=======================================================================
Standard_Boolean DE_Wrapper::findProvider(const TCollection_AsciiString& thePath,
Standard_Boolean DE_Wrapper::FindProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const
{
@@ -514,7 +533,8 @@ Standard_Boolean DE_Wrapper::findProvider(const TCollection_AsciiString& thePath
((theToImport && aNode->IsImportSupported()) ||
(!theToImport && aNode->IsExportSupported())) &&
(aNode->CheckExtension(anExtr) ||
(theToImport && aNode->CheckContent(aBuffer))))
(theToImport && aNode->CheckContent(aBuffer))) &&
aNode->UpdateLoad(theToImport, myKeepUpdates))
{
theProvider = aNode->BuildProvider();
aNode->GlobalParameters = GlobalParameters;
@@ -526,6 +546,28 @@ Standard_Boolean DE_Wrapper::findProvider(const TCollection_AsciiString& thePath
return Standard_False;
}
//=======================================================================
// function : UpdateLoad
// purpose :
//=======================================================================
Standard_EXPORT void DE_Wrapper::UpdateLoad(const Standard_Boolean theToForceUpdate) const
{
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
aFormatIter.More(); aFormatIter.Next())
{
for (DE_ConfigurationVendorMap::Iterator aVendorIter(aFormatIter.Value());
aVendorIter.More(); aVendorIter.Next())
{
const Handle(DE_ConfigurationNode)& aNode = aVendorIter.Value();
aNode->UpdateLoad(Standard_True, Standard_True);
aNode->UpdateLoad(Standard_False, Standard_True);
if (!theToForceUpdate)
continue;
aNode->SetEnabled(aNode->IsExportSupported() || aNode->IsImportSupported());
}
}
}
//=======================================================================
// function : sort
// purpose :

View File

@@ -61,10 +61,15 @@ public:
//! @param[in] theWrapper object to copy
Standard_EXPORT DE_Wrapper(const Handle(DE_Wrapper)& theWrapper);
//! Gets global configuration singleton
//! Gets global configuration singleton.
//! If wrapper is not set, create it by default as base class object.
//! @return point to global configuration
Standard_EXPORT static Handle(DE_Wrapper) GlobalWrapper();
//! Sets global configuration singleton
//! @param[in] theWrapper object to set as global configuration
Standard_EXPORT static void SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper);
public:
//! Reads a CAD file, according internal configuration
@@ -74,7 +79,7 @@ public:
//! @param theProgress[in] progress indicator
//! @return true if Read operation has ended correctly
Standard_EXPORT Standard_Boolean Read(const TCollection_AsciiString& thePath,
Handle(TDocStd_Document)& theDocument,
const Handle(TDocStd_Document)& theDocument,
Handle(XSControl_WorkSession)& theWS,
const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -95,7 +100,7 @@ public:
//! @param theProgress[in] progress indicator
//! @return true if Read operation has ended correctly
Standard_EXPORT Standard_Boolean Read(const TCollection_AsciiString& thePath,
Handle(TDocStd_Document)& theDocument,
const Handle(TDocStd_Document)& theDocument,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Writes a CAD file, according internal configuration
@@ -211,13 +216,33 @@ public:
Standard_EXPORT void ChangePriority(const TColStd_ListOfAsciiString& theVendorPriority,
const Standard_Boolean theToDisable = Standard_False);
//! Find available provider from the configuration.
//! If there are several providers, choose the one with the highest priority.
//! @param[in] thePath path to the CAD file
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
//! @param[out] theProvider created new provider
//! @return Standard_True if provider found and created
Standard_EXPORT virtual Standard_Boolean FindProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const;
//! Updates all registered nodes, all changes will be saved in nodes
//! @param[in] theToForceUpdate flag that turns on/of nodes, according to updated ability to import/export
Standard_EXPORT void UpdateLoad(const Standard_Boolean theToForceUpdate = Standard_False) const;
//! Gets flag that keeps changes on configuration nodes which are being updated, false by default
Standard_Boolean KeepUpdates() const { return myKeepUpdates; }
//! Sets flag that keeps changes on configuration nodes which are being updated, false by default
void SetKeepUpdates(const Standard_Boolean theToKeepUpdates) { myKeepUpdates = theToKeepUpdates; }
//! Gets format map, contains vendor map with nodes
//! @return internal map of formats
Standard_EXPORT const DE_ConfigurationFormatMap& Nodes() const;
//! Copies values of all fields
//! @return new object with the same field values
Standard_EXPORT Handle(DE_Wrapper) Copy() const;
Standard_EXPORT virtual Handle(DE_Wrapper) Copy() const;
protected:
@@ -227,22 +252,13 @@ protected:
//! @param[in] theResource resource to get priority
void sort(const Handle(DE_ConfigurationContext)& theResource);
//! Find available provider from the configuration.
//! If there are several providers, choose the one with the highest priority.
//! @param[in] thePath path to the CAD file
//! @param[in] theToImport flag to finds for import. Standard_True-import, Standard_False-export
//! @param[out] theProvider created new provider
//! @return Standard_True if provider found and created
Standard_Boolean findProvider(const TCollection_AsciiString& thePath,
const Standard_Boolean theToImport,
Handle(DE_Provider)& theProvider) const;
public:
DE_ConfigurationNode::DE_SectionGlobal GlobalParameters; //!< Internal parameters for the all translators
private:
Standard_Boolean myKeepUpdates; //!< Flag that keeps changes on configuration nodes which are being updated
DE_ConfigurationFormatMap myConfiguration; //!< Internal map of formats
};

View File

@@ -34,9 +34,7 @@ namespace
//=======================================================================
DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : DEBRepCascade_ConfigurationNode
@@ -46,7 +44,6 @@ DEBRepCascade_ConfigurationNode::DEBRepCascade_ConfigurationNode(const Handle(DE
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -34,9 +34,7 @@ namespace
//=======================================================================
DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : DEXCAFCascade_ConfigurationNode
@@ -46,7 +44,6 @@ DEXCAFCascade_ConfigurationNode::DEXCAFCascade_ConfigurationNode(const Handle(DE
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -1,2 +1,3 @@
TKernel
TKExpress
CSF_wsock32

View File

@@ -345,19 +345,19 @@ Standard_Boolean
if(!done) return Standard_False;
if(lin->StartPointOnFirst().NbPointOnRst() !=0){
ChFi3d_FilCommonPoint(lin->StartPointOnFirst(),lin->TransitionOnS1(),
Standard_True, Data->ChangeVertexFirstOnS1(), tolesp);
Standard_True, Data->ChangeVertexFirstOnS1(), tolapp3d);
}
if(lin->EndPointOnFirst().NbPointOnRst() !=0){
ChFi3d_FilCommonPoint(lin->EndPointOnFirst(),lin->TransitionOnS1(),
Standard_False,Data->ChangeVertexLastOnS1(), tolesp);
Standard_False,Data->ChangeVertexLastOnS1(), tolapp3d);
}
if(lin->StartPointOnSecond().NbPointOnRst() !=0){
ChFi3d_FilCommonPoint(lin->StartPointOnSecond(),lin->TransitionOnS2(),
Standard_True, Data->ChangeVertexFirstOnS2(), tolesp);
Standard_True, Data->ChangeVertexFirstOnS2(), tolapp3d);
}
if(lin->EndPointOnSecond().NbPointOnRst() !=0){
ChFi3d_FilCommonPoint(lin->EndPointOnSecond(),lin->TransitionOnS2(),
Standard_False, Data->ChangeVertexLastOnS2(), tolesp);
Standard_False, Data->ChangeVertexLastOnS2(), tolapp3d);
}
done = CompleteData(Data,Func,lin,S1,S2,Or,0,0,0,0);
if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
@@ -554,7 +554,7 @@ Standard_Real FilletSurf_InternalBuilder::FirstParameter() const
Standard_Integer ind = 1;
if(sp->IsPeriodic()) ind = sp->Index(p);
Standard_Real ep;
if(ComputeEdgeParameter(sp,ind,p,ep,tolesp)) return ep;
if(ComputeEdgeParameter(sp,ind,p,ep,tolapp3d)) return ep;
return 0.0;
}
//=======================================================================
@@ -570,7 +570,7 @@ Standard_Real FilletSurf_InternalBuilder::LastParameter() const
Standard_Integer ind = sp->NbEdges();
if(sp->IsPeriodic()) ind = sp->Index(p);
Standard_Real ep;
if(ComputeEdgeParameter(sp,ind,p,ep,tolesp)) return ep;
if(ComputeEdgeParameter(sp,ind,p,ep,tolapp3d)) return ep;
return 0.0;
}

View File

@@ -90,12 +90,18 @@ public:
Standard_EXPORT void TolFixTangents (Standard_Real& aTolCheck, Standard_Real& aTolAngCheck);
//! Set angular tolerance
Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
//! converts RLine to Geom(2d)_Curve.
Standard_EXPORT static void TreatRLine (const Handle(IntPatch_RLine)& theRL, const Handle(GeomAdaptor_Surface)& theHS1, const Handle(GeomAdaptor_Surface)& theHS2, Handle(Geom_Curve)& theC3d, Handle(Geom2d_Curve)& theC2d1, Handle(Geom2d_Curve)& theC2d2, Standard_Real& theTolReached);
//! creates 2D-curve on given surface from given 3D-curve
Standard_EXPORT static void BuildPCurves (const Standard_Real theFirst, const Standard_Real theLast,
const Standard_Real theUmin, const Standard_Real theUmax,
const Standard_Real theVmin, const Standard_Real theVmax,
Standard_Real& theTol,
const Handle(Geom_Surface)& theSurface,
const Handle(Geom_Curve)& theCurve,
Handle(Geom2d_Curve)& theCurve2d);
//! creates 2D-curve on given surface from given 3D-curve
Standard_EXPORT static void BuildPCurves (const Standard_Real f, const Standard_Real l, Standard_Real& Tol, const Handle(Geom_Surface)& S, const Handle(Geom_Curve)& C, Handle(Geom2d_Curve)& C2d);

View File

@@ -146,12 +146,3 @@ inline GeomInt_IntSS::GeomInt_IntSS ()
{
return myIntersector.Point(Index).Value();
}
//=======================================================================
//function : SetAngularTolerance
//purpose :
//=======================================================================
inline void GeomInt_IntSS::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myIntersector.SetAngularTolerance(theAngularTolerance);
}

View File

@@ -1074,94 +1074,92 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL,
//function : BuildPCurves
//purpose :
//=======================================================================
void GeomInt_IntSS::BuildPCurves (Standard_Real f,
Standard_Real l,
Standard_Real& Tol,
const Handle (Geom_Surface)& S,
const Handle (Geom_Curve)& C,
Handle (Geom2d_Curve)& C2d)
void GeomInt_IntSS::BuildPCurves (const Standard_Real theFirst, const Standard_Real theLast,
const Standard_Real theUmin, const Standard_Real theUmax,
const Standard_Real theVmin, const Standard_Real theVmax,
Standard_Real& theTol,
const Handle(Geom_Surface)& theSurface,
const Handle(Geom_Curve)& theCurve,
Handle(Geom2d_Curve)& theCurve2d)
{
if (!C2d.IsNull()) {
if (!theCurve2d.IsNull() || theSurface.IsNull()) {
return;
}
//
Standard_Real umin,umax,vmin,vmax;
//
S->Bounds(umin, umax, vmin, vmax);
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
if((l - f) > 2.e-09) {
C2d = GeomProjLib::Curve2d(C,f,l,S,umin,umax,vmin,vmax,Tol);
if (C2d.IsNull()) {
if ((theLast - theFirst) > 2.e-09) {
theCurve2d = GeomProjLib::Curve2d(theCurve, theFirst, theLast, theSurface, theUmin, theUmax, theVmin, theVmax, theTol);
if (theCurve2d.IsNull()) {
// proj. a circle that goes through the pole on a sphere to the sphere
Tol += Precision::Confusion();
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
theTol += Precision::Confusion();
theCurve2d = GeomProjLib::Curve2d(theCurve, theFirst, theLast, theSurface, theTol);
}
const Handle(Standard_Type)& aType = C2d->DynamicType();
if ( aType == STANDARD_TYPE(Geom2d_BSplineCurve))
{
const Handle(Standard_Type)& aType = theCurve2d->DynamicType();
if (aType == STANDARD_TYPE(Geom2d_BSplineCurve))
{
//Check first, last knots to avoid problems with trimming
//First, last knots can differ from f, l because of numerical error
//of projection and approximation
//The same checking as in Geom2d_TrimmedCurve
if((C2d->FirstParameter() - f > Precision::PConfusion()) ||
(l - C2d->LastParameter() > Precision::PConfusion()))
if ((theCurve2d->FirstParameter() - theFirst > Precision::PConfusion()) ||
(theLast - theCurve2d->LastParameter() > Precision::PConfusion()))
{
Handle(Geom2d_BSplineCurve) aBspl = Handle(Geom2d_BSplineCurve)::DownCast(C2d);
Handle(Geom2d_BSplineCurve) aBspl = Handle(Geom2d_BSplineCurve)::DownCast(theCurve2d);
TColStd_Array1OfReal aKnots(1, aBspl->NbKnots());
aBspl->Knots(aKnots);
BSplCLib::Reparametrize(f, l, aKnots);
BSplCLib::Reparametrize(theFirst, theLast, aKnots);
aBspl->SetKnots(aKnots);
}
}
}
else {
if((l - f) > Epsilon(Abs(f)))
if ((theLast - theFirst) > Epsilon(Abs(theFirst)))
{
//The domain of C2d is [Epsilon(Abs(f)), 2.e-09]
//On this small range C2d can be considered as segment
//of line.
Standard_Real aU=0., aV=0.;
Standard_Real aU = 0., aV = 0.;
GeomAdaptor_Surface anAS;
anAS.Load(S);
anAS.Load(theSurface);
Extrema_ExtPS anExtr;
const gp_Pnt aP3d1 = C->Value(f);
const gp_Pnt aP3d2 = C->Value(l);
const gp_Pnt aP3d1 = theCurve->Value(theFirst);
const gp_Pnt aP3d2 = theCurve->Value(theLast);
anExtr.SetAlgo(Extrema_ExtAlgo_Grad);
anExtr.Initialize(anAS, umin, umax, vmin, vmax,
Precision::Confusion(), Precision::Confusion());
anExtr.Initialize(anAS, theUmin, theUmax, theVmin, theVmax,
Precision::Confusion(), Precision::Confusion());
anExtr.Perform(aP3d1);
if(ParametersOfNearestPointOnSurface(anExtr, aU, aV))
if (ParametersOfNearestPointOnSurface(anExtr, aU, aV))
{
const gp_Pnt2d aP2d1(aU, aV);
anExtr.Perform(aP3d2);
if(ParametersOfNearestPointOnSurface(anExtr, aU, aV))
if (ParametersOfNearestPointOnSurface(anExtr, aU, aV))
{
const gp_Pnt2d aP2d2(aU, aV);
if(aP2d1.Distance(aP2d2) > gp::Resolution())
if (aP2d1.Distance(aP2d2) > gp::Resolution())
{
TColgp_Array1OfPnt2d poles(1,2);
TColStd_Array1OfReal knots(1,2);
TColStd_Array1OfInteger mults(1,2);
TColgp_Array1OfPnt2d poles(1, 2);
TColStd_Array1OfReal knots(1, 2);
TColStd_Array1OfInteger mults(1, 2);
poles(1) = aP2d1;
poles(2) = aP2d2;
knots(1) = f;
knots(2) = l;
knots(1) = theFirst;
knots(2) = theLast;
mults(1) = mults(2) = 2;
C2d = new Geom2d_BSplineCurve(poles,knots,mults,1);
theCurve2d = new Geom2d_BSplineCurve(poles, knots, mults, 1);
//Check same parameter in middle point .begin
const gp_Pnt PMid(C->Value(0.5*(f+l)));
const gp_Pnt PMid(theCurve->Value(0.5*(theFirst + theLast)));
const gp_Pnt2d pmidcurve2d(0.5*(aP2d1.XY() + aP2d2.XY()));
const gp_Pnt aPC(anAS.Value(pmidcurve2d.X(), pmidcurve2d.Y()));
const Standard_Real aDist = PMid.Distance(aPC);
Tol = Max(aDist, Tol);
theTol = Max(aDist, theTol);
//Check same parameter in middle point .end
}
}
@@ -1169,27 +1167,51 @@ void GeomInt_IntSS::BuildPCurves (Standard_Real f,
}
}
//
if (S->IsUPeriodic() && !C2d.IsNull()) {
if (theSurface->IsUPeriodic() && !theCurve2d.IsNull()) {
// Recadre dans le domaine UV de la face
Standard_Real aTm, U0, aEps, period, du, U0x;
Standard_Boolean bAdjust;
//
aEps = Precision::PConfusion();
period = S->UPeriod();
period = theSurface->UPeriod();
//
aTm = .5*(f + l);
gp_Pnt2d pm = C2d->Value(aTm);
aTm = .5 * (theFirst + theLast);
gp_Pnt2d pm = theCurve2d->Value(aTm);
U0 = pm.X();
//
bAdjust =
GeomInt::AdjustPeriodic(U0, umin, umax, period, U0x, du, aEps);
bAdjust =
GeomInt::AdjustPeriodic(U0, theUmin, theUmax, period, U0x, du, aEps);
if (bAdjust) {
gp_Vec2d T1(du, 0.);
C2d->Translate(T1);
theCurve2d->Translate(T1);
}
}
}
//=======================================================================
//function : BuildPCurves
//purpose :
//=======================================================================
void GeomInt_IntSS::BuildPCurves (const Standard_Real f,
const Standard_Real l,
Standard_Real& Tol,
const Handle (Geom_Surface)& S,
const Handle (Geom_Curve)& C,
Handle (Geom2d_Curve)& C2d)
{
if (!C2d.IsNull() || S.IsNull()) {
return;
}
//
Standard_Real umin,umax,vmin,vmax;
//
S->Bounds(umin, umax, vmin, vmax);
BuildPCurves(f, l, umin, umax, vmin, vmax, Tol, S, C, C2d);
}
//=======================================================================
//function : TrimILineOnSurfBoundaries
//purpose : This function finds intersection points of given curves with

View File

@@ -34,9 +34,7 @@ namespace
//=======================================================================
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : IGESCAFControl_ConfigurationNode
@@ -46,7 +44,6 @@ IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode(const Handle(
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -50,11 +50,21 @@
#include <Standard_DomainError.hxx>
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
#include <gce_MakePln.hxx>
#include <ProjLib.hxx>
#include <IntAna2d_AnaIntersection.hxx>
#include <IntAna2d_IntPoint.hxx>
#ifdef DEBUGLINES
#include <Geom2d_Line.hxx>
#endif
static
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);
static
void RefineDir(gp_Dir& aDir);
static
Standard_Real EstimDist(const gp_Cone& theCon1, const gp_Cone& theCon2);
//=======================================================================
//class : AxeOperator
@@ -249,58 +259,95 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D)
return(gp_Ax2(P,D,gp_Dir(gp_Vec(-y,x,0.0))));
}
}
//=======================================================================
//function : EstimDist
//purpose : returns a minimal distance from apex to any solution
//=======================================================================
Standard_Real EstimDist(const gp_Cone& theCon1, const gp_Cone& theCon2)
{
//It is supposed that axes of cones are coplanar and
//distance between them > Precision::Confusion()
gp_Pnt aPA1 = theCon1.Apex(), aPA2 = theCon2.Apex();
gp_Pnt aP3 = aPA1.Translated(theCon1.Position().Direction());
gce_MakePln aMkPln(aPA1, aPA2, aP3);
if(!aMkPln.IsDone())
return Precision::Infinite();
const gp_Pln& aPln = aMkPln.Value();
gp_Lin anAx1(aPA1, theCon1.Position().Direction());
gp_Lin2d anAx12d = ProjLib::Project(aPln, anAx1);
gp_Lin2d Lines1[2];
Standard_Real anAng1 = theCon1.SemiAngle();
Lines1[0] = anAx12d.Rotated(anAx12d.Location(), anAng1);
Lines1[1] = anAx12d.Rotated(anAx12d.Location(), -anAng1);
//
gp_Lin anAx2(aPA2, theCon2.Position().Direction());
gp_Lin2d anAx22d = ProjLib::Project(aPln, anAx2);
gp_Lin2d Lines2[2];
Standard_Real anAng2 = theCon2.SemiAngle();
Lines2[0] = anAx22d.Rotated(anAx22d.Location(), anAng2);
Lines2[1] = anAx22d.Rotated(anAx22d.Location(), -anAng2);
#ifdef DEBUGLINES
Handle(Geom2d_Line) L10 = new Geom2d_Line(Lines1[0]);
Handle(Geom2d_Line) L11 = new Geom2d_Line(Lines1[1]);
Handle(Geom2d_Line) L20 = new Geom2d_Line(Lines2[0]);
Handle(Geom2d_Line) L21 = new Geom2d_Line(Lines2[1]);
#endif
Standard_Real aMinDist[2] = { Precision::Infinite(), Precision::Infinite() };
Standard_Integer i, j, k;
IntAna2d_AnaIntersection anInter;
for (i = 0; i < 2; ++i)
{
for (j = 0; j < 2; ++j)
{
anInter.Perform(Lines1[i], Lines2[j]);
if (anInter.IsDone())
{
Standard_Integer aNbPoints = anInter.NbPoints();
for (k = 1; k <= aNbPoints; ++k)
{
const IntAna2d_IntPoint& anIntP = anInter.Point(k);
Standard_Real aPar1 = Abs(anIntP.ParamOnFirst());
aMinDist[0] = Min(aPar1, aMinDist[0]);
Standard_Real aPar2 = Abs(anIntP.ParamOnSecond());
aMinDist[1] = Min(aPar2, aMinDist[1]);
}
}
}
}
Standard_Real aDist = Max(aMinDist[0], aMinDist[1]);
return aDist;
}
//=======================================================================
//function : IntAna_QuadQuadGeo
//purpose : Empty constructor
//=======================================================================
IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(void)
: done(Standard_False),
nbint(0),
typeres(IntAna_Empty),
pt1(0,0,0),
pt2(0,0,0),
pt3(0,0,0),
pt4(0,0,0),
param1(0),
param2(0),
param3(0),
param4(0),
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
: done(Standard_False),
nbint(0),
typeres(IntAna_Empty),
pt1(0,0,0),
pt2(0,0,0),
pt3(0,0,0),
pt4(0,0,0),
param1(0),
param2(0),
param3(0),
param4(0),
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0)
{
InitTolerances();
}
//=======================================================================
//function : IntAna_QuadQuadGeo
//purpose : Constructor with angular tolerance
//=======================================================================
IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance)
: done(Standard_False),
nbint(0),
typeres(IntAna_Empty),
pt1(0,0,0),
pt2(0,0,0),
pt3(0,0,0),
pt4(0,0,0),
param1(0),
param2(0),
param3(0),
param4(0),
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(theAngularTolerance),
myUseAngularTolerance(theUseAngularTolerance)
{
InitTolerances();
}
//=======================================================================
//function : InitTolerances
//purpose :
@@ -308,20 +355,12 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standa
void IntAna_QuadQuadGeo::InitTolerances()
{
myEPSILON_DISTANCE = 1.0e-14;
if (myUseAngularTolerance)
{
myEPSILON_ANGLE_CONE = myAngularTolerance;
}
else
{
myEPSILON_ANGLE_CONE = Precision::Angular();
}
myEPSILON_ANGLE_CONE = Precision::Angular();
myEPSILON_MINI_CIRCLE_RADIUS = 0.01*Precision::Confusion();
myEPSILON_CYLINDER_DELTA_RADIUS = 1.0e-13;
myEPSILON_CYLINDER_DELTA_DISTANCE= Precision::Confusion();
myEPSILON_AXES_PARA = Precision::Angular();
}
//=======================================================================
//function : IntAna_QuadQuadGeo
//purpose : Pln Pln
@@ -344,9 +383,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& P1,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(P1,P2,TolAng,Tol);
@@ -691,9 +728,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo( const gp_Pln& P
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(P,Co,Tolang,Tol);
@@ -909,9 +944,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& P,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(P,S);
@@ -980,9 +1013,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl1,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Cyl1,Cyl2,Tol);
@@ -1267,9 +1298,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Cyl,Con,Tol);
@@ -1325,9 +1354,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Cyl,Sph,Tol);
@@ -1393,9 +1420,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Con1,Con2,Tol);
@@ -1407,30 +1432,49 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
//=======================================================================
void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1,
const gp_Cone& Con2,
const Standard_Real Tol)
const Standard_Real Tol)
{
done=Standard_True;
done = Standard_True;
//
Standard_Real tg1, tg2, aDA1A2, aTol2;
gp_Pnt aPApex1, aPApex2;
Standard_Real TOL_APEX_CONF = 1.e-10;
//
tg1=Tan(Con1.SemiAngle());
tg2=Tan(Con2.SemiAngle());
if((tg1 * tg2) < 0.) {
//
tg1 = Tan(Con1.SemiAngle());
tg2 = Tan(Con2.SemiAngle());
if ((tg1 * tg2) < 0.) {
tg2 = -tg2;
}
//
aTol2=Tol*Tol;
aPApex1=Con1.Apex();
aPApex2=Con2.Apex();
aDA1A2=aPApex1.SquareDistance(aPApex2);
aTol2 = Tol*Tol;
aPApex1 = Con1.Apex();
aPApex2 = Con2.Apex();
aDA1A2 = aPApex1.SquareDistance(aPApex2);
//
AxeOperator A1A2(Con1.Axis(),Con2.Axis());
AxeOperator A1A2(Con1.Axis(), Con2.Axis());
//
Standard_Real aTolAng = myEPSILON_ANGLE_CONE;
if ((Abs(tg1 - tg2) < Tol) && (A1A2.Parallel()))
{
Standard_Real DistA1A2 = A1A2.Distance();
if (DistA1A2 > 100. * Tol)
{
Standard_Real aMinSolDist = EstimDist(Con1, Con2);
if (aMinSolDist < Epsilon(1.))
{
aTolAng = Tol;
}
else
{
aTolAng = Max(myEPSILON_ANGLE_CONE, Tol / aMinSolDist);
aTolAng = Min(aTolAng, Tol);
}
}
}
// 1
if(A1A2.Same()) {
//-- two circles
@@ -1478,8 +1522,8 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
}
} //-- fin A1A2.Same
// 2
else if((Abs(tg1-tg2)<myEPSILON_ANGLE_CONE) && (A1A2.Parallel())) {
//-- voir AnVer12mai98
else if((Abs(tg1-tg2) < aTolAng ) && (A1A2.Parallel())) {
Standard_Real DistA1A2=A1A2.Distance();
gp_Dir DA1=Con1.Position().Direction();
gp_Vec O1O2(Con1.Apex(),Con2.Apex());
@@ -1851,9 +1895,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Sph,Con,Tol);
@@ -1965,9 +2007,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Sph1,Sph2,Tol);
@@ -2081,9 +2121,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Pln& Pln,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Pln,Tor,Tol);
@@ -2195,9 +2233,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cylinder& Cyl,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Cyl,Tor,Tol);
@@ -2280,9 +2316,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Cone& Con,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Con,Tor,Tol);
@@ -2420,9 +2454,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Sphere& Sph,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Sph,Tor,Tol);
@@ -2519,9 +2551,7 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(const gp_Torus& Tor1,
param1bis(0),
param2bis(0),
myCommonGen(Standard_False),
myPChar(0,0,0),
myAngularTolerance(0.0),
myUseAngularTolerance(Standard_False)
myPChar(0,0,0)
{
InitTolerances();
Perform(Tor1,Tor2,Tol);
@@ -2757,7 +2787,6 @@ const gp_Pnt& IntAna_QuadQuadGeo::PChar() const
{
return myPChar;
}
//=======================================================================
//function : RefineDir
//purpose :

View File

@@ -61,9 +61,6 @@ public:
//! Empty constructor.
Standard_EXPORT IntAna_QuadQuadGeo();
//! Constructor with angular tolerance
Standard_EXPORT IntAna_QuadQuadGeo(Standard_Real theAngularTolerance, Standard_Boolean theUseAngularTolerance);
//! Creates the intersection between two planes.
//! TolAng is the angular tolerance used to determine
//! if the planes are parallel.
@@ -264,8 +261,7 @@ protected:
Standard_Real myEPSILON_AXES_PARA;
Standard_Boolean myCommonGen;
gp_Pnt myPChar;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
private:

View File

@@ -108,8 +108,8 @@ public:
//! An exception is raised if Index<=0 or Index>NbLine.
const Handle(IntPatch_Line)& Line (const Standard_Integer Index) const;
//! Sets the angular tolerance
void SetAngularTolerance (Standard_Real theAngularTolerance);
protected:
@@ -128,8 +128,7 @@ private:
IntPatch_SequenceOfPoint spnt;
IntPatch_SequenceOfLine slin;
IntPatch_TheSOnBounds solrst;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
};

View File

@@ -71,9 +71,3 @@ inline const Handle(IntPatch_Line)& IntPatch_ImpImpIntersection::Line (const Sta
if (!IsDone ()) { throw StdFail_NotDone(); }
return slin(Index);
}
inline void IntPatch_ImpImpIntersection::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myAngularTolerance = theAngularTolerance;
myUseAngularTolerance = Standard_True;
}

View File

@@ -125,9 +125,7 @@ static Standard_Boolean IntCoCo(const IntSurf_Quadric&,
Standard_Boolean&,
Standard_Boolean&,
IntPatch_SequenceOfLine&,
IntPatch_SequenceOfPoint&,
Standard_Boolean theUseAngularTolerance = Standard_False,
Standard_Real theAngularTolerance = 0.0);
IntPatch_SequenceOfPoint&);
//torus
static Standard_Boolean IntPTo(const IntSurf_Quadric&,

View File

@@ -29,8 +29,7 @@ IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection ():
myDone(IntStatus_Fail),
empt(Standard_True),
tgte(Standard_False),
oppo(Standard_False),
myUseAngularTolerance(Standard_False)
oppo(Standard_False)
{
}
//=======================================================================
@@ -232,7 +231,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_Surface)& S1,
}
//
case 33: { // Cone/Cone
if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt, myUseAngularTolerance, myAngularTolerance)) {
if (!IntCoCo(quad1, quad2, TolTang, empt, SameSurf, multpoint, slin, spnt)) {
return;
}
bEmpty = empt;

View File

@@ -27,9 +27,7 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Standard_Boolean& Same,
Standard_Boolean& Multpoint,
IntPatch_SequenceOfLine& slin,
IntPatch_SequenceOfPoint& spnt,
Standard_Boolean theUseAngularTolerance,
Standard_Real theAngularTolerance)
IntPatch_SequenceOfPoint& spnt)
{
Standard_Integer i, NbSol;
@@ -40,8 +38,7 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
gp_Cone Co1(Quad1.Cone());
gp_Cone Co2(Quad2.Cone());
//
IntAna_QuadQuadGeo inter(theAngularTolerance, theUseAngularTolerance);
inter.Perform(Co1,Co2,Tol);
IntAna_QuadQuadGeo inter(Co1,Co2,Tol);
if (!inter.IsDone()) {
return Standard_False;
}

View File

@@ -53,8 +53,7 @@ IntPatch_Intersection::IntPatch_Intersection ()
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
myV2Start(0.0),
myUseAngularTolerance(Standard_False)
myV2Start(0.0)
{
}
@@ -77,8 +76,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_Surface)& S
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
myV2Start(0.0),
myUseAngularTolerance(Standard_False)
myV2Start(0.0)
{
if(myTolArc<1e-8) myTolArc=1e-8;
if(myTolTang<1e-8) myTolTang=1e-8;
@@ -104,8 +102,7 @@ IntPatch_Intersection::IntPatch_Intersection(const Handle(Adaptor3d_Surface)& S
myU1Start(0.0),
myV1Start(0.0),
myU2Start(0.0),
myV2Start(0.0),
myUseAngularTolerance(Standard_False)
myV2Start(0.0)
{
Perform(S1,D1,TolArc,TolTang);
}
@@ -132,12 +129,6 @@ void IntPatch_Intersection::SetTolerances(const Standard_Real TolArc,
if(myUVMaxStep>0.5) myUVMaxStep=0.5;
}
void IntPatch_Intersection::SetAngularTolerance (Standard_Real theAngularTolerance)
{
myAngularTolerance = theAngularTolerance;
myUseAngularTolerance = Standard_True;
}
//======================================================================
// function: Perform
//======================================================================
@@ -1363,13 +1354,8 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_Surface)& theS
const GeomAbs_SurfaceType theTyps2,
const Standard_Boolean theIsReqToKeepRLine)
{
IntPatch_ImpImpIntersection interii;
if (myUseAngularTolerance)
{
interii.SetAngularTolerance(myAngularTolerance);
}
interii.Perform(theS1, theD1, theS2, theD2, myTolArc, myTolTang, theIsReqToKeepRLine);
IntPatch_ImpImpIntersection interii(theS1,theD1,theS2,theD2,
myTolArc,myTolTang, theIsReqToKeepRLine);
if (!interii.IsDone())
{

View File

@@ -62,8 +62,6 @@ public:
//! points in their respective parametric spaces.
Standard_EXPORT void SetTolerances (const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Real UVMaxStep, const Standard_Real Fleche);
Standard_EXPORT void SetAngularTolerance (Standard_Real theAngularTolerance);
//! Flag theIsReqToKeepRLine has been entered only for
//! compatibility with TopOpeBRep package. It shall be deleted
//! after deleting TopOpeBRep.
@@ -199,8 +197,7 @@ private:
Standard_Real myV1Start;
Standard_Real myU2Start;
Standard_Real myV2Start;
Standard_Real myAngularTolerance;
Standard_Boolean myUseAngularTolerance;
};

View File

@@ -990,15 +990,19 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
if (typl == IntPatch_Circle || typl == IntPatch_Ellipse) {////
if(myApprox1) {
Handle (Geom2d_Curve) C2d;
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
myHS1->Surface(), newc, C2d);
GeomInt_IntSS::BuildPCurves(fprm, lprm,
myHS1->FirstUParameter(), myHS1->LastUParameter(),
myHS1->FirstVParameter(), myHS1->LastVParameter(),
Tolpc, myHS1->Surface(), newc, C2d);
aCurve.SetFirstCurve2d(C2d);
}
if(myApprox2) {
Handle (Geom2d_Curve) C2d;
GeomInt_IntSS::BuildPCurves(fprm,lprm,Tolpc,
myHS2->Surface(),newc,C2d);
GeomInt_IntSS::BuildPCurves(fprm, lprm,
myHS2->FirstUParameter(), myHS2->LastUParameter(),
myHS2->FirstVParameter(), myHS2->LastVParameter(),
Tolpc, myHS2->Surface(), newc, C2d);
aCurve.SetSecondCurve2d(C2d);
}
}
@@ -1059,15 +1063,19 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
if(myApprox1) {
Handle (Geom2d_Curve) C2d;
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
myHS1->Surface(), newc, C2d);
GeomInt_IntSS::BuildPCurves(fprm, lprm,
myHS1->FirstUParameter(), myHS1->LastUParameter(),
myHS1->FirstVParameter(), myHS1->LastVParameter(),
Tolpc, myHS1->Surface(), newc, C2d);
aCurve.SetFirstCurve2d(C2d);
}
if(myApprox2) {
Handle (Geom2d_Curve) C2d;
GeomInt_IntSS::BuildPCurves(fprm, lprm, Tolpc,
myHS2->Surface(), newc, C2d);
GeomInt_IntSS::BuildPCurves(fprm, lprm,
myHS2->FirstUParameter(), myHS2->LastUParameter(),
myHS2->FirstVParameter(), myHS2->LastVParameter(),
Tolpc, myHS2->Surface(), newc, C2d);
aCurve.SetSecondCurve2d(C2d);
}
}// end of if (typl == IntPatch_Circle || typl == IntPatch_Ellipse)

View File

@@ -1864,6 +1864,7 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
//=======================================================================
TopoDS_Shape OCC1077_boolbl(BRepAlgoAPI_BooleanOperation& aBoolenaOperation,const Standard_Real aRadius)
{
Standard_Real tesp = 1.e-4;
Standard_Real t3d = 1.e-4;
Standard_Real t2d = 1.e-5;
Standard_Real ta = 1.e-2;
@@ -1885,7 +1886,7 @@ TopoDS_Shape OCC1077_boolbl(BRepAlgoAPI_BooleanOperation& aBoolenaOperation,cons
const TopoDS_Shape& cutsol = ex.Current();
BRepFilletAPI_MakeFillet fill(cutsol);
fill.SetParams(ta, t3d, t2d, t3d, t2d, fl);
fill.SetParams(ta, tesp, t2d, t3d, t2d, fl);
fill.SetContinuity(blend_cont, tapp_angle);
its = aBoolenaOperation.SectionEdges();
while (its.More())

View File

@@ -577,6 +577,7 @@ static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,cons
#include <Law_Interpol.hxx>
static Standard_Real tesp = 1.e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -606,7 +607,7 @@ static Standard_Integer MKEVOL(Draw_Interpretor& di,
if (narg < 3) return 1;
TopoDS_Shape V = DBRep::Get(a[2]);
Rake = new BRepFilletAPI_MakeFillet(V);
Rake->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rake->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rake->SetContinuity(blend_cont, tapp_angle);
if (narg == 4) {
ChFi3d_FilletShape FSh = ChFi3d_Rational;

View File

@@ -33,9 +33,7 @@ namespace
//=======================================================================
RWGltf_ConfigurationNode::RWGltf_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : RWGltf_ConfigurationNode
@@ -45,7 +43,6 @@ RWGltf_ConfigurationNode::RWGltf_ConfigurationNode(const Handle(RWGltf_Configura
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -33,9 +33,7 @@ namespace
//=======================================================================
RWObj_ConfigurationNode::RWObj_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : RWObj_ConfigurationNode
@@ -45,7 +43,6 @@ RWObj_ConfigurationNode::RWObj_ConfigurationNode(const Handle(RWObj_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -27,9 +27,7 @@ static const TCollection_AsciiString THE_CONFIGURATION_SCOPE = "provider";
//=======================================================================
RWPly_ConfigurationNode::RWPly_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : RWPly_ConfigurationNode
@@ -39,7 +37,6 @@ RWPly_ConfigurationNode::RWPly_ConfigurationNode(const Handle(RWPly_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -34,9 +34,7 @@ namespace
//=======================================================================
RWStl_ConfigurationNode::RWStl_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -46,7 +44,6 @@ RWStl_ConfigurationNode::RWStl_ConfigurationNode(const Handle(RWStl_Configuratio
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -34,9 +34,7 @@ namespace
//=======================================================================
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -45,9 +43,7 @@ STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
:DE_ConfigurationNode(theNode),
InternalParameters(theNode->InternalParameters)
{
UpdateLoad();
}
{}
//=======================================================================
// function : Load

View File

@@ -275,7 +275,8 @@ namespace
const gp_Pnt2d& theUVOrigin,
const gp_Pnt2d& theUVRepeat,
const gp_Pnt2d& theUVScale,
const bool theIsClosed)
const bool theIsClosed,
const Handle(Graphic3d_Group)& theGroup = NULL)
{
Handle(Graphic3d_ArrayOfTriangles) aPArray = fillTriangles (theShape, theHasTexels, theUVOrigin, theUVRepeat, theUVScale);
if (aPArray.IsNull())
@@ -283,7 +284,7 @@ namespace
return Standard_False;
}
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
Handle(Graphic3d_Group) aGroup = !theGroup.IsNull() ? theGroup : thePrs->NewGroup();
aGroup->SetClosed (theIsClosed);
aGroup->SetGroupPrimitivesAspect (theDrawer->ShadingAspect()->Aspect());
aGroup->AddPrimitiveArray (aPArray);
@@ -507,11 +508,12 @@ void StdPrs_ShadedShape::ExploreSolids (const TopoDS_Shape& theShape,
void StdPrs_ShadedShape::Add (const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
const StdPrs_Volume theVolume)
const StdPrs_Volume theVolume,
const Handle(Graphic3d_Group)& theGroup)
{
gp_Pnt2d aDummy;
StdPrs_ShadedShape::Add (thePrs, theShape, theDrawer,
Standard_False, aDummy, aDummy, aDummy, theVolume);
Standard_False, aDummy, aDummy, aDummy, theVolume, theGroup);
}
// =======================================================================
@@ -525,7 +527,8 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
const gp_Pnt2d& theUVOrigin,
const gp_Pnt2d& theUVRepeat,
const gp_Pnt2d& theUVScale,
const StdPrs_Volume theVolume)
const StdPrs_Volume theVolume,
const Handle(Graphic3d_Group)& theGroup)
{
if (theShape.IsNull())
{
@@ -563,13 +566,13 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
if (aClosed.NbChildren() > 0)
{
shadeFromShape (aClosed, thePrs, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, true);
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, true, theGroup);
}
if (anOpened.NbChildren() > 0)
{
shadeFromShape (anOpened, thePrs, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, false);
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, false, theGroup);
}
}
else
@@ -577,14 +580,14 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
// if the shape type is not compound, composolid or solid, use autodetection back-facing filled
shadeFromShape (theShape, thePrs, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale,
theVolume == StdPrs_Volume_Closed);
theVolume == StdPrs_Volume_Closed, theGroup);
}
if (theDrawer->FaceBoundaryDraw())
{
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = fillFaceBoundaries (theShape, theDrawer->FaceBoundaryUpperContinuity()))
{
Handle(Graphic3d_Group) aPrsGrp = thePrs->NewGroup();
Handle(Graphic3d_Group) aPrsGrp = !theGroup.IsNull() ? theGroup : thePrs->NewGroup();
aPrsGrp->SetGroupPrimitivesAspect (theDrawer->FaceBoundaryAspect()->Aspect());
aPrsGrp->AddPrimitiveArray (aBndSegments);
}

View File

@@ -36,13 +36,13 @@ public:
//! @param theVolumeType defines the way how to interpret input shapes - as Closed volumes (to activate back-face
//! culling and capping plane algorithms), as Open volumes (shells or solids with holes)
//! or to perform Autodetection (would split input shape into two groups)
Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection);
Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection, const Handle(Graphic3d_Group)& theGroup = NULL);
//! Shades <theShape> with texture coordinates.
//! @param theVolumeType defines the way how to interpret input shapes - as Closed volumes (to activate back-face
//! culling and capping plane algorithms), as Open volumes (shells or solids with holes)
//! or to perform Autodetection (would split input shape into two groups)
Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const Standard_Boolean theHasTexels, const gp_Pnt2d& theUVOrigin, const gp_Pnt2d& theUVRepeat, const gp_Pnt2d& theUVScale, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection);
Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const Standard_Boolean theHasTexels, const gp_Pnt2d& theUVOrigin, const gp_Pnt2d& theUVRepeat, const gp_Pnt2d& theUVScale, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection, const Handle(Graphic3d_Group)& theGroup = NULL);
//! Searches closed and unclosed subshapes in shape structure and puts them
//! into two compounds for separate processing of closed and unclosed sub-shapes

View File

@@ -21,6 +21,7 @@
#include <algorithm>
#include <iostream>
#include <limits>
namespace
{

View File

@@ -38,6 +38,7 @@
# include <stdio.h>
#endif
static Standard_Real tesp = 1.e-4;
static Standard_Real t3d = 1.e-4;
static Standard_Real t2d = 1.e-5;
static Standard_Real ta = 1.e-2;
@@ -87,7 +88,7 @@ static Standard_Integer VBLEND(Draw_Interpretor& di, Standard_Integer narg, cons
}
}
Rakk = new BRepFilletAPI_MakeFillet(V,FSh);
Rakk->SetParams(ta,t3d,t2d,t3d,t2d,fl);
Rakk->SetParams(ta, tesp, t2d, t3d, t2d, fl);
Rakk->SetContinuity(blend_cont, tapp_angle);
Standard_Real Rad;
TopoDS_Edge E;

View File

@@ -33,9 +33,7 @@ namespace
//=======================================================================
Vrml_ConfigurationNode::Vrml_ConfigurationNode() :
DE_ConfigurationNode()
{
UpdateLoad();
}
{}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
@@ -45,7 +43,6 @@ Vrml_ConfigurationNode::Vrml_ConfigurationNode(const Handle(Vrml_ConfigurationNo
:DE_ConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
UpdateLoad();
}
//=======================================================================

View File

@@ -294,23 +294,23 @@ void XCAFDoc_VisMaterial::FillAspect (const Handle(Graphic3d_Aspects)& theAspect
Handle(Graphic3d_TextureSet) aTextureSet = new Graphic3d_TextureSet (aNbTexUnits);
if (!aColorTexture.IsNull())
{
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (*aColorTexture, Graphic3d_TextureUnit_BaseColor));
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (aColorTexture, Graphic3d_TextureUnit_BaseColor));
}
if (!myPbrMat.EmissiveTexture.IsNull())
{
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (*myPbrMat.EmissiveTexture, Graphic3d_TextureUnit_Emissive));
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (myPbrMat.EmissiveTexture, Graphic3d_TextureUnit_Emissive));
}
if (!myPbrMat.OcclusionTexture.IsNull())
{
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (*myPbrMat.OcclusionTexture, Graphic3d_TextureUnit_Occlusion));
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (myPbrMat.OcclusionTexture, Graphic3d_TextureUnit_Occlusion));
}
if (!myPbrMat.NormalTexture.IsNull())
{
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (*myPbrMat.NormalTexture, Graphic3d_TextureUnit_Normal));
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (myPbrMat.NormalTexture, Graphic3d_TextureUnit_Normal));
}
if (!myPbrMat.MetallicRoughnessTexture.IsNull())
{
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (*myPbrMat.MetallicRoughnessTexture, Graphic3d_TextureUnit_MetallicRoughness));
aTextureSet->SetValue (aTexIter++, new XCAFPrs_Texture (myPbrMat.MetallicRoughnessTexture, Graphic3d_TextureUnit_MetallicRoughness));
}
theAspect->SetTextureSet (aTextureSet);

View File

@@ -21,14 +21,14 @@ IMPLEMENT_STANDARD_RTTIEXT(XCAFPrs_Texture, Graphic3d_Texture2D)
//function : XCAFPrs_Texture
//purpose :
//=======================================================================
XCAFPrs_Texture::XCAFPrs_Texture (const Image_Texture& theImageSource,
XCAFPrs_Texture::XCAFPrs_Texture (const Handle(Image_Texture)& theImageSource,
const Graphic3d_TextureUnit theUnit)
: Graphic3d_Texture2D (""),
myImageSource (theImageSource)
{
if (!myImageSource.TextureId().IsEmpty())
if (!myImageSource.IsNull() && !myImageSource->TextureId().IsEmpty())
{
myTexId = myImageSource.TextureId();
myTexId = myImageSource->TextureId();
}
myParams->SetTextureUnit (theUnit);
myIsColorMap = theUnit == Graphic3d_TextureUnit_BaseColor
@@ -41,7 +41,7 @@ XCAFPrs_Texture::XCAFPrs_Texture (const Image_Texture& theImageSource,
//=======================================================================
Handle(Image_CompressedPixMap) XCAFPrs_Texture::GetCompressedImage (const Handle(Image_SupportedFormats)& theSupported)
{
return myImageSource.ReadCompressedImage (theSupported);
return !myImageSource.IsNull() ? myImageSource->ReadCompressedImage (theSupported) : Handle(Image_CompressedPixMap)();
}
//=======================================================================
@@ -50,7 +50,11 @@ Handle(Image_CompressedPixMap) XCAFPrs_Texture::GetCompressedImage (const Handle
//=======================================================================
Handle(Image_PixMap) XCAFPrs_Texture::GetImage (const Handle(Image_SupportedFormats)& theSupported)
{
Handle(Image_PixMap) anImage = myImageSource.ReadImage (theSupported);
convertToCompatible (theSupported, anImage);
Handle(Image_PixMap) anImage;
if (!myImageSource.IsNull())
{
anImage = myImageSource->ReadImage(theSupported);
convertToCompatible(theSupported, anImage);
}
return anImage;
}

View File

@@ -27,8 +27,8 @@ class XCAFPrs_Texture : public Graphic3d_Texture2D
public:
//! Constructor.
Standard_EXPORT explicit XCAFPrs_Texture (const Image_Texture& theImageSource,
const Graphic3d_TextureUnit theUnit);
Standard_EXPORT XCAFPrs_Texture (const Handle(Image_Texture)& theImageSource,
const Graphic3d_TextureUnit theUnit);
//! Image reader.
Standard_EXPORT virtual Handle(Image_CompressedPixMap) GetCompressedImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE;
@@ -37,12 +37,11 @@ public:
Standard_EXPORT virtual Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE;
//! Return image source.
const Image_Texture& GetImageSource() const { return myImageSource; }
const Handle(Image_Texture)& GetImageSource() const { return myImageSource; }
protected:
Image_Texture myImageSource;
Handle(Image_Texture) myImageSource;
};
#endif // _XCAFPrs_Texture_HeaderFile

View File

@@ -4,9 +4,16 @@
## Comment : from original bug PRO4536
## ====================================
restore [locate_data_file CCH_blendhdp.rle] s
tscale s 0 0 0 1000
explode s e
blend result s 5 s_6
restore [locate_data_file CCH_blendhdp.rle] s_auth
set radius 0.005
set area 0.0355762
foreach sc {0.1 1.0 10.0 100.0 1000.0} {
copy s_auth s
tscale s 0 0 0 $sc
explode s e
blend result s [expr $radius * $sc] s_6
checkprops result -s 35576.2
checkprops result -s [expr $area * $sc * $sc]
unset s
}

View File

@@ -14,7 +14,7 @@ vdisplay result
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
checktrinfo result -tri 3828 -nod 4771 -defl 3.0544822246414993 -tol_abs_defl 1e-6
checktrinfo result -tri 3834 -nod 4777 -defl 3.0544822246414993 -tol_abs_defl 1e-6
set log [tricheck result]
if { [llength $log] != 0 } {

22
tests/bugs/mesh/bug31395 Normal file
View File

@@ -0,0 +1,22 @@
puts "========"
puts "0031395: Mesh - BRepMesh produces poor mesh on shape with hidden self-intersections"
puts "========"
puts ""
restore [locate_data_file log368.brep] result
tclean result
incmesh result 0.2
vinit
vsetdispmode 1
vdefaults -autoTriang 0
checkview -display result -3d -path ${imagedir}/${test_image}.png
set log [tricheck result]
if { [llength $log] != 0 } {
puts "Error : Invalid mesh"
} else {
puts "Mesh is OK"
}

View File

@@ -15,6 +15,6 @@ vfit
vsetdispmode 1
XGetOneShape result Q
checktrinfo result -tri 9025 -nod 6562
checktrinfo result -tri 9097 -nod 6634
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -14,6 +14,6 @@ XGetOneShape result Q
incmesh result 0.00039624 -a 20 -min 0.0001 -parallel
checktrinfo result -tri 7661 -nod 5810
checktrinfo result -tri 7733 -nod 5882
checkview -display result -3d -path ${imagedir}/${test_image}.png

20
tests/bugs/mesh/bug31865 Normal file
View File

@@ -0,0 +1,20 @@
puts "========"
puts "0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()"
puts "========"
puts ""
restore [locate_data_file bug31865.brep] result
tclean result
incmesh result 0.2
vinit
vdefaults -autoTriang 0
checkview -display result -3d -path ${imagedir}/${test_image}.png
set log [tricheck result]
if { [llength $log] != 0 } {
puts "Error : Invalid mesh"
} else {
puts "Mesh is OK"
}

View File

@@ -15,6 +15,6 @@ vclear
isos result 0
triangles result
checktrinfo result -tri 18 -nod 20
checktrinfo result -tri 20 -nod 22
checkprops result -s 19.2399
checkview -display result -3d -path ${imagedir}/${test_image}.png

View File

@@ -15,6 +15,6 @@ vclear
isos result 0
triangles result
checktrinfo result -tri 91 -nod 93
checktrinfo result -tri 103 -nod 105
checkprops result -s 150.283
checkview -display result -3d -path ${imagedir}/${test_image}.png

View File

@@ -1,4 +1,6 @@
puts "REQUIRED All: Standard_ConstructionError\\: BRepFill \\:\\: profiles are inconsistent"
puts "REQUIRED All: Profiles inconsistent"
puts "REQUIRED All: Error: Algorithm has failed"
puts "=========="
puts "OCC26636"
puts "=========="
@@ -10,4 +12,9 @@ puts ""
restore [locate_data_file bug26636_w1.brep] w1
restore [locate_data_file bug26636_w2.brep] w2
catch {thrusections result 0 1 w1 w2}
thrusections result 0 1 w1 w2
if {![isdraw result]} {
puts "Error: Algorithm has failed"
}

View File

@@ -1,5 +1,3 @@
puts "TODO OCC22821 ALL: Error: Crash with BRepFilletAPI_MakeFillet"
puts "============"
puts "OCC22821"
puts "============"
@@ -11,16 +9,115 @@ puts ""
pload XDE
stepread [locate_data_file bug22821_test.step] t *
renamevar t_1 t
checkshape t
renamevar t_1 m
checkshape m
explode t E
explode m E
if {![catch {fillet result t 0.01 t_1}]} {
#puts "OK: The incorrect input data were processed correctly!"
checkshape result
checkprops result -s 1.5708
checkview -display result -2d -path ${imagedir}/${test_image}.png
if {![catch {fillet res1 m 0.01 m_1}]} {
#puts "OK: Fillet on edge m_1 was processed correctly!"
checkshape res1
checkprops res1 -s 0.220328
checkview -display res1 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res2 m 0.01 m_2}]} {
#puts "OK: Fillet on edge m_2 was processed correctly!"
checkshape res2
checkprops res2 -s 0.220328
checkview -display res2 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res3 m 0.01 m_3}]} {
#puts "OK: Fillet on edge m_3 was processed correctly!"
checkshape res3
checkprops res3 -s 0.220328
checkview -display res3 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res4 m 0.01 m_4}]} {
#puts "OK: Fillet on edge m_4 was processed correctly!"
checkshape res4
checkprops res4 -s 0.220328
checkview -display res4 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res5 m 0.01 m_5}]} {
#puts "OK: Fillet on edge m_5 was processed correctly!"
checkshape res5
checkprops res5 -s 0.218602
checkview -display res5 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res6 m 0.01 m_6}]} {
#puts "OK: Fillet on edge m_6 was processed correctly!"
checkshape res6
checkprops res6 -s 0.220328
checkview -display res6 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res7 m 0.01 m_7}]} {
#puts "OK: Fillet on edge m_7 was processed correctly!"
checkshape res7
checkprops res7 -s 0.218602
checkview -display res7 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res8 m 0.01 m_8}]} {
#puts "OK: Fillet on edge m_8 was processed correctly!"
checkshape res8
checkprops res8 -s 0.220328
checkview -display res8 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res9 m 0.01 m_9}]} {
#puts "OK: Fillet on edge m_9 was processed correctly!"
checkshape res9
checkprops res9 -s 0.218602
checkview -display res9 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res10 m 0.01 m_10}]} {
#puts "OK: Fillet on edge m_10 was processed correctly!"
checkshape res10
checkprops res10 -s 0.218602
checkview -display res10 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res11 m 0.01 m_11}]} {
#puts "OK: Fillet on edge m_11 was processed correctly!"
checkshape res11
checkprops res11 -s 0.220328
checkview -display res11 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}
if {![catch {fillet res12 m 0.01 m_12}]} {
#puts "OK: Fillet on edge m_12 was processed correctly!"
checkshape res12
checkprops res12 -s 0.220328
checkview -display res12 -2d -path ${imagedir}/${test_image}.png
} else {
puts "Error: Crash with BRepFilletAPI_MakeFillet"
}

Some files were not shown because too many files have changed in this diff Show More