OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
DesignSketchTool.cpp File Reference
#include "slic3r/GUI/CAD/DesignSketchTool.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/ImGuiWrapper.hpp"
#include "slic3r/GUI/CAD/SketchInlineEditor.hpp"
#include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "libslic3r/format.hpp"
#include "libslic3r/Utils.hpp"
#include <Eigen/Core>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <Eigen/Geometry>
#include <functional>
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include "libslic3r/BuildVolume.hpp"
#include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/3DScene.hpp"
#include "slic3r/GUI/GLShader.hpp"
#include "libslic3r/CAD/GeometryEngine.hpp"
#include <BRepBndLib.hxx>
#include <BRep_Builder.hxx>
#include <Bnd_Box.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS_Compound.hxx>
#include <map>
#include "libslic3r/TriangleMesh.hpp"
#include <glad/gl.h>
#include "libslic3r/CAD/SketchEngine.hpp"
#include "libslic3r/Point.hpp"
#include <vector>
#include <math.h>
#include "libslic3r/CAD/SketchSolver.hpp"
#include "libslic3r/Line.hpp"
#include <string>
#include "libslic3r/CAD/SketchInference.hpp"
#include <utility>
#include "libslic3r/CAD/CadDocument.hpp"
#include "slic3r/GUI/GLModel.hpp"
#include "libslic3r/BoundingBox.hpp"
#include <initializer_list>
#include <wx/gdicmn.h>
#include <algorithm>
#include <climits>
#include <limits>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdarg>
#include <cstdlib>
#include <iterator>
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/Color.hpp"
#include "slic3r/GUI/GLSelectionRectangle.hpp"

Go to the source code of this file.

Namespaces

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

Functions

static bool Slic3r::GUI::entity_ref_point (const SketchEntity &e, Vec2d &out)
static void Slic3r::GUI::translate_entity (SketchEntity &e, const Vec2d &d)
static double Slic3r::GUI::point_segment_dist (const Vec2d &p, const Vec2d &a, const Vec2d &b)
static double Slic3r::GUI::entity_pick_dist (const Vec2d &p, const SketchEntity &e)
static bool Slic3r::GUI::point_in_poly (const Vec2d &q, const std::vector< Vec2d > &poly)
static bool Slic3r::GUI::ray_triangle (const Vec3d &ro, const Vec3d &rd, const Vec3d &v0, const Vec3d &v1, const Vec3d &v2, double &t)
static double Slic3r::GUI::ray_segment_dist3 (const Vec3d &ro, const Vec3d &rd, const Vec3d &a, const Vec3d &b)
static double Slic3r::GUI::ray_axis_proj (const Linef3 &ray, const Vec3d &anchor, const Vec3d &dir)
static wxPoint Slic3r::GUI::world_to_screen_px (const Camera &cam, const Vec3d &world)
static Vec2d Slic3r::GUI::ellipse_point (const Vec2d &c, double a, double b, double phi, double t)
static double Slic3r::GUI::ellipse_param_of (const Vec2d &center, double a, double b, double phi, const Vec2d &q)
static void Slic3r::GUI::trace_autoedit (const char *why, size_t n)
static int Slic3r::GUI::sketch_endpoint_roles (const SketchEntity &e, SketchPointRole out[2])
static std::vector< Vec2d > Slic3r::GUI::circle_polygon (const Vec2d &c, double r, int n=48)
static std::vector< Vec2d > Slic3r::GUI::ellipse_polyline (const Vec2d &c, double a, double b, double phi, double t0, double t1, int n=48)
static int Slic3r::GUI::bspline_degree (int n)
static std::vector< double > Slic3r::GUI::bspline_knots (int n, int p)
static Vec2d Slic3r::GUI::bspline_eval (const std::vector< Vec2d > &P, const std::vector< double > &U, int p, double u)
static std::vector< Vec2d > Slic3r::GUI::bspline_polyline (const std::vector< Vec2d > &ctrl, int samples=0)
static double Slic3r::GUI::wrap_2pi (double a)
static bool Slic3r::GUI::circumcircle (const Vec2d &a, const Vec2d &b, const Vec2d &c, Vec2d &center, double &radius)
static SketchEntity Slic3r::GUI::make_arc_through (const Vec2d &center, double radius, const Vec2d &start, const Vec2d &end, const Vec2d &through, bool construction)
static void Slic3r::GUI::ellipse_axes (const Vec2d &center, const Vec2d &major_end, const Vec2d &minor_pt, double &a, double &b, double &phi)
static void Slic3r::GUI::dp_pick_trace (const char *fmt,...)
static bool Slic3r::GUI::dp_pick_trace_on ()
static double Slic3r::GUI::display_edge_tol (const TopoDS_Shape &shape)
static void Slic3r::GUI::render_ribbons (GLModel &model, GLModel::Geometry &&g, const ColorRGBA &colour)
static bool Slic3r::GUI::rib_frame (const Vec2d &p0, const Vec2d &p1, double thickness, Vec2d &d, Vec2d &perp, Vec2d &mid, double &half)
std::vector< std::pair< Vec2d, Vec2d > > Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::text_strokes (const std::string &text, double height, Vec2d &size)
void Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::paint_back_to_front (std::vector< PlanePiece > &&in, size_t k, const std::vector< SketchPlane > &planes, double eps, const Vec3d &eye, const Vec3d &forward, bool perspective, std::vector< PlanePiece > &out)
double Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::label_height (double half)
Vec2d Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::label_centre (double half, const Vec2d &size)
Vec2d Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::datum_label_anchor (double half)
bool Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::is_base_plane (int base)
Vec3d Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::reference_octant ()
std::vector< PlanePiece > Slic3r::GUI::planes_back_to_front (const std::vector< SketchPlane > &planes, double half, const Vec3d &eye, const Vec3d &forward, bool perspective)
SketchPlane Slic3r::GUI::reference_square (const SketchPlane &plane, int base, double half)
std::array< Vec3d, 4 > Slic3r::GUI::reference_label_box (const SketchPlane &square, double half, const std::string &text)
int Slic3r::GUI::pick_reference_square (const std::vector< SketchPlane > &squares, double half, const Vec3d &from, const Vec3d &dir)
static Vec3d Slic3r::GUI::rv_yaxis (const Vec3d &axis, const Vec3d &ref, bool flip)
static Vec3d Slic3r::GUI::dr_yaxis (const Vec3d &axis, const Vec3d &ref)
static double Slic3r::GUI::pt_linear_len (double spacing, int count)
static std::vector< std::vector< Vec2d > > Slic3r::GUI::dash_polyline (const std::vector< Vec2d > &pts, bool closed, double dash, double gap)
double Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::poly_signed_area (const std::vector< Vec2d > &p)
bool Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::pt_in_tri (const Vec2d &p, const Vec2d &a, const Vec2d &b, const Vec2d &c)
std::vector< std::array< unsigned, 3 > > Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::ear_clip (const std::vector< Vec2d > &poly)
double Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::rad (double deg)
void Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::poly (std::vector< std::pair< Vec2d, Vec2d > > &out, std::initializer_list< Vec2d > p)
void Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::arc (std::vector< std::pair< Vec2d, Vec2d > > &out, double cx, double cy, double rx, double ry, double a0, double a1, int n=14)
void Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::glyph_strokes (char c, std::vector< std::pair< Vec2d, Vec2d > > &out, double &advance)
static bool Slic3r::GUI::entity_moved (const SketchEntity &a, const SketchEntity &b, double tol)
static void Slic3r::GUI::entity_endpoints (const SketchEntity &e, std::vector< Vec2d > &out)

Variables

static constexpr int Slic3r::GUI::kArcFacets = 24
static const Vec2d Slic3r::GUI::kBearOutline []
static const Vec2d Slic3r::GUI::kBearChin []
static const Vec3d Slic3r::GUI::kBearMarks []
static const double Slic3r::GUI::kBearPlateZ = +0.0360
static const Vec2d Slic3r::GUI::kBearSnoutBase []
static const Vec3d Slic3r::GUI::kBearCrest []
constexpr double Slic3r::GUI::anonymous_namespace{DesignSketchTool.cpp}::kPi = 3.14159265358979323846