AngelCAD  1.5-00
angelcad.h
Go to the documentation of this file.
1 
3 
7 class array {
8 public:
10  array(int&in);
11 
14  array(int&in, uint length);
15 
19  array(int&in, uint length, const T&in value);
20 
23  T& opIndex(uint index);
24 
27  T[]& opAssign(const T[]&in);
28 
30  bool empty() const;
31 
33  bool isEmpty() const;
34 
37  bool opEquals(const T[]&in) const;
38 
41  const T& opIndex(uint index) const;
42 
45  int find(const T&in value) const;
46 
50  int find(uint startAt, const T&in value) const;
51 
54  int findByRef(const T&in value) const;
55 
59  int findByRef(uint startAt, const T&in value) const;
60 
62  uint length() const;
63 
65  uint size() const;
66 
68  void erase(uint);
69 
72  void insert(uint index, const T&in value);
73 
76  void insert(uint index, const T[]&inout arr);
77 
80  void insertAt(uint index, const T&in value);
81 
84  void insertAt(uint index, const T[]&inout arr);
85 
87  void insertLast(const T&in value);
88 
89  void pop_back();
90 
92  void push_back(const T&in);
93 
95  void removeAt(uint index);
96 
97  void removeLast();
98 
101  void removeRange(uint start, uint count);
102 
104  void reserve(uint length);
105 
107  void resize(uint length);
108 
109  void reverse();
110 
114  void sort(array::less&in, uint startAt = 0, uint count = uint ( - 1 ));
115 
116  void sortAsc();
117 
120  void sortAsc(uint startAt, uint count);
121 
122  void sortDesc();
123 
126  void sortDesc(uint startAt, uint count);
127 
128 };
129 
131 class as_args {
132 public:
135  bool has_argument(string arg) const;
136 
139  double get_double(string arg) const;
140 
144  double get_double(string arg, double def) const;
145 
148  double get_unsigned_double(string arg) const;
149 
153  double get_unsigned_double(string arg, double def) const;
154 
157  int get_int(string arg) const;
158 
162  int get_int(string arg, int def) const;
163 
166  string get_string(string arg) const;
167 
171  string get_string(string arg, string def) const;
172 
175  uint get_uint(string arg) const;
176 
180  uint get_uint(string arg, uint def) const;
181 
182 };
183 
185 
186 class as_istream {
187 public:
190  as_istream& opShr(bool&out v);
191 
194  as_istream& opShr(double&out v);
195 
198  as_istream& opShr(float&out v);
199 
202  as_istream& opShr(int&out v);
203 
206  as_istream& opShr(int64&out v);
207 
210  as_istream& opShr(string&out v);
211 
214  as_istream& opShr(uint&out v);
215 
218  as_istream& opShr(uint64&out v);
219 
220 };
221 
223 class as_ostream {
224 public:
227  as_ostream& opShl(bool v);
228 
231  as_ostream& opShl(const string&in v);
232 
235  as_ostream& opShl(double v);
236 
239  as_ostream& opShl(float v);
240 
243  as_ostream& opShl(int64 v);
244 
247  as_ostream& opShl(uint64 v);
248 
249 };
250 
252 
253 class boundingbox {
254 public:
256  boundingbox();
257 
259 
260  bool is_empty() const;
261 
263 
264  double diagonal() const;
265 
267 
268  double dx() const;
269 
271 
272  double dy() const;
273 
275 
276  double dz() const;
277 
279 
280  pos3d@ center() const;
281 
283 
284  pos3d@ p1() const;
285 
287 
288  pos3d@ p2() const;
289 
291 
292  void enclose(pos3d@ p);
293 
294 };
295 
297 
298 class circle : public shape2d {
299 public:
301 
304  circle(const pos2d@ p1, const pos2d@ p2, const pos2d@ p3);
305 
307 
308  circle(double r);
309 
311 
312  double r() const;
313 
315 
316  double radius() const;
317 
318 };
319 
321 
323 class cone : public solid {
324 public:
326 
330  cone(double h, double r1, double r2, bool center = false);
331 
333 
334  double h() const;
335 
337 
338  double height() const;
339 
341 
342  double r1() const;
343 
345 
346  double r2() const;
347 
349 
350  double radius1() const;
351 
353 
354  double radius2() const;
355 
356 };
357 
359 class cube : public solid {
360 public:
363  cube(double size, bool center = false);
364 
366  double size() const;
367 
368 };
369 
371 
373 class cuboid : public solid {
374 public:
376 
380  cuboid(double dx, double dy, double dz, bool center = false);
381 
383 
384  double dx() const;
385 
387 
388  double dy() const;
389 
391 
392  double dz() const;
393 
394 };
395 
397 
399 class cylinder : public solid {
400 public:
402 
405  cylinder(double h, double r, bool center = false);
406 
408 
409  double h() const;
410 
412 
413  double height() const;
414 
416 
417  double r() const;
418 
420 
421  double radius() const;
422 
423 };
424 
426 
430 class difference2d : public shape2d {
431 public:
433 
435  difference2d(shape2d@ incl, shape2d@ excl);
436 
437 };
438 
440 
444 class difference3d : public solid {
445 public:
447 
449  difference3d(solid@ incl, solid@ excl);
450 
451 };
452 
454 
457 class fill2d : public shape2d {
458 public:
460 
461  fill2d(const shape2d@ s1);
462 
464 
465  fill2d(array<shape2d@>@ arr);
466 
467 };
468 
470 
471 class hmatrix : public tmatrix {
472 public:
474 
477  hmatrix(const vec3d@ xvec, const vec3d@ yvec, const pos3d@ pos = pos3d ( 0 , 0 , 0 ));
478 
480 
484  hmatrix(const vec3d@ xvec, const vec3d@ yvec, const vec3d@ zvec, const pos3d@ pos = pos3d ( 0 , 0 , 0 ));
485 
486 };
487 
489 
492 class hull2d : public shape2d {
493 public:
495 
497  hull2d(const shape2d@ s1, const shape2d@ s2);
498 
500 
503  hull2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3);
504 
506 
510  hull2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4);
511 
513 
518  hull2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4, const shape2d@ s5);
519 
521 
522  hull2d(array<shape2d@>@ arr);
523 
524 };
525 
527 
530 class hull3d : public solid {
531 public:
533 
535  hull3d(const solid@ s1, const solid@ s2);
536 
538 
541  hull3d(const solid@ s1, const solid@ s2, const solid@ s3);
542 
544 
548  hull3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4);
549 
551 
556  hull3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4, const solid@ s5);
557 
559 
560  hull3d(array<solid@>@ arr);
561 
562 };
563 
565 
569 class intersection2d : public shape2d {
570 public:
572 
574  intersection2d(const shape2d@ s1, const shape2d@ s2);
575 
577 
580  intersection2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3);
581 
583 
587  intersection2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4);
588 
590 
595  intersection2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4, const shape2d@ s5);
596 
598 
600 
601 };
602 
604 
608 class intersection3d : public solid {
609 public:
611 
613  intersection3d(const solid@ s1, const solid@ s2);
614 
616 
619  intersection3d(const solid@ s1, const solid@ s2, const solid@ s3);
620 
622 
626  intersection3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4);
627 
629 
634  intersection3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4, const solid@ s5);
635 
637 
639 
640 };
641 
643 class line2d {
644 public:
646 
648  line2d(const pos2d@ p1, const pos2d@ p2);
649 
651 
652  double length() const;
653 
655 
657  double project(pos2d@ point) const;
658 
660 
661  pos2d@ end1() const;
662 
664 
665  pos2d@ end2() const;
666 
668 
670  pos2d@ interpolate(double par) const;
671 
672 };
673 
675 class line3d {
676 public:
678 
680  line3d(const pos3d@ p1, const pos3d@ p2);
681 
683 
684  double length() const;
685 
687 
689  double project(pos3d@ point) const;
690 
692 
693  pos3d@ end1() const;
694 
696 
697  pos3d@ end2() const;
698 
700 
702  pos3d@ interpolate(double par) const;
703 
704 };
705 
707 
708 class linear_extrude : public solid {
709 public:
711 
713  linear_extrude(const shape2d@ shape, double height);
714 
716 
717  double height() const;
718 
719 };
720 
722 
723 class locsys3d {
724 public:
726 
728  locsys3d(const vec3d@ xvec, const vec3d@ zvec);
729 
731 
732  vec3d@ x() const;
733 
735 
736  vec3d@ y() const;
737 
739 
740  vec3d@ z() const;
741 
742 };
743 
745 
751 class map {
752 public:
754  map(int&in);
755 
758  map(int&in, map<T_key,T_value>@);
759 
762  T_value& find(const T_key&in);
763 
767  T_value& find(const T_key&in, bool&out);
768 
771  bool contains(const T_key&in);
772 
774  bool empty();
775 
778  bool erase(const map_iterator<T_key,T_value>&in);
779 
782  const T_value& get_opIndex(const T_key&in) const;
783 
788 
790  int size();
791 
795 
799 
802 
805 
808  map_iterator<T_key,T_value> find_iterator(const T_key&in);
809 
811  void SetDirectcomp(bool);
812 
813  void clear();
814 
816  void erase(const T_key&in);
817 
820  void insert(const T_key&in, const T_value&in);
821 
824  void set_opIndex(const T_key&in, const T_value&in);
825 
826 };
827 
830 public:
832  T_value& current_value();
833 
835  T_value& get_value();
836 
838  bool IsEnd();
839 
841  bool IsValid();
842 
844  bool next();
845 
848  bool opEquals(const map_iterator<T_key,T_value>&in);
849 
851  bool opPostInc();
852 
854  bool opPreInc();
855 
857  const T_key& current_key();
858 
860  const T_key& get_key();
861 
865 
867  void set_value(const T_value&in);
868 
869 };
870 
872 
877 class minkowski2d : public shape2d {
878 public:
880 
882  minkowski2d(const shape2d@ a, const shape2d@ b);
883 
884 };
885 
887 
892 class minkowski3d : public solid {
893 public:
895 
897  minkowski3d(const solid@ a, const solid@ b);
898 
899 };
900 
902 
903 class mirror : public tmatrix {
904 public:
906 
909  mirror(double dx, double dy, double dz);
910 
912 
914  mirror(vec3d@ normal, pos3d@ point = pos3d ( 0 , 0 , 0 ));
915 
917 
918  double dx() const;
919 
921 
922  double dy() const;
923 
925 
926  double dz() const;
927 
928 };
929 
931 
933 class offset2d : public shape2d {
934 public:
936 
940  offset2d(const shape2d@ profile, double r = 0x7fc00000, double delta = 0x7fc00000, bool chamfer = false);
941 
943 
947  offset2d(array<shape2d@>@ arr, double r = 0x7fc00000, double delta = 0x7fc00000, bool chamfer = false);
948 
949 };
950 
952 
954 class pface {
955 public:
957 
960  pface(uint iv1, uint iv2, uint iv3);
961 
963 
967  pface(uint iv1, uint iv2, uint iv3, uint iv4);
968 
970 
971  uint nvert() const;
972 
974 
976  uint vindex(uint iv) const;
977 
978 };
979 
981 class pointcloud {
982 public:
984  pointcloud(array<pos3d@>@ points);
985 
992  pointcloud(string file, int skip_lines = 0, int xtok = 0, int ytok = 1, int ztok = 2, string delimiters = ' ,;
993 ');
994 
996  pos3d*[]@ points_array() const;
997 
999  uint size() const;
1000 
1001 };
1002 
1004 
1005 class polygon : public shape2d {
1006 public:
1008 
1011  polygon(const pos2d@ p1, const pos2d@ p2, const pos2d@ p3);
1012 
1014 
1018  polygon(const pos2d@ p1, const pos2d@ p2, const pos2d@ p3, const pos2d@ p4);
1019 
1021 
1026  polygon(const pos2d@ p1, const pos2d@ p2, const pos2d@ p3, const pos2d@ p4, const pos2d@ p5);
1027 
1029 
1031  polygon(const spline2d@ spline, uint nseg = 30);
1032 
1034 
1036  polygon(double r, uint np);
1037 
1039 
1041  polygon(array<pos2d@>@ points, bool check = true);
1042 
1044 
1046  double area() const;
1047 
1049 
1051  double signed_area() const;
1052 
1054 
1056  pos2d@ vertex(uint iv) const;
1057 
1059 
1060  uint size() const;
1061 
1062 };
1063 
1065 
1067 class polyhedron : public solid {
1068 public:
1070 
1071  polyhedron(array<pos3d@>@ points);
1072 
1074 
1076  polyhedron(array<pos3d@>@ points, array<pface@>@ faces);
1077 
1079 
1081  polyhedron(string file, int id = - 1);
1082 
1084 
1086  double face_area(uint iface) const;
1087 
1089 
1090  double volume() const;
1091 
1093 
1095  pface@ face(uint iface) const;
1096 
1098 
1100  pos3d@ vertex(uint iv) const;
1101 
1103 
1104  uint nface() const;
1105 
1107 
1108  uint nvert() const;
1109 
1111 
1112  void flip_face(uint iface);
1113 
1115  void flip_faces();
1116 
1118 
1120  void set_vertex(uint iv, pos3d@ pos);
1121 
1123  void verify() const;
1124 
1125 };
1126 
1128 
1129 class pos2d {
1130 public:
1132 
1133  pos2d(const pos2d@ other);
1134 
1136 
1138  pos2d(double x, double y);
1139 
1141 
1143  double dist(const pos2d@ pos) const;
1144 
1146 
1147  double x() const;
1148 
1150 
1151  double y() const;
1152 
1154 
1156  pos2d@ opAdd(pos2d@ p1);
1157 
1159 
1161  pos2d@ opAdd(vec2d@ v1);
1162 
1164 
1166  pos2d@ opAdd_r(vec2d@ v1);
1167 
1169 
1171  pos2d@ opMul(double f1);
1172 
1174 
1176  pos2d@ opMul_r(double f1);
1177 
1179 
1181  pos2d@ opSub(vec2d@ v1);
1182 
1183 };
1184 
1186 
1187 class pos3d {
1188 public:
1190 
1191  pos3d(const pos3d@ other);
1192 
1194 
1197  pos3d(double x, double y, double z);
1198 
1200 
1202  double dist(const pos3d@ pos) const;
1203 
1205 
1206  double x() const;
1207 
1209 
1210  double y() const;
1211 
1213 
1214  double z() const;
1215 
1217 
1219  pos3d@ opAdd(pos3d@ p1);
1220 
1222 
1224  pos3d@ opAdd(vec3d@ v1);
1225 
1227 
1229  pos3d@ opAdd_r(vec3d@ v1);
1230 
1232 
1234  pos3d@ opMul(double f1);
1235 
1237 
1239  pos3d@ opMul_r(double f1);
1240 
1242 
1244  pos3d@ opSub(vec3d@ v1);
1245 
1246 };
1247 
1249 class projection2d : public shape2d {
1250 public:
1252  projection2d(const solid@ s);
1253 
1254 };
1255 
1257 
1259 class rectangle : public shape2d {
1260 public:
1262 
1265  rectangle(double dx, double dy, bool center = false);
1266 
1268 
1269  double dx() const;
1270 
1272 
1273  double dy() const;
1274 
1275 };
1276 
1278 
1281 class rotate_extrude : public solid {
1282 public:
1284 
1287  rotate_extrude(const shape2d@ shape, double deg, double pitch = 0.0);
1288 
1290 
1291  double deg() const;
1292 
1294 
1295  double rad() const;
1296 
1297 };
1298 
1300 
1301 class rotate_x : public tmatrix {
1302 public:
1304 
1306  rotate_x(double deg = 0x7fc00000, double rad = 0x7fc00000);
1307 
1309 
1310  double deg() const;
1311 
1313 
1314  double rad() const;
1315 
1316 };
1317 
1319 
1320 class rotate_y : public tmatrix {
1321 public:
1323 
1325  rotate_y(double deg = 0x7fc00000, double rad = 0x7fc00000);
1326 
1328 
1329  double deg() const;
1330 
1332 
1333  double rad() const;
1334 
1335 };
1336 
1338 
1339 class rotate_z : public tmatrix {
1340 public:
1342 
1344  rotate_z(double deg = 0x7fc00000, double rad = 0x7fc00000);
1345 
1347 
1348  double deg() const;
1349 
1351 
1352  double rad() const;
1353 
1354 };
1355 
1357 
1358 class scale : public tmatrix {
1359 public:
1361 
1362  scale(double s);
1363 
1365 
1368  scale(double sx, double sy, double sz = 1.0);
1369 
1371 
1372  double sx() const;
1373 
1375 
1376  double sy() const;
1377 
1379 
1380  double sz() const;
1381 
1382 };
1383 
1385 class shape {
1386 public:
1388 
1389  boundingbox@ box() const;
1390 
1392 
1393  tmatrix@ transform() const;
1394 
1396 
1397  void write_csg(string path);
1398 
1400 
1402  void write_xcsg(string path, double secant_tolerance = - 1.0);
1403 
1404 };
1405 
1407 
1408 class shape2d : public shape {
1409 public:
1411 
1413  shape2d@ opAdd(shape2d@ b);
1414 
1416 
1418  shape2d@ opAnd(shape2d@ b);
1419 
1421 
1423  shape2d@ opMul(tmatrix@ matrix);
1424 
1426 
1428  shape2d@ opSub(shape2d@ b);
1429 
1430 };
1431 
1433 
1434 class solid : public shape {
1435 public:
1437 
1439  solid@ opAdd(solid@ b);
1440 
1442 
1444  solid@ opAnd(solid@ b);
1445 
1447 
1449  solid@ opMul(tmatrix@ matrix);
1450 
1452 
1454  solid@ opSub(solid@ b);
1455 
1456 };
1457 
1459 
1460 class sphere : public solid {
1461 public:
1463 
1464  sphere(double r);
1465 
1467 
1468  double r() const;
1469 
1471 
1472  double radius() const;
1473 
1474 };
1475 
1477 
1478 class spline2d {
1479 public:
1481 
1482  spline2d(array<pos2d@>@ points);
1483 
1486  pos2d@ pos(double t) const;
1487 
1490  vec2d@ dir(double t) const;
1491 
1492 };
1493 
1495 
1496 class spline3d {
1497 public:
1499 
1500  spline3d(array<pos3d@>@ points);
1501 
1504  pos3d@ pos(double t) const;
1505 
1508  vec3d@ dir(double t) const;
1509 
1510 };
1511 
1513 
1515 public:
1517 
1520 
1522 
1525 
1526 };
1527 
1529 
1531 class square : public shape2d {
1532 public:
1534 
1536  square(double size, bool center = false);
1537 
1539 
1540  double size() const;
1541 
1542 };
1543 
1545 class string {
1546 public:
1548  bool empty() const;
1549 
1551  bool isEmpty() const;
1552 
1555  bool opEquals(const string&in) const;
1556 
1559  const uint8& opIndex(uint) const;
1560 
1564  int find(const string&in, uint start = 0) const;
1565 
1569  int findFirst(const string&in, uint start = 0) const;
1570 
1574  int findFirstNotOf(const string&in, uint start = 0) const;
1575 
1579  int findFirstOf(const string&in, uint start = 0) const;
1580 
1584  int findLast(const string&in, int start = - 1) const;
1585 
1589  int findLastNotOf(const string&in, int start = - 1) const;
1590 
1594  int findLastOf(const string&in, int start = - 1) const;
1595 
1598  int opCmp(const string&in) const;
1599 
1603  int rfind(const string&in, int start = - 1) const;
1604 
1607  string& opAddAssign(bool);
1608 
1611  string& opAddAssign(const string&in);
1612 
1615  string& opAddAssign(double);
1616 
1619  string& opAddAssign(float);
1620 
1623  string& opAddAssign(int64);
1624 
1627  string& opAddAssign(uint64);
1628 
1631  string& opAssign(bool);
1632 
1635  string& opAssign(const string&in);
1636 
1639  string& opAssign(double);
1640 
1643  string& opAssign(float);
1644 
1647  string& opAssign(int64);
1648 
1651  string& opAssign(uint64);
1652 
1655  string opAdd(bool) const;
1656 
1659  string opAdd(const string&in) const;
1660 
1663  string opAdd(double) const;
1664 
1667  string opAdd(float) const;
1668 
1671  string opAdd(int64) const;
1672 
1675  string opAdd(uint64) const;
1676 
1679  string opAdd_r(bool) const;
1680 
1683  string opAdd_r(double) const;
1684 
1687  string opAdd_r(float) const;
1688 
1691  string opAdd_r(int64) const;
1692 
1695  string opAdd_r(uint64) const;
1696 
1700  string substr(uint start = 0, int count = - 1) const;
1701 
1704  uint8& opIndex(uint);
1705 
1707  uint length() const;
1708 
1710  uint size() const;
1711 
1714  void erase(uint pos, int count = - 1);
1715 
1718  void insert(uint pos, const string&in other);
1719 
1721  void resize(uint);
1722 
1723 };
1724 
1726 
1727 class sweep : public solid {
1728 public:
1730 
1732  sweep(const shape2d@ shape, const spline_path@ path);
1733 
1734 };
1735 
1737 
1738 class tmatrix {
1739 public:
1741 
1743  pos2d@ opMul(pos2d@ obj);
1744 
1746 
1748  pos3d@ opMul(pos3d@ obj);
1749 
1751 
1752  pos3d@ origin() const;
1753 
1755 
1757  shape2d@ opMul(shape2d@ obj);
1758 
1760 
1762  solid@ opMul(solid@ obj);
1763 
1765 
1767  tmatrix@ opMul(const tmatrix@ B);
1768 
1770 
1771  vec3d@ xdir() const;
1772 
1774 
1775  vec3d@ ydir() const;
1776 
1778 
1779  vec3d@ zdir() const;
1780 
1782  void dump() const;
1783 
1784 };
1785 
1787 
1788 class transform_extrude : public solid {
1789 public:
1791 
1793  transform_extrude(const shape2d@ bottom, const shape2d@ top);
1794 
1795 };
1796 
1798 
1799 class translate : public tmatrix {
1800 public:
1802 
1803  translate(const vec3d@ v);
1804 
1806 
1809  translate(double dx, double dy, double dz = 0.0);
1810 
1812 
1813  double dx() const;
1814 
1816 
1817  double dy() const;
1818 
1820 
1821  double dz() const;
1822 
1823 };
1824 
1826 
1830 class union2d : public shape2d {
1831 public:
1833 
1835  union2d(const shape2d@ s1, const shape2d@ s2);
1836 
1838 
1841  union2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3);
1842 
1844 
1848  union2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4);
1849 
1851 
1856  union2d(const shape2d@ s1, const shape2d@ s2, const shape2d@ s3, const shape2d@ s4, const shape2d@ s5);
1857 
1859  union2d(array<shape2d@>@ arr);
1860 
1861 };
1862 
1864 
1868 class union3d : public solid {
1869 public:
1871 
1873  union3d(const solid@ s1, const solid@ s2);
1874 
1876 
1879  union3d(const solid@ s1, const solid@ s2, const solid@ s3);
1880 
1882 
1886  union3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4);
1887 
1889 
1894  union3d(const solid@ s1, const solid@ s2, const solid@ s3, const solid@ s4, const solid@ s5);
1895 
1897  union3d(array<solid@>@ arr);
1898 
1899 };
1900 
1902 
1903 class vec2d {
1904 public:
1906 
1908  vec2d(const pos2d@ p1, const pos2d@ p2);
1909 
1911 
1912  vec2d(const vec2d@ other);
1913 
1915 
1917  vec2d(double x, double y);
1918 
1920 
1922  double angle(const vec2d@ other) const;
1923 
1925 
1927  double cross(const vec2d@ other) const;
1928 
1930 
1932  double dot(const vec2d@ other) const;
1933 
1935 
1936  double length() const;
1937 
1939 
1940  double x() const;
1941 
1943 
1944  double y() const;
1945 
1947 
1949  vec2d@ opAdd(vec2d@ v1);
1950 
1952 
1954  vec2d@ opMul(double f1);
1955 
1957 
1959  vec2d@ opMul_r(double f1);
1960 
1962 
1964  vec2d@ opSub(vec2d@ v1);
1965 
1967  void normalise();
1968 
1969 };
1970 
1972 
1973 class vec3d {
1974 public:
1976 
1978  vec3d(const pos3d@ p1, const pos3d@ p2);
1979 
1981 
1982  vec3d(const vec3d@ other);
1983 
1985 
1988  vec3d(double x, double y, double z);
1989 
1991 
1993  double angle(const vec3d@ other) const;
1994 
1996 
1998  double dot(const vec3d@ other) const;
1999 
2001 
2002  double length() const;
2003 
2005 
2006  double x() const;
2007 
2009 
2010  double y() const;
2011 
2013 
2014  double z() const;
2015 
2017 
2019  vec3d@ cross(const vec3d@ other) const;
2020 
2022 
2024  vec3d@ opAdd(vec3d@ v1);
2025 
2027 
2029  vec3d@ opMul(double f1);
2030 
2032 
2034  vec3d@ opMul_r(double f1);
2035 
2037 
2039  vec3d@ opSub(vec3d@ v1);
2040 
2042  void normalise();
2043 
2044 };
Input stream (usable in console window only). Provides "cin" input stream.
Definition: angelcad.h:186
3d intersection boolean operation
Definition: angelcad.h:608
Extrude from botton to top shapes using transform.
Definition: angelcad.h:1788
void sortAsc()
Polyhedron face.
Definition: angelcad.h:954
Closed polyhedron volume defined by vertices and planar faces.
Definition: angelcad.h:1067
void removeLast()
2d hull operation, enclosing the input shapes
Definition: angelcad.h:492
2d fill operation, filling holes in input shapes
Definition: angelcad.h:457
3d Minkowski sum operation
Definition: angelcad.h:892
Abstract base for all primitives and booleans.
Definition: angelcad.h:1385
void pop_back()
2d profile offset
Definition: angelcad.h:933
Abstract base matrix for transformations.
Definition: angelcad.h:1738
Container iterator type for map.
Definition: angelcad.h:829
3d localsystem
Definition: angelcad.h:723
Rotation around y.
Definition: angelcad.h:1320
void insert(uint index, const T &in value)
Array of values or references.
Definition: angelcad.h:7
bool isEmpty() const
cone with axis in z-direction, by default extending from origin
Definition: angelcad.h:323
sphere, centered at origin
Definition: angelcad.h:1460
square, by default located in 1st quadrant touching origin
Definition: angelcad.h:1531
cuboid, by default in 1st octant with one corner toucing origin
Definition: angelcad.h:373
void reserve(uint length)
3d direction vector
Definition: angelcad.h:1973
2d position coordinates
Definition: angelcad.h:1129
Mirror transformation around given point.
Definition: angelcad.h:903
cylinder with axis in z-direction, by default extending from origin
Definition: angelcad.h:399
pointcloud, contains pos3d@ cloud
Definition: angelcad.h:981
Abstract base for 2d primitives and booleans.
Definition: angelcad.h:1408
3d line
Definition: angelcad.h:675
bool opEquals(const T[]&in) const
void removeAt(uint index)
array(int &in)
rectangle, by default located in 1st quadrant touching origin
Definition: angelcad.h:1259
3d cubic spline curve
Definition: angelcad.h:1496
Rotation around x.
Definition: angelcad.h:1301
bool empty() const
polygon, vertices in CCW order
Definition: angelcad.h:1005
Project from 3d to 2d.
Definition: angelcad.h:1249
void push_back(const T &in)
Extrude 2d shape in z direction into 3d solid.
Definition: angelcad.h:708
bounding box aligned with system axes
Definition: angelcad.h:253
3d union boolean operation
Definition: angelcad.h:1868
void erase(uint)
3d difference boolean operation
Definition: angelcad.h:444
uint size() const
2d Minkowski sum operation
Definition: angelcad.h:877
2d intersection boolean operation
Definition: angelcad.h:569
Translation in x, y and z.
Definition: angelcad.h:1799
Script input arguments.
Definition: angelcad.h:131
uint length() const
Sweep 2d shape along path curve to create 3d solid.
Definition: angelcad.h:1727
Template container storing sorted keys and values: map<T_key,T_value>
Definition: angelcad.h:751
int find(const T &in value) const
int findByRef(const T &in value) const
Extrude 2d shape CCW in XZ plane into 3d solid.
Definition: angelcad.h:1281
3d hull operation, enclosing the input solids
Definition: angelcad.h:530
void resize(uint length)
Abstract base for 3d primitives and booleans.
Definition: angelcad.h:1434
T & opIndex(uint index)
void reverse()
cube, by default in 1st octant with one corner toucing origin
Definition: angelcad.h:359
Output stream allowing expressions like: cout << "Hello World!" << endl;.
Definition: angelcad.h:223
2d direction vector
Definition: angelcad.h:1903
Homogeneous transformation matrix.
Definition: angelcad.h:471
Scaling transformation.
Definition: angelcad.h:1358
2d line
Definition: angelcad.h:643
3d position coordinates
Definition: angelcad.h:1187
2d cubic spline curve
Definition: angelcad.h:1478
void removeRange(uint start, uint count)
void insertAt(uint index, const T &in value)
String type similar to C++ strings.
Definition: angelcad.h:1545
T &[] opAssign(const T[]&in)
void sortDesc()
spline_path for sweep
Definition: angelcad.h:1514
void sort(array::less &in, uint startAt=0, uint count=uint(- 1))
2d union boolean operation
Definition: angelcad.h:1830
Rotation around z.
Definition: angelcad.h:1339
2d difference boolean operation
Definition: angelcad.h:430
circle, centered at origin
Definition: angelcad.h:298
void insertLast(const T &in value)