Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
polyline.cpp
Go to the documentation of this file.
2
3/*
4Copyright (c) 2000 Igor B. Smirnov
5
6The file can be used, copied, modified, and distributed
7according to the terms of GNU Lesser General Public License version 2.1
8as published by the Free Software Foundation,
9and provided that the above copyright notice, this permission notice,
10and notices about any modifications of the original text
11appear in all copies and in supporting documentation.
12The file is provided "as is" without express or implied warranty.
13*/
14
15namespace Heed {
16
17// **** polyline ****
19 aref_tran.pass(new absref_transmit(qpt + qsl, aref));
20}
21
23 mfunname("polyline::polyline( polyline &pl)");
24 polyline_init(pl.pt, pl.qpt);
25}
27 mfunname("polyline::polyline(const polyline &pl)");
28 polyline_init(pl.pt, pl.qpt);
29}
30polyline::polyline(const point* fpt, int fqpt) {
31 mfunname("polyline::polyline(const point* fpt, int fqpt)");
32 polyline_init(fpt, fqpt);
33}
34polyline::polyline(const point& fpt1, const point& fpt2) {
35 // interval
36 mfunname("polyline::polyline(const point& fpt1, const point& fpt2)");
37 point fpt[2];
38 fpt[0] = fpt1;
39 fpt[1] = fpt2;
40 polyline_init(fpt, 2);
41}
42
44 mfunname("polyline& polyline::operator=(const polyline& fpl)");
46 polyline_init(fpl.pt, fpl.qpt);
47 return *this;
48}
49
50void polyline::polyline_init(const point* fpt, int fqpt) {
51 pvecerror("void polyline::polyline_init(const point* fpt, int fqpt)");
52 check_econd11(fqpt, < 0, mcerr)
53 if (fqpt < 1) {
54 qpt = 0;
55 qsl = 0;
56 pt = NULL;
57 sl = NULL;
58 aref = NULL;
59 return;
60 }
61 pt = new point[fqpt];
62 for (qpt = 0; qpt < fqpt; ++qpt) pt[qpt] = fpt[qpt];
63 if (fqpt >= 2) {
64 sl = new straight[qpt - 1];
65 for (qsl = 0; qsl < qpt - 1; ++qsl) {
66 sl[qsl] = straight(pt[qsl], pt[qsl + 1]);
67 }
68 } else {
69 sl = NULL;
70 }
71 aref = new absref* [qpt + qsl];
72 for (int n = 0; n < qpt; ++n) aref[n] = &pt[n];
73 for (int n = 0; n < qsl; ++n) aref[n + qpt] = &sl[n];
74}
75
76int polyline::check_point_in(const point& fpt, vfloat prec) const {
77 pvecerror("int polyline::check_point_in(point& fpt, vfloat prec)");
78 for (int n = 0; n < qpt; ++n) {
79 if (apeq(pt[n], fpt, prec)) return 1;
80 }
81 for (int n = 0; n < qsl; ++n) {
82 if (sl[n].check_point_in(fpt, prec) == 1) {
83 vec v1 = fpt - pt[n];
84 vec v2 = fpt - pt[n + 1];
85 if (check_par(v1, v2, prec) == -1) {
86 // anti-parallel vectors, point inside borders
87 return 2;
88 }
89 }
90 }
91 return 0;
92}
93
94int polyline::cross(const straight& fsl, point* pc, int& qpc, polyline* pl,
95 int& qpl, vfloat prec) const {
96 pvecerror("void polyline::cross(const straight& fsl, ...)");
97 qpc = 0;
98 qpl = 0;
99 for (int n = 0; n < qsl; ++n) {
100 pc[qpc] = sl[n].cross(fsl, prec);
101 if (vecerror == 1 || vecerror == 2) {
102 // lines do not cross
103 vecerror = 0;
104 } else if (vecerror == 3) {
105 // the same straight line
106 pl[qpl++] = polyline(&(pt[n]), 2);
107 } else {
108 vec v1 = pc[qpc] - pt[n];
109 if (v1.length() < prec) {
110 qpc++;
111 } else {
112 vec v2 = pc[qpc] - pt[n + 1];
113 if (v2.length() < prec) {
114 qpc++;
115 } else if (check_par(v1, v2, prec) == -1) {
116 // anti-parallel vectors, point inside borders
117 qpc++;
118 }
119 }
120 }
121 }
122 if (qpc > 0 || qpl > 0) return 1;
123 return 0;
124}
125
127 pvecerror("vfloat polyline::dist_two_inter(polyline& pl)");
128 const polyline& pl1 = *this;
129 check_econd11(pl1.Gqpt(), != 2, mcerr);
130 check_econd11(pl2.Gqpt(), != 2, mcerr);
131 point cpt[2];
132 int type_of_cross;
133 vfloat sldist = pl1.Gsl(0).distance(pl2.Gsl(0), type_of_cross, cpt);
134 if (type_of_cross == 2 || type_of_cross == 3) return sldist;
135 if (pl1.check_point_in(cpt[0], prec) > 0 &&
136 pl2.check_point_in(cpt[1], prec) > 0)
137 return sldist;
138 vfloat mx = max_vfloat;
139 vfloat r;
140 if ((r = pl1.distance(pl2.Gpt(0))) < mx) mx = r;
141 if ((r = pl1.distance(pl2.Gpt(1))) < mx) mx = r;
142 if ((r = pl2.distance(pl1.Gpt(0))) < mx) mx = r;
143 if ((r = pl2.distance(pl1.Gpt(1))) < mx) mx = r;
144 return mx;
145}
146
147vfloat polyline::distance(const point& fpt) const {
148 pvecerror("vfloat polyline::distance(const point& fpt) const");
149 check_econd11(qsl, <= 0, mcerr);
150 vfloat sldist;
151 point cpt;
152 vfloat mx = max_vfloat;
153 int n;
154 for (n = 0; n < qsl; n++) {
155 sldist = sl[n].distance(fpt, cpt);
156 vec v1 = cpt - pt[n];
157 vec v2 = cpt - pt[n + 1];
158 if (check_par(v1, v2, 0.01) ==
159 -1) { // anti-parallel vectors, point inside borders
160 if (sldist < mx) mx = sldist;
161 } else {
162 if ((sldist = (fpt - pt[n]).length()) < mx) mx = sldist;
163 if ((sldist = (fpt - pt[n + 1]).length()) < mx) mx = sldist;
164 }
165 }
166 return mx;
167}
168
169vfloat polyline::distance(const point& fpt, point& fcpt) const {
170 pvecerror("vfloat polyline::distance(const point& fpt) const");
171 check_econd11(qsl, <= 0, mcerr);
172 vfloat sldist;
173 point cpt;
174 vfloat mx = max_vfloat;
175 int n;
176 for (n = 0; n < qsl; n++) {
177 sldist = sl[n].distance(fpt, cpt);
178 vec v1 = cpt - pt[n];
179 vec v2 = cpt - pt[n + 1];
180 if (check_par(v1, v2, 0.01) ==
181 -1) { // anti-parallel vectors, point inside borders
182 if (sldist < mx) {
183 mx = sldist;
184 fcpt = cpt;
185 }
186 } else {
187 if ((sldist = (fpt - pt[n]).length()) < mx) {
188 mx = sldist;
189 fcpt = pt[n];
190 }
191 if ((sldist = (fpt - pt[n + 1]).length()) < mx) {
192 mx = sldist;
193 fcpt = pt[n + 1];
194 }
195 }
196 }
197 return mx;
198}
199
200int cross4pllines(const polyline pl[4], vfloat precision, straight& sl,
201 point ptc[4][2]) {
202 pvecerror(
203 "int cross4pllines(const polyline pl[4], straight& sl, point ptc[4][2])");
204 int n;
205 straight slpl[4];
206 for (n = 0; n < 4; n++) slpl[n] = pl[n].Gsl(0);
207 point pt[2];
208 pt[0] = (pl[1].Gpt(0).v + pl[1].Gpt(1).v) * 0.5;
209 pt[1] = (pl[2].Gpt(0).v + pl[2].Gpt(1).v) * 0.5;
210 sl = straight(slpl, pt, precision);
211 int type_of_cross;
212 for (n = 0; n < 4; n++) {
213 sl.distance(pl[n].Gsl(0), type_of_cross, ptc[n]);
214 // distance should be little, it need to find points
215 if (pl[n].check_point_in(ptc[n][1], precision) == 0) // check sides
216 return 0;
217 }
218 return 1;
219}
220
221std::ostream& operator<<(std::ostream& file, const polyline& p) {
222 int n;
223 Ifile << "polyline:\n";
224 indn.n += 2;
225 Ifile << "qpt=" << p.qpt << '\n';
226 for (n = 0; n < p.qpt; n++) file << p.pt[n];
227 Ifile << "qsl=" << p.qsl << '\n';
228 for (n = 0; n < p.qsl; n++) file << p.sl[n];
229 indn.n -= 2;
230 return file;
231}
232// **** polyline in plane ****
233
235
237 aref_tran.pass(new absref_transmit(1, &aref_pl, qpt + qsl, aref));
238}
239
241 mfunname("polyline_pl::polyline_pl( polyline& pl)");
242 if (pl.Gqsl() < 2) {
243 mcerr << "error in polyline_pl(polyline& pl): qsl=" << Gqsl();
244 spexit(mcerr);
245 }
247 pn = plane(pl.Gsl(0).Gpiv(), pl.Gsl(0).Gdir() || pl.Gsl(1).Gdir());
248}
249
251 mfunname("polyline_pl::polyline_pl(const polyline& pl");
252 if (pl.Gqsl() < 2) {
253 mcerr << "error in polyline_pl(polyline& pl): qsl=" << Gqsl();
254 spexit(mcerr);
255 }
257 pn = plane(pl.Gsl(0).Gpiv(), pl.Gsl(0).Gdir() || pl.Gsl(1).Gdir());
258}
259
261 mfunname("polyline_pl& polyline_pl::operator=(const polyline_pl& fpl)");
262 polyline_del();
263 polyline_init(fpl.pt, fpl.qpt);
264 pn = fpl.pn;
265 return *this;
266}
267
268std::ostream& operator<<(std::ostream& file, const polyline_pl& p) {
269 Ifile << "polyline_pl:\n";
270 indn.n += 2;
271 file << p.pn;
272 // file << statcast(const polyline&, p);
273 file << static_cast<const polyline&>(p);
274 indn.n -= 2;
275 return file;
276}
277
278// **** polygon (in plane) ****
279
280polygon::polygon(const straight* fsl, int fqsl, vfloat prec)
281 : polyline_pl(), s_convex(1) {
282 pvecerror("polygon::polygon(const straight* fsl, int fqsl)");
283 check_econd11a(fqsl, < 3, "fqsl cannot be less 3\n", mcerr);
284 int n, m;
285 // now check that either the piv's of lines are not equal to each other,
286 // or the dir's are not parallel.
287 // It does not prove that input data are corrent, but more
288 // explicit prove might take too much time.
289 for (n = 0; n < fqsl - 1; n++)
290 for (m = n + 1; m < fqsl; m++) {
291 if (fsl[n].Gpiv() == fsl[m].Gpiv())
292 if (check_par(fsl[n].Gdir(), fsl[m].Gdir(), 0) !=
293 0) // 1 par, -1 antipar
294 {
295 mcerr << "error in polyline_init(straight* fsl, int fqsl):\n"
296 << "Parallel lines with the same pivot cannot form polygin\n";
297 for (int k = 0; k < fqsl; k++)
298 mcout << "n=" << k << " fsl[n]=" << fsl[k];
299 spexit(mcerr);
300 }
301 }
302 int qptl = fqsl + 1;
303 point* ptl = new point[qptl];
304 for (n = 1; n < fqsl; n++) {
305 ptl[n] = fsl[n - 1].cross(fsl[n], prec);
306 if (vecerror != 0) {
307 mcerr << "error in polygon::polygon(straight* fsl, int fqsl):\n"
308 << " straight lines are not crossed properly\n"
309 << "fsl[n-1]=" << fsl[n - 1] << "fsl[n]=" << fsl[n]
310 << "vecerror=" << vecerror << '\n';
311 spexit(mcerr);
312 }
313 }
314 ptl[0] = fsl[fqsl - 1].cross(fsl[0], prec);
315 if (vecerror != 0) {
316 mcerr << "error in polygon::polygon(straight* fsl, int fqsl):\n"
317 << " straight lines are not crossed properly\n"
318 << "fsl[fqsl-1]=" << fsl[fqsl - 1] << "fsl[0]=" << fsl[0]
319 << "vecerror=" << vecerror << '\n';
320 spexit(mcerr);
321 }
322 ptl[fqsl] = ptl[0];
323 plane pnl = plane(fsl[0].Gpiv(), fsl[0].Gdir() || fsl[1].Gdir());
324 polyline_pl pll(pnl, ptl, qptl);
325 *this = polygon(pll, 1);
326
327 delete[] ptl;
328}
329
331 mfunname("polygon& polygon::operator=(const polygon& fpl)");
332 polyline_del();
333 polyline_init(fpl.pt, fpl.qpt);
334 pn = fpl.pn;
335 s_convex = fpl.s_convex;
336 return *this;
337}
338
339int polygon::check_point_in(const point& fpt, vfloat prec) const {
340 pvecerror("int polygon::check_point_in(point& fpt)");
341 int i;
342 if ((i = polyline::check_point_in(fpt, prec)) > 0) {
343 return i;
344 }
345 if ((i = pn.check_point_in(fpt, prec)) == 0) {
346 return i;
347 }
348 /* The idea of the following algorithm is circulating around the polygon
349 and finding of two points, one gives the minimum angle relatively
350 some(any) direction, another gives the maximal angle.
351 The point resides inside polygon if they are the same at the end of
352 circulation.
353 */
354 point endpt[2];
355 endpt[0] = pt[0]; // which is really first or last, depends on pn.Gdir()
356 endpt[1] = pt[0];
357 double totang = 0;
358 double ang, ang2;
359 // int s_start[2];
360 // s_start[0]=0;
361 // s_start[1]=0;
362 int n;
363 for (n = 0; n < qpt - 1; n++) {
364 ang2 = 0.0;
365 ang = ang2projvec((pt[n] - fpt), (pt[n + 1] - fpt), pn.Gdir());
366 if (ang <= M_PI) {
367 // go to opposite direction of clock
368 totang += ang;
369 } else {
370 ang2 = 2 * M_PI - ang;
371 totang -= ang2;
372 }
373 }
374
375 if (fabs(totang) > 6.0) return 3;
376 return 0;
377}
378
379point polygon::cross(const straight& fsl, vfloat prec) const {
380 pvecerror("point polygon::cross(straight& fsl)");
381 point cpt = pn.cross(fsl); // does it cross the plane
382 // mcout<<"polygon::cross: cpt="<<cpt;
383 // mcout<<"vecerror="<<vecerror<<'\n';
384 if (vecerror != 0) return cpt;
385 int s = check_point_in(cpt, prec);
386 if (s > 0)
387 return cpt;
388 else {
389 vecerror = 1;
390 return cpt;
391 }
392}
393int polygon::range(const point& fpt, const vec& dir, vfloat& rng, point& fptenr,
394 vfloat prec) const {
395 pvecerror(
396 "int polygon::range(const point& fpt, const vec& dir, vfloat& rng, "
397 " point &fptenr)");
398 straight stl(fpt, dir);
399 point pnt = cross(stl, prec);
400 if (vecerror != 0) {
401 vecerror = 0;
402 return 0;
403 }
404 vec dif = pnt - fpt;
405 const int i = check_par(dif, dir, prec);
406 if (i == 1) {
407 rng = dif.length();
408 fptenr = pnt;
409 return 1;
410 } else
411 return 0;
412}
413
414std::ostream& operator<<(std::ostream& file, const polygon& p) {
415 Ifile << "polygon:\n";
416 indn.n += 2;
417 Ifile << "s_convex=" << p.s_convex << '\n';
418 // file << statcast(const polyline_pl&, p);
419 file << static_cast<const polyline_pl&>(p);
420 indn.n -= 2;
421 return file;
422}
423// *** rectangle ***
424absref absref::*(rectangle::aref_rct[4]) = {
425 (absref absref::*)&rectangle::pn, (absref absref::*)&rectangle::piv,
426 (absref absref::*)&rectangle::dir1, (absref absref::*)&rectangle::dir2};
427
429 aref_tran.pass(new absref_transmit(4, aref_rct, qpt + qsl, aref));
430}
431
432rectangle::rectangle(const point& fpiv, vec fdir[2], vfloat fdim[2],
433 vfloat prec) {
434 pvecerror(
435 "rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2], "
436 "vfloat prec)");
437 if (check_perp(fdir[0], fdir[1], prec) != 1) {
438 mcerr << "rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2]):\n"
439 << " error: sides are not perpendicular\n";
440 // There is stil no reason found in applications for sides to be
441 // necessary perpendicular. The only reason in name of this class
442 // choosen occasionly. To my knowledge it denotes a figure with
443 // perpendicular sides.
444 mcerr << "fdir[2](directions of sides):\n" << fdir[0] << fdir[1];
445 spexit(mcerr);
446 }
447 if (fdim[0] <= 0 || fdim[1] <= 0) {
448 mcerr << "rectangle::rectangle(point fpiv, vec fdir[2], vfloat fdim[2]):\n"
449 << " error: fdim[0] <=0 || fdim[1] <=0\n";
450 mcerr << "fdim (dimensions):" << fdim[0] << ' ' << fdim[1] << '\n';
451 mcerr << "fdir[2](directions of sides):\n" << fdir[0] << fdir[1];
452 spexit(mcerr);
453 }
454 piv = fpiv;
455 dir1 = unit_vec(fdir[0]);
456 dir2 = unit_vec(fdir[1]);
457 dim[0] = fdim[0];
458 dim[1] = fdim[1];
459 // mcout<<"piv:\n"<<piv;
460 // mcout<<"dir[2](directions of sides):\n"<<dir[0]<<dir[1];
461 // mcout<<"dim (dimensions):"<<dim[0]<<' '<<dim[1]<<'\n';
462 straight slh[4];
463 slh[0] = straight(piv + dir1 * dim[0] / 2.0, dir2);
464 slh[1] = straight(piv + dir2 * dim[1] / 2.0, -dir1);
465 slh[2] = straight(piv - dir1 * dim[0] / 2.0, -dir2);
466 slh[3] = straight(piv - dir2 * dim[1] / 2.0, dir1);
467 polygon::operator=(polygon(slh, 4, prec));
468}
469
470std::ostream& operator<<(std::ostream& file, const rectangle& f) {
471 Ifile << "rectangle:\n";
472 indn.n += 2;
473 Ifile << "piv:\n" << f.piv;
474 Ifile << "dir1,2(directions of sides):\n" << f.dir1 << f.dir2;
475 Ifile << "dim (dimensions):" << f.dim[0] << ' ' << f.dim[1] << '\n';
476 file << static_cast<const polygon&>(f);
477 indn.n -= 2;
478 return file;
479}
480
481// **** special quadrangle **** for cathode strip shamber
482
483absref absref::*(spquadr::aref_sp[4]) = {
484 (absref absref::*)&spquadr::pn, (absref absref::*)&spquadr::piv,
485 (absref absref::*)&spquadr::dir1, (absref absref::*)&spquadr::dir2};
486
488 aref_tran.pass(new absref_transmit(4, aref_sp, qpt + qsl, aref));
489}
490
492 vec axis = unit_vec(dir1 || dir2);
493 vec rv = dir1;
494 rv.turn(axis, angle);
495 rv = rv * rad;
496 point rpt = piv + rv;
497 return rpt;
498}
499
501 : polygon(sq),
502 piv(sq.piv),
503 dir1(sq.dir1),
504 dir2(sq.dir2),
505 awidth(sq.awidth) {
506 ;
507}
509 : polygon(sq),
510 piv(sq.piv),
511 dir1(sq.dir1),
512 dir2(sq.dir2),
513 awidth(sq.awidth) {
514 ;
515}
516
517spquadr::spquadr(const point& fpiv, const straight& sl1, const straight& sl2,
518 const vec& fdir1, const vec& fdir2, vfloat prec)
519 : polygon(), piv(fpiv), dir1(unit_vec(fdir1)), dir2(unit_vec(fdir2)) {
520 straight slh[4];
521 slh[0] = sl1;
522 slh[1] = straight(piv, dir1);
523 slh[2] = sl2;
524 slh[3] = straight(piv, dir2);
525 polygon plgn = polygon(slh, 4, prec);
526 *this = spquadr(fpiv, sl1, sl2, fdir1, fdir2, plgn);
527}
528
529std::ostream& operator<<(std::ostream& file, const spquadr& p) {
530 Ifile << "spquadr:\n";
531 indn.n += 2;
532 Ifile << "piv:";
533 file << p.piv;
534 Ifile << "dir1:\n";
535 file << p.dir1;
536 Ifile << "dir2:\n";
537 file << p.dir2;
538 Ifile << " awidth=" << p.awidth << '\n';
539 file << static_cast<const polygon&>(p);
540 indn.n -= 2;
541 return file;
542}
543}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define check_econd11a(a, signb, add, stream)
Definition: FunNameStack.h:172
#define spexit(stream)
Definition: FunNameStack.h:256
#define mfunname(string)
Definition: FunNameStack.h:45
Active pointer or automatic container or controlling pointer.
Definition: AbsPtr.h:199
void pass(X *fptr)
Definition: AbsPtr.h:247
Plane, defined by defined by a point and a vector normal to the plane.
Definition: plane.h:24
point cross(const straight &sl) const
Definition: plane.cpp:74
vec Gdir(void) const
Definition: plane.h:33
int check_point_in(const point &fp, vfloat prec) const
Definition: plane.cpp:67
Point.
Definition: vec.h:374
vec v
Definition: vec.h:376
Polygon in plane.
Definition: polyline.h:147
int range(const point &fpt, const vec &dir, vfloat &rng, point &fptenr, vfloat prec) const
Definition: polyline.cpp:393
int check_point_in(const point &fpt, vfloat prec) const
Definition: polyline.cpp:339
polygon & operator=(const polygon &fpl)
Definition: polyline.cpp:330
Polyline in plane.
Definition: polyline.h:120
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: polyline.cpp:236
polyline_pl & operator=(const polyline_pl &fpl)
Definition: polyline.cpp:260
static absrefabsref::* aref_pl
Definition: polyline.h:128
Polyline.
Definition: polyline.h:23
polyline & operator=(const polyline &fpl)
Definition: polyline.cpp:43
point * pt
Definition: polyline.h:26
straight * sl
Definition: polyline.h:28
int Gqsl() const
Definition: polyline.h:40
point Gpt(int n) const
Definition: polyline.h:32
void polyline_init(const point *fpt, int fqpt)
Definition: polyline.cpp:50
straight Gsl(int n) const
Definition: polyline.h:41
vfloat dist_two_inter(polyline &pl, vfloat prec) const
Distance between two intervals.
Definition: polyline.cpp:126
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: polyline.cpp:18
absref ** aref
Definition: polyline.h:51
int Gqpt() const
Definition: polyline.h:31
friend int plane::cross(const polyline &pll, point *crpt, int &qcrpt, polyline *crpll, int &qcrpll, vfloat prec) const
void polyline_del()
Definition: polyline.h:76
int check_point_in(const point &fpt, vfloat prec) const
Definition: polyline.cpp:76
vfloat distance(const point &fpt) const
Definition: polyline.cpp:147
Rectangle.
Definition: polyline.h:180
static absrefabsref::*[4] aref_rct
Definition: polyline.h:195
point piv
Central point.
Definition: polyline.h:183
vfloat dim[2]
Definition: polyline.h:189
vec dir1
Directions of sides, unit length.
Definition: polyline.h:185
vec dir2
Directions of sides, unit length.
Definition: polyline.h:187
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: polyline.cpp:428
virtual void get_components(ActivePtr< absref_transmit > &aref_tran)
Definition: polyline.cpp:487
vfloat awidth
Width of total plane in units of radians.
Definition: polyline.h:208
point pt_angle_rad(vfloat rad, vfloat angle)
Definition: polyline.cpp:491
static absrefabsref::*[4] aref_sp
Definition: polyline.h:217
Definition of straight line, as combination of vector and point.
Definition: straight.h:24
point cross(const straight &sl, vfloat prec) const
Definition: straight.cpp:54
vec Gdir(void) const
Definition: straight.h:33
vfloat distance(const straight &sl, int &type_of_cross, point pt[2]) const
Definition: straight.cpp:137
point Gpiv(void) const
Definition: straight.h:32
Definition: vec.h:186
vfloat length() const
Definition: vec.h:205
void turn(const vec &dir, vfloat angle)
Turn this vector.
Definition: vec.cpp:216
Definition: BGMesh.cpp:5
vfloat ang2projvec(const vec &r1, const vec &r2, const vec &normal)
Definition: vec.cpp:136
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:36
int vecerror
Definition: vec.cpp:29
bool apeq(const circumf &f1, const circumf &f2, vfloat prec)
Definition: circumf.cpp:44
DoubleAc fabs(const DoubleAc &f)
Definition: DoubleAc.h:615
int cross4pllines(const polyline pl[4], vfloat precision, straight &sl, point ptc[4][2])
Definition: polyline.cpp:200
indentation indn
Definition: prstream.cpp:15
double vfloat
Definition: vfloat.h:16
#define mcout
Definition: prstream.h:126
#define Ifile
Definition: prstream.h:196
#define mcerr
Definition: prstream.h:128
#define pvecerror(string)
Definition: vec.h:29