-// File: BRepBlend_RstRstLineBuilder.cxx
-// Created: Fri Jan 24 10:39:44 1997
-// Author: Jacques GOUSSARD
-// Author: Laurent BOURESCHE
-// <lbo@pomalox.paris1.matra-dtv.fr>
-
-#include <stdio.h>
-
-#include <BRepBlend_RstRstLineBuilder.ixx>
+// Created on: 1997-01-24
+// Created by: Laurent BOURESCHE
+// Copyright (c) 1997-1999 Matra Datavision
+// Copyright (c) 1999-2014 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.
+
+
+#include <Adaptor2d_HCurve2d.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_HVertex.hxx>
+#include <Adaptor3d_TopolTool.hxx>
+#include <Blend_CurvPointFuncInv.hxx>
+#include <Blend_Point.hxx>
+#include <Blend_RstRstFunction.hxx>
+#include <Blend_SurfCurvFuncInv.hxx>
#include <BRepBlend_BlendTool.hxx>
-#include <TopAbs.hxx>
-#include <IntSurf.hxx>
-#include <math_FunctionSetRoot.hxx>
-#include <gp_Pnt2d.hxx>
+#include <BRepBlend_Extremity.hxx>
+#include <BRepBlend_Line.hxx>
+#include <BRepBlend_RstRstLineBuilder.hxx>
#include <gp_Pnt.hxx>
-#include <gp_Vec2d.hxx>
+#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
+#include <gp_Vec2d.hxx>
+#include <IntSurf.hxx>
+#include <IntSurf_Transition.hxx>
+#include <math_FunctionSetRoot.hxx>
+#include <TopAbs.hxx>
-#ifdef DEB
+#include <stdio.h>
+#ifdef OCCT_DEBUG
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
static Standard_Integer IndexOfSection = 0;
extern Standard_Boolean Blend_GettraceDRAWSECT();
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
//-----------------------------------------------------
-// Pour debug : visualisation de la section
+// For debug : visualisation of the section
static Standard_Boolean BBPP(const Standard_Real param,
Blend_RstRstFunction& Func,
const math_Vector& sol,
Standard_Real scal = 1./ (param1 - param2);
cout<<endl;
- cout<<"controle des derivees au point : "<<param1<<endl;
+ cout<<"control of derivatives at point : "<<param1<<endl;
for(i = 1; i <= hp; i++){
cout<<endl;
cout<<"point : "<<i<<endl;
- cout<<"dx calcule : "<<TDP1(i).X()<<endl;
- cout<<"dx estime : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
- cout<<"dy calcule : "<<TDP1(i).Y()<<endl;
- cout<<"dy estime : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
- cout<<"dz calcule : "<<TDP1(i).Z()<<endl;
- cout<<"dz estime : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
- cout<<"dw calcule : "<<TDW1(i)<<endl;
- cout<<"dw estime : "<<scal*(TW1(i)-TW2(i))<<endl;
+ cout<<"dx calculated : "<<TDP1(i).X()<<endl;
+ cout<<"dx estimated : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
+ cout<<"dy calculated : "<<TDP1(i).Y()<<endl;
+ cout<<"dy estimated : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
+ cout<<"dz calculated : "<<TDP1(i).Z()<<endl;
+ cout<<"dz estimated : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
+ cout<<"dw calculated : "<<TDW1(i)<<endl;
+ cout<<"dw estimated : "<<scal*(TW1(i)-TW2(i))<<endl;
}
for(i = 1; i <= hp2d; i++){
cout<<endl;
cout<<"point 2d : "<<i<<endl;
- cout<<"dx calcule : "<<TDP2d1(i).X()<<endl;
- cout<<"dx estime : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
- cout<<"dy calcule : "<<TDP2d1(i).Y()<<endl;
- cout<<"dy estime : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
+ cout<<"dx calculated : "<<TDP2d1(i).X()<<endl;
+ cout<<"dx estimated : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
+ cout<<"dy calculated : "<<TDP2d1(i).Y()<<endl;
+ cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
}
}
-
+#endif
//-----------------------------------------------------
static void Drawsect(const Standard_Real param,
//=======================================================================
//function : Perform
-//purpose : lance le processus de cheminement
+//purpose : launch the processing
//=======================================================================
void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func,
if (State != Blend_OK) {
return;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
#endif
- // Mettre a jour la ligne.
+ // Update the line.
line->Append(previousP);
Standard_Real U, V;
U = previousP.ParameterOnC1();
//=======================================================================
//function : PerformFirstSection
-//purpose : Creation de la premiere section
+//purpose : Creation of the first section
//=======================================================================
Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection
Standard_Boolean recadp1, recadp2, recadrst1, recadrst2;
Standard_Real wp1, wp2, wrst1, wrst2;
-#ifndef DEB
Blend_Status State = Blend_OnRst12;
Standard_Real trst11 = 0., trst12 = 0., trst21 = 0., trst22 = 0.;
-#else
- Blend_Status State;
- Standard_Real trst11, trst12, trst21, trst22;
-#endif
math_Vector infbound(1, 2), supbound(1, 2), tolerance(1, 2);
math_Vector solinvp1(1, 2), solinvp2(1, 2), solinvrst1(1, 3), solinvrst2(1, 3);
Handle(Adaptor3d_HVertex) Vtxp1, Vtxp2, Vtxrst1, Vtxrst2, Vtxc;
if (!recadrst1 && !recadp1 && !recadrst2 && !recadp2) return Standard_False;
- // on regarde si on a decroche ou sorti du domaine 1
+ // it is checked if the contact was lost or domain 1 was left
if (recadp1 && recadrst1) {
- if (sens * (wrst1 - wp1) > tolgui){ //on sort du domaine d abord
+ if (sens * (wrst1 - wp1) > tolgui){ //at first one leaves the domain
wrst1 = wp1;
trst12 = solinvp1(2);
trst11 = BRepBlend_BlendTool::Parameter(Vtxp1, rst1);
Vtxrst2 = Vtxp1;
recadrst1 = Standard_False;
}
- else { // on a decroche
+ else { // the contact is lost
trst11 = solinvrst1(3);
trst12 = solinvrst1(2);
recadp1 = Standard_False;
trst12 = solinvrst1(2);
}
- // on regarde si on a decrocher ou sortie du domaine 2
+ // it is checked if the contact was lost or domain 2 was left
if (recadp2 && recadrst2) {
- if (sens * (wrst2 - wp2) > tolgui) { //on sort du domaine d abord
+ if (sens * (wrst2 - wp2) > tolgui) { //at first one leaves the domain
wrst2 = wp2;
trst21 = solinvp2(2);
trst22 = BRepBlend_BlendTool::Parameter(Vtxp2, rst2);
trst21 = solinvrst2(2);
}
- // on regarde sur laquelle des courbes on decroche en premier
+ // it is checked on which curve the contact is lost earlier
if (recadrst1 && recadrst2) {
if (Abs(wrst1 - wrst2) < tolgui) {
State = Blend_OnRst12;
sol(2) = trst22;
}
else if (sens * (wrst1 - wrst2) < 0) {
- // on decroche sur Rst1
+ // contact lost on Rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
sol(2) = trst12;
}
else {
- // on decroche sur rst2
+ // contact lost on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
Func.Set(param);
}
else if (recadrst1) {
- // sol sur rst1
+ // ground on rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
Func.Set(param);
}
else if (recadrst2) {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
sol(2) = trst22;
Func.Set(param);
}
- // on regarde sur laquelle des courbes on sort en premier
+ // it is checked on which curves one leaves first
else if (recadp1 && recadp2) {
if (Abs(wrst1 - wrst2) < tolgui) {
State = Blend_OnRst12;
sol(2) = trst22;
}
else if (sens * (wrst1 - wrst2) < 0) {
- // sol sur Rst1
+ // sol on Rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
sol(2) = trst12;
}
else {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
Func.Set(param);
}
else if (recadp1) {
- // sol sur rst1
+ // ground on rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
Func.Set(param);
}
else if (recadp2) {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
//=======================================================================
//function : InternalPerform
-//purpose : algorithme de cheminement sauf aux extremites
+//purpose : algorithm of processing without extremities
//=======================================================================
void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
{
Standard_Real stepw = pasmax;
Standard_Integer nbp = line->NbPoints();
- if(nbp >= 2){ //On reprend le dernier step s il n est pas trop petit.
+ if(nbp >= 2){ //The last step is redone if it is not too small.
if(sens < 0.){
stepw = (line->Point(2).Parameter() - line->Point(1).Parameter());
}
if (sens* (parprec - Bound) >= -tolgui) {
return;
}
-#ifndef DEB
Blend_Status State = Blend_OnRst12;
Standard_Real trst11 = 0., trst12 = 0., trst21 = 0., trst22 = 0.;
-#else
- Blend_Status State;
- Standard_Real trst11, trst12, trst21, trst22;
-#endif
- TopAbs_State situonc1, situonc2;
- Blend_DecrochStatus decroch;
+ TopAbs_State situonc1 = TopAbs_UNKNOWN, situonc2 = TopAbs_UNKNOWN;
+ Blend_DecrochStatus decroch = Blend_NoDecroch;
Standard_Boolean Arrive, recadp1, recadp2, recadrst1, recadrst2, echecrecad;
Standard_Real wp1, wp2, wrst1, wrst2;
math_Vector infbound(1, 2), supbound(1, 2);
while (!Arrive) {
Standard_Boolean bonpoint = 1;
-#if 0
+#ifdef OCCT_DEBUG_BBPP_N_TRDERIV
//debdebdebdebdebdeb
Func.Set(param);
rsnld.Perform(Func, parinit, infbound, supbound);
recadp1 = recadp2 = recadrst1 = recadrst2 = Standard_False;
echecrecad = Standard_False;
if (situonc1 != TopAbs_IN) {
- // pb inverse rst/rst
+ // pb inversion rst/rst
recadp1 = Recadre1(FinvP1, solinvp1, IsVtxp1, Vtxp1);
if (recadp1) {
wp1 = solinvp1(1);
}
if (situonc2 != TopAbs_IN) {
- // pb inverse point/surf
+ // pb inversion point/surf
recadp2 = Recadre2(FinvP2, solinvp2, IsVtxp2, Vtxp2);
if (recadp2) {
wp2 = solinvp2(1);
}
if (decroch == Blend_DecrochRst1 || decroch == Blend_DecrochBoth) {
- // pb inverse rst1/surf1
+ // pb inversion rst1/surf1
recadrst1 = Recadre1(Func, Finv1, solinvrst1, IsVtxrst1, Vtxrst1);
if (recadrst1) {
wrst1 = solinvrst1(1);
if (recadp1 || recadp2 || recadrst1 || recadrst2) echecrecad = Standard_False;
if (!echecrecad) {
- // on regarde si on a decroche ou sorti du domaine 1
+ // it is checked if the contact was lost or domain 1 was left
if (recadp1 && recadrst1) {
- if (sens * (wrst1 - wp1) > tolgui){ //on sort du domaine d abord
+ if (sens * (wrst1 - wp1) > tolgui){ //first one leaves the domain
wrst1 = wp1;
trst12 = solinvp1(2);
trst11 = BRepBlend_BlendTool::Parameter(Vtxp1, rst1);
Vtxrst2 = Vtxp1;
recadrst1 = Standard_False;
}
- else { // on a decroche
+ else { // contact is lost
trst11 = solinvrst1(3);
trst12 = solinvrst1(2);
recadp1 = Standard_False;
trst12 = solinvrst1(2);
}
- // on regarde si on a decrocher ou sortie du domaine 2
+ // it is checked if the contact was lost or domain 2 was left
if (recadp2 && recadrst2) {
- if (sens * (wrst2 - wp2) > tolgui) { //on sort du domaine d abord
+ if (sens * (wrst2 - wp2) > tolgui) { //first one leaves the domain
wrst2 = wp2;
trst21 = solinvp2(2);
trst22 = BRepBlend_BlendTool::Parameter(Vtxp2, rst2);
trst21 = solinvrst2(2);
}
- // on regarde sur laquelle des courbes on decroche en premier
+ // it is checked on which curve the contact is lost earlier
if (recadrst1 && recadrst2) {
if (Abs(wrst1 - wrst2) < tolgui) {
State = Blend_OnRst12;
sol(2) = trst22;
}
else if (sens * (wrst1 - wrst2) < 0) {
- // on decroche sur Rst1
+ // contact is lost on Rst1
State = Blend_OnRst1;
decroch = Blend_DecrochRst1;
param = wrst1;
sol(2) = trst12;
}
else {
- // on decroche sur rst2
+ // contact is lost on rst2
State = Blend_OnRst2;
decroch = Blend_DecrochRst2;
param = wrst2;
Func.Set(param);
}
else if (recadrst1) {
- // sol sur rst1
+ // ground on rst1
State = Blend_OnRst1;
decroch = Blend_DecrochRst1;
param = wrst1;
Func.Set(param);
}
else if (recadrst2) {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
decroch = Blend_DecrochRst2;
param = wrst2;
sol(2) = trst22;
Func.Set(param);
}
- // on regarde sur laquelle des courbes on sort en premier
+ // it is checked on which curve the contact is lost earlier
else if (recadp1 && recadp2) {
if (Abs(wrst1 - wrst2) < tolgui) {
State = Blend_OnRst12;
sol(2) = trst22;
}
else if (sens * (wrst1 - wrst2) < 0) {
- // sol sur Rst1
+ // ground on Rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
sol(2) = trst12;
}
else {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
Func.Set(param);
}
else if (recadp1) {
- // sol sur rst1
+ // ground on rst1
State = Blend_OnRst1;
param = wrst1;
sol(1) = trst11;
Func.Set(param);
}
else if (recadp2) {
- // sol sur rst2
+ // ground on rst2
State = Blend_OnRst2;
param = wrst2;
sol(1) = trst21;
State = TestArret(Func, Standard_True, State);
}
else{
- // echec recadrage. On sort avec PointsConfondus
- cout<<"echec recadrage"<<endl;
+ // reframing failed. Leave with PointsConfondus
+#ifdef OCCT_DEBUG
+ cout<<"reframing failed"<<endl;
+#endif
State = Blend_SamePoints;
}
}
switch (State) {
case Blend_OK :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
#endif
- // Mettre a jour la ligne.
+ // Update the line.
if (sens > 0.) {
line->Append(previousP);
}
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
- // Indiquer que fin sur Bound.
+ // Show that end is on Bound.
}
else {
param = param + sens * stepw;
previousP.ParameterOnC2(),
previousP.Parameter(), tolesp);
Arrive = Standard_True;
+#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
- // Indiquer qu on s arrete en cours de cheminement
- cout<<"On n avance plus dans le cheminement"<<endl;
+ // Show that there is a stop during processing
+ cout<<"No more advancement in the processing"<<endl;
}
+#endif
}
else {
- param = parprec + sens * stepw; // on ne risque pas de depasser Bound.
+ param = parprec + sens * stepw; // there is no risk to exceed Bound.
}
}
break;
case Blend_StepTooSmall :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param,Func);
}
#endif
- // Mettre a jour la ligne.
+ // Update the line.
if (sens > 0.) {
line->Append(previousP);
}
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
MakeExtremity(Extrst2, Standard_False, rst2, sol(2), IsVtxrst2, Vtxrst2);
- // Indiquer que fin sur Bound.
+ // Indicate that end is on Bound.
}
else {
param = param + sens * stepw;
case Blend_OnRst1 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_OnRst2 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_OnRst12 :
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (Blend_GettraceDRAWSECT()){
Drawsect(param, Func);
}
case Blend_SamePoints :
{
- // On arrete
- cout << " Points confondus dans le cheminement" << endl;
+ // Stop
+#ifdef OCCT_DEBUG
+ cout << " Mixed points in the processing" << endl;
+#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
previousP.Parameter(), tolesp);
Arrive = Standard_True;
}
break;
-#ifndef DEB
default:
break;
-#endif
}
if (Arrive) {
if (sens > 0.) {
//=======================================================================
//function : Recadre1
-//purpose : On a decroche en 1
+//purpose : Contact lost on 1
//=======================================================================
Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction& Func,
Solinv(2) = sol(2);
Solinv(3) = sol(1);
- // On recherche le point de non decrochement
+ // The point where contact is not lost is found
math_FunctionSetRoot rsnld(Finv, toler, 30);
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
- // On doit verifier la valeur de la fonction est bien
- // sur la seconde restriction
+ // It is necessary to check if the function value meets the
+ // second restriction
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst2->FirstParameter() - toler(2)||
return Standard_False;
}
- // on regarde si on n est pas sur un Vertex
+ // it is checked if it is on a Vertex
domain1->Initialize(rst1);
domain1->InitVertexIterator();
IsVtx = !domain1->MoreVertex();
if (!domain1->MoreVertex()) {
IsVtx = Standard_False;
}
- // On recalcule la section par resolution directe, sinon, on se recupere
- // des incoherences entre le parametre et sol dues au baillement.
+ // The section is recalculated by direct solution, otherwise return
+ // incoherences between the parameter and the ground caused by yawn.
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1, 2), tolerance(1, 2);
//=======================================================================
//function : Recadre2
-//purpose : On a decroche sur Rst2
+//purpose : Contact lost on Rst2
//=======================================================================
Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction& Func,
math_FunctionSetRoot rsnld(Finv, toler, 30);
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
- // On doit verifier la valeur de la fonction
+ // It is necessary to check the value of the function
if (Finv.IsSolution(Solinv, tolesp)) {
Standard_Real w = Solinv(2);
if(w < rst1->FirstParameter() - toler(2)||
if (!domain2->MoreVertex()) {
IsVtx = Standard_False;
}
- // On recalcule la section par resolution directe, sinon, on se recupere
- // des incoherences entre le parametre et sol dues au baillement.
-
+ // The section is recalculated by direct solution, otherwise return
+ // incoherences between the parameter and the ground caused by yawn.
+
math_Vector infbound(1, 2), supbound(1, 2);
math_Vector parinit(1,2), tolerance(1,2);
Func.GetTolerance(tolerance, tolesp);
//=======================================================================
//function : Recadre
-//purpose : On est en fin de la courbe rst1
+//purpose : This is the end of curve rst1
//=======================================================================
Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv& FinvP,
Standard_Boolean& IsVtx,
Handle(Adaptor3d_HVertex)& Vtx)
{
- // On se place sur le dernier ou le premier point, suivant le
- // sens de cheminement.
+ // One is located on the last or the first point, following the
+ // direction of processing.
gp_Pnt2d p2drst1;
Standard_Real firstrst1 = rst1->FirstParameter();
Standard_Real lastrst1 = rst1->LastParameter();
math_FunctionSetRoot rsnld(FinvP, toler, 30);
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
//=======================================================================
//function : Recadre2
-//purpose : On est en fin de la courbe rst2
+//purpose : This is the end of curve rst2
//=======================================================================
Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv& FinvP,
Standard_Boolean& IsVtx,
Handle(Adaptor3d_HVertex)& Vtx)
{
- // On se place sur le dernier ou le premier point, suivant le
- // sens de cheminement.
+ // One is located on the last or the first point, following the
+ // direction of processing.
gp_Pnt2d p2drst2;
Standard_Real firstrst2 = rst2->FirstParameter();
Standard_Real lastrst2 = rst2->LastParameter();
math_FunctionSetRoot rsnld(FinvP, toler, 30);
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
+#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
+#endif
return Standard_False;
}
rsnld.Root(Solinv);
//=======================================================================
//function : MakeExtremity
-//purpose : fabrique l extremite d une courbe
+//purpose : produce the extremity of a curve
//=======================================================================
void BRepBlend_RstRstLineBuilder::MakeExtremity(BRepBlend_Extremity& Extrem,
else {
Extrem.SetVertex(Vtx);
while (Iter->More()) {
-//#ifndef DEB
Handle(Adaptor2d_HCurve2d) arc = Iter->Value();
-//#else
-// Handle(Adaptor2d_HCurve2d)& arc = Iter->Value();
-//#endif
if (arc != Arc) {
Iter->Initialize(arc);
Iter->InitVertexIterator();
Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst1(const Blend_Point& CurPoint)
{
- //Controles 3d du Blend_CSWalking.
+ //Controls 3d of Blend_CSWalking.
- // regle par tests dans U4 correspond a 11.478 d
+ // rule by tests in U4 corresponds to 11.478
const Standard_Real CosRef3D = 0.98;
Standard_Real Cosi, Cosi2;
Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint();
if(!prevpointistangent){
prevTg = previousP.TangentOnC1();
}
- Standard_Real Norme, curNorme;
-#ifndef DEB
+ Standard_Real Norme;
Standard_Real prevNorme = 0.;
-#else
- Standard_Real prevNorme;
-#endif
gp_Vec Corde(prevP, Psurf);
Norme = Corde.SquareMagnitude();
- if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp) {
- // il faudra peut etre forcer meme point
+ // it can be necessary to force the same point
return Blend_SamePoints;
}
if(!prevpointistangent){
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
- if (Cosi < 0.) { // angle 3d>pi/2. --> retour arriere
+ if (Cosi < 0.) { // angle 3d>pi/2. --> return back
return Blend_Backward;
}
}
if(!curpointistangent){
- // Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
+ // Check if it is necessary to control the sign of prevtg*Tgsurf
Cosi = sens * Corde * Tgsurf;
Cosi2 = Cosi * Cosi / Tgsurf.SquareMagnitude() / Norme;
if (Cosi2 < CosRef3D || Cosi < 0.) {
}
if (!curpointistangent && !prevpointistangent) {
- // Estimation de la fleche courante
+ // Estimation of the current arrow
Standard_Real FlecheCourante =
(prevTg.Normalized().XYZ() - Tgsurf.Normalized().XYZ()).SquareModulus() * Norme / 64.;
return Blend_StepTooSmall;
}
if (FlecheCourante > fleche * fleche) {
- // pas trop grand : commentaire interessant
+ // not too great
return Blend_StepTooLarge;
}
}
Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst2(const Blend_Point& CurPoint)
{
- //Controles 3d du Blend_CSWalking.
+ //3D Controls of Blend_CSWalking.
- // regle par tests dans U4 correspond a 11.478 d
+ // rule by tests in U4 corresponding to 11.478 d
const Standard_Real CosRef3D = 0.98;
Standard_Real Cosi, Cosi2;
Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint();
if (!prevpointistangent) {
prevTg = previousP.TangentOnC2();
}
- Standard_Real Norme, curNorme;
-#ifndef DEB
+ Standard_Real Norme;
Standard_Real prevNorme = 0.;
-#else
- Standard_Real prevNorme;
-#endif
gp_Vec Corde(prevP, Psurf);
Norme = Corde.SquareMagnitude();
- if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
if (Norme <= tolesp * tolesp){
- // il faudra peut etre forcer meme point
+ // it can be necessary to force the same point
return Blend_SamePoints;
}
if (!prevpointistangent) {
return Blend_SamePoints;
}
Cosi = sens * Corde * prevTg;
- if (Cosi < 0.) { // angle 3d>pi/2. --> retour arriere
+ if (Cosi < 0.) { // angle 3d>pi/2. --> return back
return Blend_Backward;
}
}
if (!curpointistangent) {
- // Voir s il faut faire le controle sur le signe de prevtg*Tgsurf
+ // Check if it is necessary to control the sign of prevtg*Tgsurf
Cosi = sens * Corde * Tgsurf;
Cosi2 = Cosi * Cosi / Tgsurf.SquareMagnitude() / Norme;
if (Cosi2 < CosRef3D || Cosi < 0.) {
}
if(!curpointistangent && !prevpointistangent){
- // Estimation de la fleche courante
+ // Estimation of the current arrow
Standard_Real FlecheCourante =
(prevTg.Normalized().XYZ() - Tgsurf.Normalized().XYZ()).SquareModulus() * Norme/64.;
return Blend_StepTooSmall;
}
if (FlecheCourante > fleche * fleche) {
- // pas trop grand : commentaire interessant
+ // not too great
return Blend_StepTooLarge;
}
}
gp_Vec tgrst1, tgrst2;
gp_Vec2d tg2drst1, tg2drst2;
Blend_Status StateRst1, StateRst2;
-#ifndef DEB
IntSurf_TypeTrans trarst1 = IntSurf_Undecided, trarst2 = IntSurf_Undecided;
-#else
- IntSurf_TypeTrans trarst1, trarst2;
-#endif
Blend_Point curpoint;
if (Func.IsSolution(sol, tolesp)) {
math_Vector tolerance(1, 2);
Func.GetTolerance(tolerance, tolesp);
- //cote pcurve 1.
+ //face pcurve 1.
Standard_Real v = sol(1);
if(v < rst1->FirstParameter() - tolerance(2)||
v > rst1->LastParameter() + tolerance(2)){
}
else SituOnC1 = TopAbs_ON;
- //cote pcurve 2.
+ //face pcurve 2.
v = sol(2);
if(v < rst2->FirstParameter() - tolerance(2)||
v > rst2->LastParameter() + tolerance(2)){
else SituOnC2 = TopAbs_ON;
- //decrochage
+ //lost contact
gp_Vec tgrst1, norst1, tgrst2, norst2;
Decroch = Func.Decroch(sol,tgrst1, norst1, tgrst2, norst2);