OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::SketchProfile Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/CAD/SketchEngine.hpp>

Collaboration diagram for Slic3r::SketchProfile:

Public Member Functions

void clear ()
TopoDS_Wire to_occt_wire (const SketchPlane &plane) const
template<class Archive>
void serialize (Archive &ar)

Public Attributes

std::vector< Vec2d > points
bool closed {false}

Detailed Description

Member Function Documentation

◆ clear()

void Slic3r::SketchProfile::clear ( )
inline
75{ points.clear(); closed = false; }
bool closed
Definition SketchEngine.hpp:73
std::vector< Vec2d > points
Definition SketchEngine.hpp:72

References closed, and points.

◆ serialize()

template<class Archive>
void Slic3r::SketchProfile::serialize ( Archive & ar)
inline
79{ ar(points, closed); }

References closed, and points.

◆ to_occt_wire()

TopoDS_Wire Slic3r::SketchProfile::to_occt_wire ( const SketchPlane & plane) const
140{
141 if (points.size() < 2)
142 throw std::runtime_error(_u8L("Profile has fewer than 2 points"));
143
144 BRepBuilderAPI_MakeWire builder;
145 for (size_t i = 0; i < points.size(); ++i) {
146 Vec3d a3 = plane.to_world(points[i]);
147 Vec3d b3 = plane.to_world(points[(i + 1) % points.size()]);
148 gp_Pnt pa(a3.x(), a3.y(), a3.z());
149 gp_Pnt pb(b3.x(), b3.y(), b3.z());
150 builder.Add(BRepBuilderAPI_MakeEdge(pa, pb).Edge());
151 }
152 builder.Build();
153 if (!builder.IsDone())
154 throw std::runtime_error(_u8L("Failed to build wire from profile"));
155 return builder.Wire();
156}
@ Edge
Definition Measure.hpp:26
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, points, and Slic3r::SketchPlane::to_world().

Referenced by Slic3r::CadDocument::build_sketch_wire(), and Slic3r::SketchEngine::make_extrude_regions().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ closed

◆ points


The documentation for this struct was generated from the following files: