File indexing completed on 2026-09-23 09:17:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef ChFi3d_Builder_0_HeaderFile
0018 #define ChFi3d_Builder_0_HeaderFile
0019
0020 #include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
0021 #include <TopOpeBRepDS_CurvePointInterference.hxx>
0022 #include <TopOpeBRepDS_DataStructure.hxx>
0023 #include <BRepBlend_Extremity.hxx>
0024 #include <ChFiDS_Stripe.hxx>
0025 #include <ChFiDS_SurfData.hxx>
0026 #include <ChFiDS_Spine.hxx>
0027 #include <ChFiDS_ElSpine.hxx>
0028 #include <ChFiDS_CommonPoint.hxx>
0029 #include <ChFiDS_Regul.hxx>
0030 #include <NCollection_List.hxx>
0031 #include <ChFiDS_FaceInterference.hxx>
0032 #include <ChFiDS_Map.hxx>
0033 #include <TopoDS_Face.hxx>
0034 #include <TopoDS_Vertex.hxx>
0035 #include <TopAbs_Orientation.hxx>
0036 #include <TopoDS_Shape.hxx>
0037 #include <IntSurf_TypeTrans.hxx>
0038 #include <GeomFill_BoundWithSurf.hxx>
0039 #include <Geom2d_Curve.hxx>
0040 #include <Geom_Curve.hxx>
0041 #include <Geom_TrimmedCurve.hxx>
0042 #include <Geom_Surface.hxx>
0043 #include <Geom_BezierCurve.hxx>
0044 #include <Geom_Circle.hxx>
0045 #include <GeomAdaptor_Surface.hxx>
0046 #include <BRepAdaptor_Surface.hxx>
0047 #include <Adaptor3d_Curve.hxx>
0048 #include <Adaptor3d_Surface.hxx>
0049 #include <Bnd_Box.hxx>
0050 #include <GeomAbs_Shape.hxx>
0051 #include <gp_Pnt.hxx>
0052 #include <NCollection_Array1.hxx>
0053 #ifdef OCCT_DEBUG
0054 #include <OSD_Chronometer.hxx>
0055 extern OSD_Chronometer simul, elspine, chemine;
0056 #endif
0057
0058 double ChFi3d_InPeriod(const double U, const double UFirst, const double ULast, const double Eps);
0059
0060 void ChFi3d_Boite(const gp_Pnt2d& p1,
0061 const gp_Pnt2d& p2,
0062 double& mu,
0063 double& Mu,
0064 double& mv,
0065 double& Mv);
0066
0067 void ChFi3d_Boite(const gp_Pnt2d& p1,
0068 const gp_Pnt2d& p2,
0069 const gp_Pnt2d& p3,
0070 const gp_Pnt2d& p4,
0071 double& Du,
0072 double& Dv,
0073 double& mu,
0074 double& Mu,
0075 double& mv,
0076 double& Mv);
0077
0078 void ChFi3d_SetPointTolerance(TopOpeBRepDS_DataStructure& DStr, const Bnd_Box& box, const int IP);
0079
0080 void ChFi3d_EnlargeBox(const occ::handle<Geom_Curve>& C,
0081 const double wd,
0082 const double wf,
0083 Bnd_Box& box1,
0084 Bnd_Box& box2);
0085
0086 void ChFi3d_EnlargeBox(const occ::handle<Adaptor3d_Surface>& S,
0087 const occ::handle<Geom2d_Curve>& PC,
0088 const double wd,
0089 const double wf,
0090 Bnd_Box& box1,
0091 Bnd_Box& box2);
0092
0093 void ChFi3d_EnlargeBox(const TopoDS_Edge& E,
0094 const NCollection_List<TopoDS_Shape>& LF,
0095 const double w,
0096 Bnd_Box& box);
0097
0098 void ChFi3d_EnlargeBox(TopOpeBRepDS_DataStructure& DStr,
0099 const occ::handle<ChFiDS_Stripe>& st,
0100 const occ::handle<ChFiDS_SurfData>& sd,
0101 Bnd_Box& b1,
0102 Bnd_Box& b2,
0103 const bool isfirst);
0104
0105 GeomAbs_Shape ChFi3d_evalconti(const TopoDS_Edge& E, const TopoDS_Face& F1, const TopoDS_Face& F2);
0106
0107 void ChFi3d_conexfaces(const TopoDS_Edge& E,
0108 TopoDS_Face& F1,
0109 TopoDS_Face& F2,
0110 const ChFiDS_Map& EFMap);
0111
0112 ChFiDS_State ChFi3d_EdgeState(TopoDS_Edge* E, const ChFiDS_Map& EFMap);
0113
0114 bool ChFi3d_KParticular(const occ::handle<ChFiDS_Spine>& Spine,
0115 const int IE,
0116 const BRepAdaptor_Surface& S1,
0117 const BRepAdaptor_Surface& S2);
0118
0119 void ChFi3d_BoundFac(BRepAdaptor_Surface& S,
0120 const double umin,
0121 const double umax,
0122 const double vmin,
0123 const double vmax,
0124 const bool checknaturalbounds = true);
0125
0126 void ChFi3d_BoundSrf(GeomAdaptor_Surface& S,
0127 const double umin,
0128 const double umax,
0129 const double vmin,
0130 const double vmax,
0131 const bool checknaturalbounds = true);
0132
0133 bool ChFi3d_InterPlaneEdge(const occ::handle<Adaptor3d_Surface>& Plan,
0134 const occ::handle<Adaptor3d_Curve>& C,
0135 double& W,
0136 const bool Sens,
0137 const double tolc);
0138
0139 void ChFi3d_ExtrSpineCarac(const TopOpeBRepDS_DataStructure& DStr,
0140 const occ::handle<ChFiDS_Stripe>& cd,
0141 const int i,
0142 const double p,
0143 const int jf,
0144 const int sens,
0145 gp_Pnt& P,
0146 gp_Vec& V,
0147 double& R);
0148
0149 occ::handle<Geom_Circle> ChFi3d_CircularSpine(double& WFirst,
0150 double& WLast,
0151 const gp_Pnt& Pdeb,
0152 const gp_Vec& Vdeb,
0153 const gp_Pnt& Pfin,
0154 const gp_Vec& Vfin,
0155 const double rad);
0156
0157 occ::handle<Geom_BezierCurve> ChFi3d_Spine(const gp_Pnt& pd,
0158 gp_Vec& vd,
0159 const gp_Pnt& pf,
0160 gp_Vec& vf,
0161 const double R);
0162
0163 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Adaptor3d_Surface>& Fac,
0164 occ::handle<Geom2d_Curve>& curv,
0165 const int sens1,
0166 const gp_Pnt2d& pfac1,
0167 const gp_Vec2d& vfac1,
0168 const int sens2,
0169 const gp_Pnt2d& pfac2,
0170 const gp_Vec2d& vfac2,
0171 const double t3d,
0172 const double ta);
0173
0174 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Adaptor3d_Surface>& Surf,
0175 occ::handle<Geom2d_Curve>& curv,
0176 const int sens1,
0177 const gp_Pnt2d& p1,
0178 gp_Vec& v1,
0179 const int sens2,
0180 const gp_Pnt2d& p2,
0181 gp_Vec& v2,
0182 const double t3d,
0183 const double ta);
0184
0185 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Geom_Surface>& s,
0186 const gp_Pnt2d& p1,
0187 const gp_Pnt2d& p2,
0188 const double t3d,
0189 const double ta,
0190 const bool isfreeboundary = false);
0191
0192 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Adaptor3d_Surface>& HS,
0193 const gp_Pnt2d& p1,
0194 const gp_Pnt2d& p2,
0195 const double t3d,
0196 const double ta,
0197 const bool isfreeboundary = false);
0198
0199 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Adaptor3d_Surface>& HS,
0200 const occ::handle<Geom2d_Curve>& curv,
0201 const double t3d,
0202 const double ta,
0203 const bool isfreeboundary = false);
0204
0205 occ::handle<GeomFill_Boundary> ChFi3d_mkbound(const occ::handle<Adaptor3d_Surface>& Fac,
0206 occ::handle<Geom2d_Curve>& curv,
0207 const gp_Pnt2d& p1,
0208 const gp_Pnt2d& p2,
0209 const double t3d,
0210 const double ta,
0211 const bool isfreeboundary = false);
0212
0213 void ChFi3d_Coefficient(const gp_Vec& V3d,
0214 const gp_Vec& D1u,
0215 const gp_Vec& D1v,
0216 double& DU,
0217 double& DV);
0218
0219 occ::handle<Geom2d_Curve> ChFi3d_BuildPCurve(const gp_Pnt2d& p1,
0220 gp_Dir2d& d1,
0221 const gp_Pnt2d& p2,
0222 gp_Dir2d& d2,
0223 const bool redresse = true);
0224
0225 occ::handle<Geom2d_Curve> ChFi3d_BuildPCurve(const occ::handle<Adaptor3d_Surface>& Surf,
0226 const gp_Pnt2d& p1,
0227 const gp_Vec& v1,
0228 const gp_Pnt2d& p2,
0229 const gp_Vec& v2,
0230 const bool redresse = false);
0231
0232 occ::handle<Geom2d_Curve> ChFi3d_BuildPCurve(const occ::handle<Adaptor3d_Surface>& Surf,
0233 const gp_Pnt2d& p1,
0234 const gp_Vec2d& v1,
0235 const gp_Pnt2d& p2,
0236 const gp_Vec2d& v2,
0237 const bool redresse = false);
0238
0239 bool ChFi3d_CheckSameParameter(const occ::handle<Adaptor3d_Curve>& C3d,
0240 occ::handle<Geom2d_Curve>& Pcurv,
0241 const occ::handle<Adaptor3d_Surface>& S,
0242 const double tol3d,
0243 double& tolreached);
0244
0245 bool ChFi3d_SameParameter(const occ::handle<Adaptor3d_Curve>& C3d,
0246 occ::handle<Geom2d_Curve>& Pcurv,
0247 const occ::handle<Adaptor3d_Surface>& S,
0248 const double tol3d,
0249 double& tolreached);
0250
0251 bool ChFi3d_SameParameter(const occ::handle<Geom_Curve>& C3d,
0252 occ::handle<Geom2d_Curve>& Pcurv,
0253 const occ::handle<Geom_Surface>& S,
0254 const double Pardeb,
0255 const double Parfin,
0256 const double tol3d,
0257 double& tolreached);
0258
0259 void ChFi3d_ComputePCurv(const occ::handle<Geom_Curve>& C3d,
0260 const gp_Pnt2d& UV1,
0261 const gp_Pnt2d& UV2,
0262 occ::handle<Geom2d_Curve>& Pcurv,
0263 const occ::handle<Geom_Surface>& S,
0264 const double Pardeb,
0265 const double Parfin,
0266 const double tol3d,
0267 double& tolreached,
0268 const bool reverse = false);
0269
0270 void ChFi3d_ComputePCurv(const occ::handle<Adaptor3d_Curve>& C3d,
0271 const gp_Pnt2d& UV1,
0272 const gp_Pnt2d& UV2,
0273 occ::handle<Geom2d_Curve>& Pcurv,
0274 const occ::handle<Adaptor3d_Surface>& S,
0275 const double Pardeb,
0276 const double Parfin,
0277 const double tol3d,
0278 double& tolreached,
0279 const bool reverse = false);
0280
0281 void ChFi3d_ComputePCurv(const gp_Pnt2d& UV1,
0282 const gp_Pnt2d& UV2,
0283 occ::handle<Geom2d_Curve>& Pcurv,
0284 const double Pardeb,
0285 const double Parfin,
0286 const bool reverse = false);
0287
0288 bool ChFi3d_IntTraces(const occ::handle<ChFiDS_SurfData>& fd1,
0289 const double pref1,
0290 double& p1,
0291 const int jf1,
0292 const int sens1,
0293 const occ::handle<ChFiDS_SurfData>& fd2,
0294 const double pref2,
0295 double& p2,
0296 const int jf2,
0297 const int sens2,
0298 const gp_Pnt2d& RefP2d,
0299 const bool Check2dDistance = false,
0300 const bool enlarge = false);
0301
0302 bool ChFi3d_IsInFront(TopOpeBRepDS_DataStructure& DStr,
0303 const occ::handle<ChFiDS_Stripe>& cd1,
0304 const occ::handle<ChFiDS_Stripe>& cd2,
0305 const int i1,
0306 const int i2,
0307 const int sens1,
0308 const int sens2,
0309 double& p1,
0310 double& p2,
0311 TopoDS_Face& face,
0312 bool& sameside,
0313 int& jf1,
0314 int& jf2,
0315 bool& visavis,
0316 const TopoDS_Vertex& Vtx,
0317 const bool Check2dDistance = false,
0318 const bool enlarge = false);
0319
0320 void ChFi3d_ProjectPCurv(const occ::handle<Adaptor3d_Curve>& HCg,
0321 const occ::handle<Adaptor3d_Surface>& HSg,
0322 occ::handle<Geom2d_Curve>& Pcurv,
0323 const double tol3d,
0324 double& tolreached);
0325
0326 void ChFi3d_ReparamPcurv(const double Uf, const double Ul, occ::handle<Geom2d_Curve>& Pcurv);
0327
0328 void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
0329 const gp_Pnt2d& UV1,
0330 const ChFiDS_CommonPoint& P2,
0331 const gp_Pnt2d& UV2,
0332 const occ::handle<Geom_Surface>& Surf,
0333 occ::handle<Geom_Curve>& C3d,
0334 occ::handle<Geom2d_Curve>& Pcurv,
0335 double& Pardeb,
0336 double& Parfin,
0337 const double tol3d,
0338 const double tol2d,
0339 double& tolreached,
0340 const int IFlag);
0341
0342 occ::handle<TopOpeBRepDS_SurfaceCurveInterference> ChFi3d_FilCurveInDS(
0343 const int Icurv,
0344 const int Isurf,
0345 const occ::handle<Geom2d_Curve>& Pcurv,
0346 const TopAbs_Orientation Et);
0347
0348 TopAbs_Orientation ChFi3d_TrsfTrans(const IntSurf_TypeTrans T1);
0349
0350 Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP,
0351 const IntSurf_TypeTrans TransLine,
0352 const bool Start,
0353 ChFiDS_CommonPoint& CP,
0354 const double Tol);
0355
0356 int ChFi3d_SolidIndex(const occ::handle<ChFiDS_Spine>& sp,
0357 TopOpeBRepDS_DataStructure& DStr,
0358 ChFiDS_Map& MapESo,
0359 ChFiDS_Map& MapESh);
0360
0361 int ChFi3d_IndexPointInDS(const ChFiDS_CommonPoint& P1, TopOpeBRepDS_DataStructure& DStr);
0362
0363 occ::handle<TopOpeBRepDS_CurvePointInterference> ChFi3d_FilPointInDS(const TopAbs_Orientation Et,
0364 const int Ic,
0365 const int Ip,
0366 const double Par,
0367 const bool IsVertex = false);
0368
0369 occ::handle<TopOpeBRepDS_CurvePointInterference> ChFi3d_FilVertexInDS(const TopAbs_Orientation Et,
0370 const int Ic,
0371 const int Ip,
0372 const double Par);
0373
0374 void ChFi3d_FilDS(const int SolidIndex,
0375 const occ::handle<ChFiDS_Stripe>& CorDat,
0376 TopOpeBRepDS_DataStructure& DStr,
0377 NCollection_List<ChFiDS_Regul>& reglist,
0378 const double tol3d,
0379 const double tol2d);
0380
0381 void ChFi3d_StripeEdgeInter(const occ::handle<ChFiDS_Stripe>& theStripe1,
0382 const occ::handle<ChFiDS_Stripe>& theStripe2,
0383 TopOpeBRepDS_DataStructure& DStr,
0384 const double tol2d);
0385
0386 int ChFi3d_IndexOfSurfData(const TopoDS_Vertex& V1,
0387 const occ::handle<ChFiDS_Stripe>& CD,
0388 int& sens);
0389
0390 TopoDS_Edge ChFi3d_EdgeFromV1(const TopoDS_Vertex& V1,
0391 const occ::handle<ChFiDS_Stripe>& CD,
0392 int& sens);
0393
0394 double ChFi3d_ConvTol2dToTol3d(const occ::handle<Adaptor3d_Surface>& S, const double tol2d);
0395
0396 bool ChFi3d_ComputeCurves(const occ::handle<Adaptor3d_Surface>& S1,
0397 const occ::handle<Adaptor3d_Surface>& S2,
0398 const NCollection_Array1<double>& Pardeb,
0399 const NCollection_Array1<double>& Parfin,
0400 occ::handle<Geom_Curve>& C3d,
0401 occ::handle<Geom2d_Curve>& Pc1,
0402 occ::handle<Geom2d_Curve>& Pc2,
0403 const double tol3d,
0404 const double tol2d,
0405 double& tolreached,
0406 const bool wholeCurv = true);
0407
0408 bool ChFi3d_IntCS(const occ::handle<Adaptor3d_Surface>& S,
0409 const occ::handle<Adaptor3d_Curve>& C,
0410 gp_Pnt2d& p2dS,
0411 double& wc);
0412
0413 void ChFi3d_ComputesIntPC(const ChFiDS_FaceInterference& Fi1,
0414 const ChFiDS_FaceInterference& Fi2,
0415 const occ::handle<GeomAdaptor_Surface>& HS1,
0416 const occ::handle<GeomAdaptor_Surface>& HS2,
0417 double& UInt1,
0418 double& UInt2);
0419
0420 void ChFi3d_ComputesIntPC(const ChFiDS_FaceInterference& Fi1,
0421 const ChFiDS_FaceInterference& Fi2,
0422 const occ::handle<GeomAdaptor_Surface>& HS1,
0423 const occ::handle<GeomAdaptor_Surface>& HS2,
0424 double& UInt1,
0425 double& UInt2,
0426 gp_Pnt& P);
0427
0428 occ::handle<GeomAdaptor_Surface> ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DStr,
0429 const occ::handle<ChFiDS_SurfData>& Fd1,
0430 const int& IFaCo1,
0431 const int& IFaArc1);
0432
0433 int ChFi3d_SearchPivot(int* s, double u[3][3], const double t);
0434
0435 bool ChFi3d_SearchFD(TopOpeBRepDS_DataStructure& DStr,
0436 const occ::handle<ChFiDS_Stripe>& cd1,
0437 const occ::handle<ChFiDS_Stripe>& cd2,
0438 const int sens1,
0439 const int sens2,
0440 int& i1,
0441 int& i2,
0442 double& p1,
0443 double& p2,
0444 const int ind1,
0445 const int ind2,
0446 TopoDS_Face& face,
0447 bool& sameside,
0448 int& jf1,
0449 int& jf2);
0450
0451 void ChFi3d_Parameters(const occ::handle<Geom_Surface>& S, const gp_Pnt& p3d, double& u, double& v);
0452
0453 void ChFi3d_TrimCurve(const occ::handle<Geom_Curve>& gc,
0454 const gp_Pnt& FirstP,
0455 const gp_Pnt& LastP,
0456 occ::handle<Geom_TrimmedCurve>& gtc);
0457
0458 Standard_EXPORT void ChFi3d_PerformElSpine(occ::handle<ChFiDS_ElSpine>& HES,
0459 occ::handle<ChFiDS_Spine>& Spine,
0460 const GeomAbs_Shape continuity,
0461 const double tol,
0462 const bool IsOffset = false);
0463
0464 TopoDS_Face ChFi3d_EnlargeFace(const occ::handle<ChFiDS_Spine>& Spine,
0465 const occ::handle<BRepAdaptor_Surface>& HS,
0466 const double Tol);
0467
0468 void ChFi3d_cherche_face1(const NCollection_List<TopoDS_Shape>& map,
0469 const TopoDS_Face& F1,
0470 TopoDS_Face& F);
0471
0472 void ChFi3d_cherche_element(const TopoDS_Vertex& V,
0473 const TopoDS_Edge& E1,
0474 const TopoDS_Face& F1,
0475 TopoDS_Edge& E,
0476 TopoDS_Vertex& Vtx);
0477
0478 double ChFi3d_EvalTolReached(const occ::handle<Adaptor3d_Surface>& S1,
0479 const occ::handle<Geom2d_Curve>& pc1,
0480 const occ::handle<Adaptor3d_Surface>& S2,
0481 const occ::handle<Geom2d_Curve>& pc2,
0482 const occ::handle<Geom_Curve>& C);
0483
0484 void ChFi3d_cherche_edge(const TopoDS_Vertex& V,
0485 const NCollection_Array1<TopoDS_Shape>& E1,
0486 const TopoDS_Face& F1,
0487 TopoDS_Edge& E,
0488 TopoDS_Vertex& Vtx);
0489
0490 int ChFi3d_nbface(const NCollection_List<TopoDS_Shape>& mapVF);
0491
0492 void ChFi3d_edge_common_faces(const NCollection_List<TopoDS_Shape>& mapEF,
0493 TopoDS_Face& F1,
0494 TopoDS_Face& F2);
0495
0496 double ChFi3d_AngleEdge(const TopoDS_Vertex& Vtx, const TopoDS_Edge& E1, const TopoDS_Edge& E2);
0497
0498 void ChFi3d_ChercheBordsLibres(const ChFiDS_Map& myVEMap,
0499 const TopoDS_Vertex& V1,
0500 bool& bordlibre,
0501 TopoDS_Edge& edgelibre1,
0502 TopoDS_Edge& edgelibre2);
0503
0504 int ChFi3d_NbNotDegeneratedEdges(const TopoDS_Vertex& Vtx, const ChFiDS_Map& VEMap);
0505 int ChFi3d_NumberOfEdges(const TopoDS_Vertex& Vtx, const ChFiDS_Map& VEMap);
0506
0507 int ChFi3d_NumberOfSharpEdges(const TopoDS_Vertex& Vtx,
0508 const ChFiDS_Map& VEMap,
0509 const ChFiDS_Map& EFmap);
0510
0511 void ChFi3d_cherche_vertex(const TopoDS_Edge& E1,
0512 const TopoDS_Edge& E2,
0513 TopoDS_Vertex& vertex,
0514 bool& trouve);
0515
0516 void ChFi3d_Couture(const TopoDS_Face& F, bool& couture, TopoDS_Edge& edgecouture);
0517
0518 void ChFi3d_CoutureOnVertex(const TopoDS_Face& F,
0519 const TopoDS_Vertex& V,
0520 bool& couture,
0521 TopoDS_Edge& edgecouture);
0522
0523 bool ChFi3d_IsPseudoSeam(const TopoDS_Edge& E, const TopoDS_Face& F);
0524
0525 occ::handle<Geom_BSplineCurve> ChFi3d_ApproxByC2(const occ::handle<Geom_Curve>& C);
0526
0527 bool ChFi3d_IsSmooth(const occ::handle<Geom_Curve>& C);
0528
0529 #endif