OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
NSVGUtils.cpp File Reference
#include "NSVGUtils.hpp"
#include <array>
#include <cassert>
#include <charconv>
#include <boost/nowide/iostream.hpp>
#include <boost/nowide/fstream.hpp>
#include <nanosvg/nanosvg.h>
#include <cstddef>
#include <string>
#include <memory>
#include <sstream>
#include <cstring>
#include <cmath>
#include "ClipperUtils.hpp"
#include "Emboss.hpp"
#include "Polygon.hpp"
#include "Polyline.hpp"
#include "EmbossShape.hpp"
#include "Point.hpp"
#include "libslic3r.h"
Include dependency graph for NSVGUtils.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{NSVGUtils.cpp}::LinesPath
struct  anonymous_namespace{NSVGUtils.cpp}::DashesParam

Namespaces

namespace  anonymous_namespace{NSVGUtils.cpp}
namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/

Functions

bool anonymous_namespace{NSVGUtils.cpp}::is_line (const float *p, float precision=1e-4f)
LinesPath anonymous_namespace{NSVGUtils.cpp}::linearize_path (NSVGpath *first_path, const NSVGLineParams &param)
HealedExPolygons anonymous_namespace{NSVGUtils.cpp}::fill_to_expolygons (const LinesPath &lines_path, const NSVGshape &shape, const NSVGLineParams &param)
HealedExPolygons anonymous_namespace{NSVGUtils.cpp}::stroke_to_expolygons (const LinesPath &lines_path, const NSVGshape &shape, const NSVGLineParams &param)
ExPolygonsWithIds Slic3r::create_shape_with_ids (const NSVGimage &image, const NSVGLineParams &param)
 Convert .svg opened by nanoSvg to shapes stored in expolygons with ids.
Polygons Slic3r::to_polygons (const NSVGimage &image, const NSVGLineParams &param)
 
Parameters
is_y_negativeFlag is y negative, when true than y coor is multiplied by -1

void Slic3r::bounds (const NSVGimage &image, Vec2f &min, Vec2f &max)
NSVGimage_ptr Slic3r::nsvgParseFromFile (const std::string &filename, const char *units, float dpi)
std::unique_ptr< std::string > Slic3r::read_from_disk (const std::string &path)
NSVGimage_ptr Slic3r::nsvgParse (const std::string &file_data, const char *units, float dpi)
NSVGimage * Slic3r::init_image (EmbossShape::SvgFile &svg_file)
size_t Slic3r::get_shapes_count (const NSVGimage &image)
 Iterate over shapes and calculate count.
Point::coord_type anonymous_namespace{NSVGUtils.cpp}::to_coor (float val, double scale)
bool anonymous_namespace{NSVGUtils.cpp}::need_flattening (float tessTol, const Vec2f &p1, const Vec2f &p2, const Vec2f &p3, const Vec2f &p4)
void anonymous_namespace{NSVGUtils.cpp}::flatten_cubic_bez (Points &points, float tessTol, const Vec2f &p1, const Vec2f &p2, const Vec2f &p3, const Vec2f &p4, int level)
 Convert cubic curve to lines Inspired by nanosvgrast.h function nsvgRasterize -> nsvg__flattenShape -> nsvg__flattenCubicBez https://github.com/memononen/nanosvg/blob/f0a3e1034dd22e2e87e5db22401e44998383124e/src/nanosvgrast.h#L335.
Polylines anonymous_namespace{NSVGUtils.cpp}::to_dashes (const Polyline &polyline, const DashesParam &param)

Class Documentation

◆ anonymous_namespace{NSVGUtils.cpp}::LinesPath

struct anonymous_namespace{NSVGUtils.cpp}::LinesPath
Collaboration diagram for anonymous_namespace{NSVGUtils.cpp}::LinesPath:
Class Members
Polygons polygons
Polylines polylines