MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / is_parallel_2degree_node

Function is_parallel_2degree_node

src/svgfill/src/arrange_polygons.cpp:1696–1709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1694}
1695
1696bool is_parallel_2degree_node(Graph2D<K>::vertex_const_iterator vit) {
1697 auto it = vit->second.begin();
1698 auto& P = *it++;
1699 auto& Q = *it++;
1700 auto e1 = P - vit->first;
1701 auto e2 = vit->first - Q;
1702 if (e1.squared_length() == 0 || e2.squared_length() == 0) {
1703 // @todo why does this happen?
1704 return false;
1705 }
1706 e1 /= std::sqrt(CGAL::to_double(e1.squared_length()));
1707 e2 /= std::sqrt(CGAL::to_double(e2.squared_length()));
1708 return std::abs(CGAL::to_double(e1 * e2)) > (1. - 1.e-5);
1709};
1710
1711
1712void eliminate_colinear_vertices(Graph2D<K>& G) {

Callers 2

edge_slideFunction · 0.85

Calls 2

to_doubleFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected