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

Function edge_supports_same_line

src/svgfill/src/arrange_polygons.cpp:1096–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094}
1095
1096bool edge_supports_same_line(
1097 const DPoint& seed_a,
1098 const DPoint& seed_b,
1099 const DPoint& test_a,
1100 const DPoint& test_b,
1101 double angle_tol_deg = 3.,
1102 double line_dist_tol = 0.15)
1103{
1104 auto d_seed = seed_b - seed_a;
1105 auto d_test = test_b - test_a;
1106 if (d_seed.squared_length() < 1.e-18 || d_test.squared_length() < 1.e-18) {
1107 return false;
1108 }
1109 if (angle_between_dirs_deg(d_seed, d_test) > angle_tol_deg) {
1110 return false;
1111 }
1112 return
1113 point_line_distance(test_a, seed_a, d_seed) <= line_dist_tol &&
1114 point_line_distance(test_b, seed_a, d_seed) <= line_dist_tol;
1115}
1116
1117std::vector<LineRun> runs_from_graph(const CenterLineGraphData& graph, double angle_tol_deg = 3., double line_dist_tol = 0.15) {
1118 std::vector<bool> visited(graph.edges.size(), false);

Callers 1

runs_from_graphFunction · 0.85

Calls 2

angle_between_dirs_degFunction · 0.85
point_line_distanceFunction · 0.85

Tested by

no test coverage detected