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

Method write_segment

src/svgfill/src/arrange_polygons.cpp:418–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416 }
417
418 void write_segment(const Point_2& p, const Point_2& q, const std::string& name) {
419 if (enabled_) {
420 if (last_segment_name_ != name) {
421 last_segment_name_ = name;
422 obj << "o " << name << "\n";
423 }
424 obj << "v " << CGAL::to_double(p.x()) << " " << CGAL::to_double(p.y()) << " 0\n";
425 obj << "v " << CGAL::to_double(q.x()) << " " << CGAL::to_double(q.y()) << " 0\n";
426 obj << "l " << vi++;
427 obj << " " << vi++ << "\n";
428
429 svg << "<line class=\"" << name << "\" x1=\"" << CGAL::to_double(p.x()) << "\" y1=\"" << -CGAL::to_double(p.y()) << "\" x2=\"" << CGAL::to_double(q.x()) << "\" y2=\"" << -CGAL::to_double(q.y()) << "\" />\n";
430
431 obj << std::flush;
432 }
433 }
434
435 void write_polygon(const Polygon_with_holes_2& polygon, const std::string& name) {
436 if (enabled_) {

Callers 4

clean_noisy_pathsFunction · 0.80
clean_noisy_boundsFunction · 0.80
arrange_cgal_polygonsFunction · 0.80

Calls 1

to_doubleFunction · 0.50

Tested by

no test coverage detected