00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "general-tools.hh"
00025 #include "plane.hh"
00026 #include "bounding-box.hh"
00027
00028
00029 #include "message-macros.hh"
00030
00031 using namespace std;
00032 using namespace GMap3d;
00033
00034
00035 #define a0 FMap->alpha0
00036 #define a1 FMap->alpha1
00037 #define a2 FMap->alpha2
00038 #define a3 FMap->alpha3
00039
00040 #define VTX(d) (AVertexDI < 0 ? FMap->findVertex(d) : \
00041 (CAttributeVertex*)FMap->getDirectInfo(d, AVertexDI))
00042
00043 CGeneralTools::CGeneralTools(CGMapVertex * AMap, TCoordinate AEpsilon)
00044 : FMap(AMap), FEps(AEpsilon)
00045 {
00046 FEps2 = FEps * FEps;
00047 }
00048
00049 CGeneralTools::~CGeneralTools()
00050 {
00051 }
00052
00053 CVertex CGeneralTools::normalizeVector(const CVertex & AVector)
00054 {
00055 TCoordinate n = AVector.norm();
00056 CVertex v;
00057
00058 if (n <= FEps)
00059 return ORIGIN;
00060
00061
00062
00063 v.setX(AVector.getX() / n);
00064 v.setY(AVector.getY() / n);
00065 v.setZ(AVector.getZ() / n);
00066
00067 return v;
00068 }
00069
00070 bool CGeneralTools::isVectorNull(const CVertex & AVector)
00071 {
00072 return AVector.norm() <= FEps;
00073 }
00074
00075 bool CGeneralTools::areVectorsColinear(const CVertex & AVector1,
00076 const CVertex & AVector2)
00077 {
00078 if (AVector1 * AVector2 != ORIGIN)
00079 return false;
00080 else
00081 return AVector1.dot(AVector2) > 0.0;
00082 }
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 TCoordinate CGeneralTools::pointParameterOnLine(const CVertex & APoint,
00103 const CVertex & ALineVertex1,
00104 const CVertex & ALineVertex2)
00105 {
00106 CVertex v1 = ALineVertex2 - ALineVertex1;
00107 CVertex v2 = APoint - ALineVertex1;
00108
00109 #ifdef WARNING_MESSAGES
00110 if (isVectorNull(v1))
00111 WARN_BB("<CGeneralTools::pointParameterOnLine> "
00112 << "Le vecteur est de longueur nulle : " << v1);
00113 #endif
00114
00115 return v1.dot(v2) / v1.sqrNorm();
00116 }
00117
00118 TCoordinate CGeneralTools::squareDistanceToLine(const CVertex & APoint,
00119 const CVertex & ALineVertex1,
00120 const CVertex & ALineVertex2)
00121 {
00122 CVertex v = ALineVertex2 - ALineVertex1;
00123
00124 #ifdef WARNING_MESSAGES
00125 if (isVectorNull(v))
00126 WARN_BB("<CGeneralTools::squareDistanceToLine> "
00127 << "Le vecteur est de longueur nulle : " << v);
00128 #endif
00129
00130 return (v * (APoint - ALineVertex1)).sqrNorm() / v.sqrNorm();
00131 }
00132
00133 TCoordinate CGeneralTools::squareDistanceToPlane(const CVertex & APoint,
00134 const CPlane & APlane)
00135 {
00136 CVertex v = APlane.getNormal();
00137 TCoordinate t=0;
00138
00139 #ifdef WARNING_MESSAGES
00140 if (isVectorNull(v))
00141 WARN_BB("<CGeneralTools::squareDistanceToPlane> "
00142 << "La normale est de longueur nulle : " << v);
00143 #endif
00144
00145 APlane.getLineIntersection(APoint, v, &t);
00146
00147 return (t * v).sqrNorm();
00148 }
00149
00150 TCoordinate
00151 CGeneralTools::squareDistanceBetweenLines(const CVertex & ALine1Vertex1,
00152 const CVertex & ALine1Vertex2,
00153 const CVertex & ALine2Vertex1,
00154 const CVertex & ALine2Vertex2,
00155 CPlane * AIntersectionPlane)
00156 {
00157 CVertex v1, v2, n;
00158
00159 v1 = ALine1Vertex2 - ALine1Vertex1;
00160 v2 = ALine2Vertex2 - ALine2Vertex1;
00161
00162 n = v1 * v2;
00163
00164 if (isVectorNull(n)) {
00165
00166 if (AIntersectionPlane != NULL)
00167 AIntersectionPlane->setPlane(0.0, 0.0, 0.0, 0.0);
00168
00169 return squareDistanceToLine(ALine2Vertex1, ALine1Vertex1, ALine1Vertex2);
00170 }
00171 else {
00172
00173 CPlane plane(n, ALine1Vertex1);
00174
00175 if (AIntersectionPlane != NULL)
00176 *AIntersectionPlane = plane;
00177
00178 return squareDistanceToPlane(ALine2Vertex1, plane);
00179 }
00180 }
00181
00182 bool CGeneralTools::getLinesIntersection(CVertex ALine1Point1,
00183 CVertex ALine1Point2,
00184 CVertex ALine2Point1,
00185 CVertex ALine2Point2,
00186 TCoordinate * ALine1Param,
00187 TCoordinate * ALine2Param,
00188 const CPlane & APlane)
00189 {
00190 TProjection proj = APlane.getBestProjection();
00191
00192 ALine1Point1 = APlane.projectPoint(ALine1Point1, proj);
00193 ALine1Point2 = APlane.projectPoint(ALine1Point2, proj);
00194 ALine2Point1 = APlane.projectPoint(ALine2Point1, proj);
00195 ALine2Point2 = APlane.projectPoint(ALine2Point2, proj);
00196
00197 CVertex v[2] = {ALine1Point2 - ALine1Point1, ALine2Point2 - ALine2Point1};
00198 TCoordinate d = v[0].getY() * v[1].getX() - v[0].getX() * v[1].getY();
00199 CVertex tmp = ALine1Point1 - ALine2Point1;
00200
00201 if (d == 0.0)
00202 return false;
00203
00204 *ALine1Param = (v[1].getY() * tmp.getX() - v[1].getX() * tmp.getY()) / d;
00205 *ALine2Param = (v[0].getY() * tmp.getX() - v[0].getX() * tmp.getY()) / d;
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 return true;
00218 }
00219
00220 bool CGeneralTools::arePointsEqual(const CVertex & APoint1,
00221 const CVertex & APoint2)
00222 {
00223 return fabs((APoint2 - APoint1).norm()) <= FEps;
00224 }
00225
00226 bool CGeneralTools::isPointOnLine(const CVertex & APoint,
00227 const CVertex & ALineVertex1,
00228 const CVertex & ALineVertex2)
00229 {
00230 return sqrt(squareDistanceToLine(APoint, ALineVertex1, ALineVertex2)) <= FEps;
00231 }
00232
00233 bool CGeneralTools::isPointOnPlane(const CVertex & APoint,
00234 const CPlane & APlane)
00235 {
00236
00237 return abs(APlane.pointDistance(APoint)) <= FEps;
00238 }
00239
00240 bool CGeneralTools::areLinesCrossing(const CVertex & ALine1Vertex1,
00241 const CVertex & ALine1Vertex2,
00242 const CVertex & ALine2Vertex1,
00243 const CVertex & ALine2Vertex2,
00244 CPlane * AIntersectionPlane)
00245 {
00246 return sqrt(squareDistanceBetweenLines(ALine1Vertex1, ALine1Vertex2,
00247 ALine2Vertex1, ALine2Vertex2,
00248 AIntersectionPlane)) <= FEps;
00249 }
00250
00251 CDart * CGeneralTools::alpha1(CDart * ADart)
00252 {
00253 if (!FMap->isFree1(ADart))
00254 return a1(ADart);
00255 else {
00256 CDart *d = a2(ADart);
00257
00258 while (!FMap->isFree1(d)) {
00259 d = a2(a1(d));
00260 }
00261
00262 return d;
00263 }
00264 }
00265
00266 CDart * CGeneralTools::alpha2(CDart * ADart)
00267 {
00268 if (!FMap->isFree2(ADart))
00269 return a2(ADart);
00270 else {
00271 CDart *d = a3(ADart);
00272
00273 while (!FMap->isFree2(d)) {
00274 d = a3(a2(d));
00275 }
00276
00277 return d;
00278 }
00279 }
00280
00281 CVertex CGeneralTools::edgeVector(CDart * AEdge, int AVertexDI)
00282 {
00283 return *VTX(FMap->alpha0(AEdge)) - *VTX(AEdge);
00284 }
00285
00286 CVertex CGeneralTools::faceNormalVector(CDart * AFace, int AVertexDI)
00287 {
00288 CVertex normal(0.0, 0.0, 0.0);
00289 int mark = FMap->getNewMark();
00290 CVertex pt;
00291
00292 pt = *VTX(AFace);
00293 FMap->halfMarkOrbit(AFace, ORBIT_01, mark);
00294 FMap->unsetMark(AFace, mark);
00295 FMap->unsetMark(a0(a1(AFace)), mark);
00296
00297 for (CDynamicCoverage01 cov(FMap, AFace); cov.cont(); ++cov)
00298 if (FMap->isMarked(*cov, mark)) {
00299 FMap->unsetMark(*cov, mark);
00300 normal += (*VTX(*cov) - pt) * (*VTX(a0(*cov)) - pt);
00301 }
00302
00303 FMap->freeMark(mark);
00304
00305 return normal;
00306 }
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354 CVertex CGeneralTools::fastFaceNormalVector(CDart * AFace, int AVertexDI)
00355 {
00356 CVertex v = *VTX(AFace);
00357 CVertex normal = (*VTX(a0(AFace)) - v) * (*VTX(a0(a1(AFace))) - v);
00358
00359
00360
00361 return normal;
00362 }
00363
00364 CVertex CGeneralTools::vertexNormalVector(CDart * AVertex, int AVertexDI)
00365 {
00366 int mark = FMap->getNewMark();
00367 int nb = 0;
00368 CVertex normal(0.0, 0.0, 0.0);
00369
00370 FMap->halfMarkOrbit(AVertex, ORBIT_12, mark);
00371
00372 for (CDynamicCoverage12 dc(FMap, AVertex); dc.cont(); ++dc) {
00373 if (FMap->isMarked(*dc, mark)) {
00374 FMap->unsetMark(*dc, mark);
00375
00376 normal += faceNormalVector(*dc, AVertexDI);
00377 nb++;
00378 }
00379 }
00380
00381 FMap->freeMark(mark);
00382
00383 return (nb > 1) ? normal / nb : normal;
00384 }
00385
00386 CVertex CGeneralTools::fastVertexNormalVector(CDart * AVertex, int AVertexDI)
00387 {
00388 int mark = FMap->getNewMark();
00389 int nb = 0;
00390 CVertex normal(0.0, 0.0, 0.0);
00391
00392 FMap->halfMarkOrbit(AVertex, ORBIT_12, mark);
00393
00394 for (CDynamicCoverage12 dc(FMap, AVertex); dc.cont(); ++dc) {
00395 if (FMap->isMarked(*dc, mark)) {
00396 FMap->unsetMark(*dc, mark);
00397
00398 normal += fastFaceNormalVector(*dc, AVertexDI);
00399 nb++;
00400 }
00401 }
00402
00403 FMap->freeMark(mark);
00404
00405 return (nb > 1) ? normal / nb : normal;
00406 }
00407
00408 CPlane CGeneralTools::facePlane(CDart * AFace, int AVertexDI)
00409 {
00410 return CPlane(faceNormalVector(AFace, AVertexDI),
00411 FMap->barycenter(AFace, ORBIT_01, AVertexDI));
00412 }
00413
00414 CBoundingBox CGeneralTools::orbitBoundingBox(CDart * ADart, TOrbit AOrbit,
00415 int AVertexDI)
00416 {
00417 CBoundingBox bb;
00418 int mark = FMap->getNewMark();
00419 CCoverage *cov = FMap->getDynamicCoverage(ADart, AOrbit);
00420
00421 for (cov->reinit(); cov->cont(); ++(*cov))
00422 if (!FMap->isMarked(**cov, mark)) {
00423 FMap->markOrbit(**cov, ORBIT_VERTEX & AOrbit, mark);
00424 bb.addPoint(*VTX(**cov));
00425 }
00426
00427 for (cov->reinit(); cov->cont(); ++(*cov))
00428 FMap->unsetMark(**cov, mark);
00429
00430 delete cov;
00431
00432 FMap->freeMark(mark);
00433
00434 return bb;
00435 }
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483 CVertex CGeneralTools::regionNormalVector(CDart * ADart, TOrbit AOrbit,
00484 unsigned int ARegionSize,
00485 int ARegionMark, int AVertexDI)
00486 {
00487 CVertex normal(0.0, 0.0, 0.0);
00488 list<CDart*> *current_faces = new list<CDart*>;
00489 list<CDart*> *next_faces;
00490 list<CDart*> old_faces;
00491 list<CDart*>::iterator it;
00492 CDart *d;
00493 int mark = FMap->getNewMark();
00494
00495 CCoverage *cov = FMap->getDynamicCoverage(ADart, AOrbit);
00496 int tmp_mark = FMap->getNewMark();
00497 FMap->halfMarkOrbit(ADart, AOrbit, tmp_mark);
00498 for (; cov->cont(); ++(*cov))
00499 if (FMap->isMarked(**cov, tmp_mark)) {
00500 assert(!FMap->isMarked(**cov, mark));
00501 FMap->unmarkOrbit(**cov, ORBIT_01, tmp_mark);
00502 if (ARegionMark < 0 || FMap->isMarked(**cov, ARegionMark)) {
00503 normal += faceNormalVector(**cov, AVertexDI);
00504 current_faces->push_back(**cov);
00505 FMap->halfMarkOrbit(**cov, ORBIT_01, mark);
00506 }
00507 }
00508 delete cov;
00509
00510 FMap->freeMark(tmp_mark);
00511
00512 for (unsigned int i = 0; i < ARegionSize; ++i) {
00513 next_faces = new list<CDart*>;
00514 while (!current_faces->empty()) {
00515 d = current_faces->front();
00516 current_faces->pop_front();
00517 old_faces.push_back(d);
00518 for (CDynamicCoverage01 cov(FMap, d); cov.cont(); ++cov)
00519 if (FMap->isMarked(*cov, mark) && !FMap->isFree2(*cov)) {
00520 d = a0(a2(*cov));
00521 if (!FMap->isMarked(d, mark) &&
00522 (ARegionMark < 0 || FMap->isMarked(d, ARegionMark))) {
00523 normal += faceNormalVector(d, AVertexDI);
00524 next_faces->push_back(d);
00525 FMap->halfMarkOrbit(d, ORBIT_01, mark);
00526 }
00527 }
00528 }
00529 delete current_faces;
00530 current_faces = next_faces;
00531 }
00532
00533 for (it = old_faces.begin(); it != old_faces.end(); ++it)
00534 FMap->unmarkOrbit(*it, ORBIT_01, mark);
00535 for (it = current_faces->begin(); it != current_faces->end(); ++it)
00536 FMap->unmarkOrbit(*it, ORBIT_01, mark);
00537 delete current_faces;
00538
00539
00540 FMap->freeMark(mark);
00541
00542 return normal;
00543 }
00544
00545 void CGeneralTools::displayEdgeVertices(CDart * ADart, int AVertexDI)
00546 {
00547 cout << "Edge : (" << *VTX(ADart) << ";"
00548 << *VTX(a0(ADart)) << ")\n";
00549 }
00550
00551 void CGeneralTools::displayFaceVertices(CDart * ADart, int AVertexDI)
00552 {
00553 cout << "Face : (";
00554
00555 cout << *VTX(ADart);
00556
00557 for (CDart * d = a1(a0(ADart)) ; d != ADart ; d = a1(a0(d)))
00558 cout << ";" << *VTX(d);
00559
00560 cout << ")\n";
00561 }
00562
00563 #define SIDE1(d) ((CDart*)FMap->getDirectInfo(d, Side1DI))
00564 #define SIDE2(d) ((CDart*)FMap->getDirectInfo(d, Side2DI))
00565
00566 CDart * CGeneralTools::thickenVolume(CDart * AVolume, TCoordinate AThick,
00567 int ABorderSteps, int AVertexDI)
00568 {
00569 assert(ABorderSteps >= 0);
00570
00571 int mark = FMap->getNewMark();
00572 int Side1DI = FMap->getNewDirectInfo();
00573 int Side2DI = FMap->getNewDirectInfo();
00574
00575 CVertex face_normal, pt;
00576 CDart *d;
00577
00578 CDynamicCoverageVolume dcv(FMap, AVolume);
00579
00580 for (dcv.reinit(); dcv.cont(); ++dcv)
00581 FMap->setMark(*dcv, mark);
00582
00583
00584 FMap->CGMapGeneric::thickenMarkedDarts(mark, Side1DI, Side2DI);
00585
00586
00587 FMap->halfMarkOrbit(SIDE1(AVolume), ORBIT_CC, mark);
00588
00589
00590 for (dcv.reinit(); dcv.cont(); ++dcv) {
00591 if (FMap->isMarked(*dcv, mark) && FMap->isMarked(SIDE1(*dcv), mark)) {
00592
00593
00594 d = NULL;
00595 for (CDynamicCoverage12 cov(FMap, *dcv); cov.cont() && d == NULL; ++cov)
00596 if (FMap->isFree2(SIDE1(*cov)))
00597 d = *cov;
00598
00599
00600 if (d == NULL) {
00601 FMap->unmarkOrbit(*dcv, ORBIT_12, mark);
00602
00603 pt = *VTX(*dcv);
00604
00605 face_normal = vertexNormalVector(*dcv, AVertexDI);
00606 face_normal = normalizeVector(face_normal);
00607
00608 FMap->updateVertex(SIDE1(*dcv), pt + face_normal * AThick);
00609 FMap->updateVertex(SIDE2(*dcv), pt - face_normal * AThick);
00610 }
00611
00612 else {
00613 thickenBorder(d, mark, AThick, ABorderSteps,
00614 Side1DI, Side2DI, AVertexDI);
00615 }
00616 }
00617 }
00618
00619
00620 FMap->unmarkOrbit(SIDE1(AVolume), ORBIT_VOLUME, mark);
00621
00622 d = SIDE1(AVolume);
00623
00624
00625 for (dcv.reinit() ; dcv.cont() ; dcv++) {
00626 FMap->setDirectInfo(*dcv, Side1DI, NULL);
00627 FMap->setDirectInfo(*dcv, Side2DI, NULL);
00628 }
00629
00630 FMap->freeDirectInfo(Side1DI);
00631 FMap->freeDirectInfo(Side2DI);
00632
00633 FMap->freeMark(mark);
00634
00635 return d;
00636 }
00637
00638 #undef SIDE1
00639 #undef SIDE2
00640
00641
00642 void CGeneralTools::thickenBorder(CDart * ABorder, int AMark,
00643 TCoordinate AThick, int ASteps,
00644 int ASide1DI, int ASide2DI, int AVertexDI)
00645 {
00646 #define SIDE1(d) ((CDart*)FMap->getDirectInfo(d, ASide1DI))
00647 #define SIDE2(d) ((CDart*)FMap->getDirectInfo(d, ASide2DI))
00648
00649 CVertex face_normal, edge_normal, pt, v, v1, v2;
00650 CDart *d[2], *tmp_d[2], *old_d[2], *new_d[8];
00651 int i, j;
00652
00653 d[0] = ABorder;
00654
00655 d[1] = a1(d[0]);
00656 while (!FMap->isFree2(d[1]))
00657 d[1] = a1(a2(d[1]));
00658
00659 do {
00660 FMap->unmarkOrbit(d[0], ORBIT_12, AMark);
00661
00662 pt = *VTX(d[0]);
00663
00664 face_normal = vertexNormalVector(d[0], AVertexDI);
00665 face_normal = normalizeVector(face_normal);
00666
00667 tmp_d[0] = SIDE1(d[0]);
00668 tmp_d[1] = a1(tmp_d[0]);
00669 while (!FMap->isFree2(tmp_d[1]))
00670 tmp_d[1] = a1(a2(tmp_d[1]));
00671
00672
00673
00674
00675
00676
00677
00678 old_d[0] = tmp_d[0];
00679 old_d[1] = tmp_d[1];
00680
00681
00682 for (i=0 ; i<ASteps+1 ; i++) {
00683
00684 for (j=0 ; j<8 ; j++)
00685 new_d[j] = FMap->addMapDart();
00686
00687 FMap->linkAlpha1(new_d[0], new_d[1]);
00688 FMap->linkAlpha0(new_d[1], new_d[2]);
00689 FMap->linkAlpha1(new_d[2], new_d[3]);
00690
00691 FMap->linkAlpha1(new_d[4], new_d[5]);
00692 FMap->linkAlpha0(new_d[5], new_d[6]);
00693 FMap->linkAlpha1(new_d[6], new_d[7]);
00694
00695 FMap->linkAlpha2(new_d[1], new_d[5]);
00696 FMap->linkAlpha2(new_d[2], new_d[6]);
00697
00698 FMap->linkAlpha2(old_d[0], new_d[0]);
00699 FMap->linkAlpha2(old_d[1], new_d[4]);
00700
00701 old_d[0] = new_d[3];
00702 old_d[1] = new_d[7];
00703 }
00704
00705 FMap->linkAlpha2(old_d[0], SIDE2(d[0]));
00706 if (tmp_d[1] == SIDE1(d[1]))
00707 FMap->linkAlpha2(old_d[1], SIDE2(d[1]));
00708 else
00709 FMap->linkAlpha2(old_d[1], SIDE1(d[1]));
00710
00711
00712 if (!FMap->isFree2(a0(tmp_d[0])) &&
00713 FMap->isFree0(a2(tmp_d[0]))) {
00714
00715 old_d[0] = tmp_d[0];
00716 old_d[1] = a0(tmp_d[0]);
00717
00718 for (int i=0 ; i<ASteps+1 ; i++) {
00719 old_d[0] = a2(old_d[0]);
00720 old_d[1] = a2(old_d[1]);
00721
00722 FMap->linkAlpha0(old_d[0], old_d[1]);
00723
00724 old_d[0] = a1(a0(a1(old_d[0])));
00725 old_d[1] = a1(a0(a1(old_d[1])));
00726
00727 FMap->linkAlpha0(old_d[0], old_d[1]);
00728 }
00729 }
00730
00731
00732 if (!FMap->isFree2(a0(tmp_d[1])) &&
00733 FMap->isFree0(a2(tmp_d[1]))) {
00734
00735 old_d[0] = tmp_d[1];
00736 old_d[1] = a0(tmp_d[1]);
00737
00738 for (i=0 ; i<ASteps+1 ; i++) {
00739 old_d[0] = a2(old_d[0]);
00740 old_d[1] = a2(old_d[1]);
00741
00742 FMap->linkAlpha0(old_d[0], old_d[1]);
00743
00744 old_d[0] = a1(a0(a1(old_d[0])));
00745 old_d[1] = a1(a0(a1(old_d[1])));
00746
00747 FMap->linkAlpha0(old_d[0], old_d[1]);
00748 }
00749 }
00750
00751
00752 FMap->updateVertex(SIDE1(d[0]), pt + face_normal * AThick);
00753 FMap->updateVertex(SIDE2(d[0]), pt - face_normal * AThick);
00754
00755 v1 = (*VTX(a0(d[0])) - pt) * face_normal;
00756 v2 = face_normal * (*VTX(a0(d[1])) - pt);
00757
00758 v1 = normalizeVector(v1);
00759 v2 = normalizeVector(v2);
00760
00761 edge_normal = v1 + v2;
00762
00763 edge_normal = normalizeVector(edge_normal);
00764 if (!isZero(edge_normal.dot(v1)))
00765 edge_normal /= edge_normal.dot(v1);
00766
00767 tmp_d[1] = a2(tmp_d[0]);
00768 for (int i=0 ; i<ASteps ; i++) {
00769 tmp_d[1] = a2(a1(a0(a1(tmp_d[1]))));
00770
00771 v = (cos(((i+1) * M_PI) / (ASteps+1)) * face_normal +
00772 sin(((i+1) * M_PI) / (ASteps+1)) * edge_normal);
00773
00774 FMap->setVertex(tmp_d[1], pt + v * AThick);
00775 }
00776
00777 d[0] = a0(d[1]);
00778 d[1] = a1(d[0]);
00779 while (!FMap->isFree2(d[1]))
00780 d[1] = a1(a2(d[1]));
00781 }
00782 while (d[0] != ABorder);
00783
00784 #undef SIDE1
00785 #undef SIDE2
00786 }
00787
00788
00789